Jump to content

Choonster

Moderators
  • Posts

    5117
  • Joined

  • Last visited

  • Days Won

    75

Everything posted by Choonster

  1. You could try looking at Botania's animated Mana Pump model: blockstates, base model, head model, armatures, animations.
  2. I don't think you need an entity model (ModelBase). I don't have much experience with the animation system myself, so I can't tell you all that much about it. I have the Forge Modder title on this forum, but that just indicates that I make mods with Forge; I don't develop Forge itself.
  3. There's no need to use Sponge for this, you can use ClientChatEvent (on the client) or ServerChatEvent (on the server) to intercept and change/cancel chat messages.
  4. The OP is using Forge's model animation system, which requires specifying the animations in JSON files. Unfortunately, I can't really provide any further help on this topic.
  5. Do you mean changing the lambda passed to LazyOptional#map to return Optional<IItemHandler> instead of just IItemHandler? I suppose that could work, though it seems a bit weird to nest the two different optional classes like that.
  6. I have this method that gets a LazyOptional of a player's inventory IItemHandler and searches for the first slot with an item that matches a predicate. If it finds a valid item, it returns a LazyOptional of a single-slot IItemHandler that wraps that slot. If it doesn't, it returns an empty LazyOptional. Currently there's no direct way for LazyOptional#map to transform a non-empty LazyOptional into an empty one, so I've had to use EmptyHandler.INSTANCE as a sentinel value and call LazyOptional#filter to transform that value into an empty LazyOptional. My main concern is that LazyOptional#filter has a comment inside saying "Should we allow this function at all?" due to it being a non-lazy operation, so I'm somewhat reluctant to use it. Java's Optional#map allows the function to return null to create an empty Optional, but Forge's LazyOptional#map uses a NonNullFunction so returning null isn't an option. Is there a better way to map a non-empty LazyOptional into an empty one?
  7. Yes, but you need to do this before you try to add any remapping. Essentially, yes. When it finds your_mod:old_variant_block_with_subtypes in the save, it converts it to the new block based on the metadata: If the metadata corresponds to the variant foobar, it's converted into your_mod:foobar_variant_block If the metadata corresponds to the variant barbaz, it's converted into your_mod:barbaz_variant_block your_mod:foobar_variant_block and your_mod:barbaz_variant_block would be two separate instances of the same Block class.
  8. ItemBlock uses the Block's creative tab, so calling Item#setCreativeTab on an ItemBlock won't do anything.
  9. I have a DataFixer designed to flatten blocks in preparation for 1.13 here (the flattening definitions are initialised here). You should be able to use it to achieve this remapping. If you decide to use it, make sure you understand how it works first.
  10. setupDecompWorkspace doesn't exist any more. Import build.gradle into your IDE as a Gradle project, then run the genIntellijRuns or genEclipseRuns task as appropriate.
  11. It's the thread stickied at the top of this forum called "Rules and EAQ - READ FIRST OR YOU WILL GET BANNED!!!".
  12. The BlockFlattening.create method creates an instance and initialises it with the blocks to be flattened. The instance is registered with the mod's ModFixes instance here, this is called in init.
  13. I've written a block flattening DataFixer in 1.12.2 for my mod's variant blocks here. If you use this code, make sure you understand what it's doing.
  14. Use Entity#getType to get its EntityType, which is an IForgeRegistryEntry.
  15. Instead of constructing the PacketBuffer, writing to it and then calling openGui, simply call openGui with a lambda function that writes to the supplied PacketBuffer. Forge constructs the PacketBuffer for you.
  16. Your most recent few posts with these pre-written snippets of advice have been poorly formatted on the dark theme: To fix it, you should be able to use the Tx (Remove Format) button and then re-apply the code formatting to the necessary parts. Normally I'd PM you this, but unfortunately the forum wants me to delete a whole lot of PMs in my inbox before I can send another one.
  17. You'll need to create your own IRecipe implementation (optionally extending an existing one like ShapelessRecipes) that implements IRecipe#getRemainingItems to return the appropriate remaining items. You'll also need an IRecipeFactory to parse your recipe from JSON, this needs to be registered in _factories.json. You can see some examples of custom recipes and factories here and the _factories.json file here.
  18. It looks like TagCollection#getOwningTags does this, but it's a client-only method so you'll need to copy its logic rather than call it directly. This iterates through all registered tags of the TagCollection's type, so you may need to cache the results if you call this frequently.
  19. Thanks, that makes sense. I'm wondering how this approach would work in 1.13 with its removal of the current lifecycle events such as preInit. The closet equivalent would be the mod construction event (don't have the exact name at the moment), but I think that the documentation only suggests initialising registry entries in the appropriate registry events.
  20. I'd be curious to know what the proper way to handle records is. I've just realised that my record item hasn't worked since I switched to instantiating registry entries in registry events; because the SoundEvent passed to the constructor doesn't yet exist when RegistryEvent.Register<Item> is fired. It's possible to override ItemRecord#getSound to return the SoundEvent directly (ignoring the ItemRecord#sound field), but this requires adding the record to the ItemRecord.RECORDS map manually so that Minecraft will display the record name above the hotbar when it's played. Is there a better way to do this?
  21. You may want to look at Forge's FancyMissingModel, which uses SimpleModelFontRenderer to render the location of the missing model.
  22. They edited the OP with a link to their GitHub repository.
  23. You'll need to explain exactly what you mean by "couldn't get access to the jar file". What are you doing and what exactly what error are you getting?
  24. I think I know what's going on now. The missing recipe IDs warning isn't from Forge loading the IDs saved with the world, it's from Forge loading the server's IDs into the client's registries. This means that the server has several recipes that the client doesn't know about, which is probably due to the client and server having different versions of Thermal Foundation installed.
  25. It looks like Forge is complaining because there are recipe IDs saved in your world that no longer exist in Thermal Foundation. The strange thing is, the recipe registry is explicitly configured to not be saved to the disk; so there shouldn't be any saved recipe IDs in the first place (and there aren't in any of my worlds). Are you using any mods apart from Thermal Foundation/OTG? Could you please post your world's level.dat file?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.