Jump to content

Choonster

Moderators
  • Posts

    5160
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. Use its value (32767) directly.
  2. 1.7.10 is no longer supported here, update if you want help.
  3. I don't call it from anywhere, the @Mod.EventBusSubscriber annotation automatically subscribes it to the Forge event bus in the mod construction phase.
  4. I register my Blocks in the ModBlocks.RegistrationHandler class. Which version of Forge are you using? Post your code.
  5. Forge's documentation explains this here. For examples, look at some of my mod's init classes.
  6. ItemSpear is (presumably) a subclass of Item, so it's entirely possible for a method with Item as the return type to return an instance of ItemSpear. Checking if an ItemSpear is an instance of Item is pointless, since it will always be true. That part of the OP's code is correct. Using unlocalised names for anything except translation/display purposes is a bad idea, since they're not unique and can change at any time.
  7. There was a major overhaul of the registry system in Forge 1.12-14.21.0.2348, so any mod built for an earlier version of Forge is unlikely to work. Forge for 1.12 isn't yet stable, so breaking changes will be common until the first stable version. If you want help with the freeze, post the new FML log.
  8. It's the thread stickied at the top of the Support & Bug Reports section.
  9. In previous versions of Minecraft, it was possible to create a handler for ItemTooltipEvent in common code without crashing the dedicated server as long as you didn't reference any client-only classes. In 1.12, ItemTooltipEvent now references the client-only ITooltipFlag, which crashes the dedicated server with a ClassNotFoundException when you create a handler for the event in common code (unless you mark the handler method as client-only). I suggest moving the event to a client package or at least mentioning that it's client-only in the doc comment.
      • 1
      • Like
  10. You don't need to do anything, Forge automatically loads every file in the recipes directory of each mod's assets.
  11. I made my own Ingredient class for this, but it would make sense for minecraft:item_nbt to create an NBT-sensitive Ingredient.
  12. Replace "modID" with your actual mod ID and include your mod ID in the unlocalised name (e.g. by making it the String form of the registry name ResourceLocation). The numeric ID can be any number unique to your mod, though it's probably easiest if you start from 0 and increment by 1 each time you register an entity. It's used in the entity spawn packet. You can see how I register my mod's entities here.
  13. The ResourceLocation parameter is the registry name of your entity, which should have your mod ID as the domain and a name unique within your mod as the path. This is just like the registry name of a Block, Item or other IForgeRegistryEntry implementation. The String parameter is the unlocalised name of your entity, used for translation/display purposes. I recommend using the String form of the registry name as the unlocalised name.
  14. Use EntityRegistry.registerModEntity in preInit to register an entity. Use RenderingRegistry.registerEntityRenderingHandler(Class<T>, IRenderFactory<? super T>) in preInit from a client-only class to register an entity renderer.
  15. Similar questions have been asked (and answered) here and here. I implemented a solution the to the latter thread myself, you can see the API here and the implementation here. This uses a World capability to store the Map<ChunkPos, IChunkEnergy> at runtime, but loads the IChunkEnergy and saves it to the chunk's data using ChunkDataEvent.Load/Save.
  16. I'm pretty sure the recipe system we have now is what those comments are talking about, they just haven't been updated yet. Now that IRecipe extends IForgeRegistryEntry, you can add a recipe in code by registering an IRecipe object with ForgeRegistries.RECIPES; just like any other IForgeRegistryEntry. I think using the JSON system where possible is preferred, though.
  17. Override Block#getFlammability and Block#getFireSpreadSpeed.
  18. Once you've done this, make sure you don't install 1.11.2 mods in the 1.8.9 profile and vice versa.
  19. Set a different game directory for each launcher profile.
  20. Not that know of. Look at the examples I linked and the IRecipeFactory implementations in CraftingHelper.init.
  21. There have been a few other threads about this, including this one where I just explained how to add recipes to someone else.
  22. Either use a JSON file for the recipe (recommended) or create the recipe in code and register it with ForgeRegistries.RECIPES. Those methods are deprecated and non-functional (and will probably be removed). I have some examples of recipe files here and the recipe/ingredient classes used by them (apart from the Vanilla/Forge ones) here. LexManos has some prototype examples here.
  23. "Not working" doesn't tell us anything. If you want help with a problem, describe exactly what's not working and post the relevant code.
  24. Bukkit is dead, so nobody's going to develop a Bukkit API for modern versions of Forge. Sponge is plugin API that was created after the death of Bukkit and supports both Vanilla and Forge.
  25. Due to the nature of Minecraft and Forge, Forge mods only support the Minecraft version that they were built for. The exceptions to this rule occur when not much was changed between Minecraft versions. 1.8.9 can load 1.8.8 mods, 1.10.2 can load 1.9 - 1.10 mods and 1.11.2 can load 1.11 mods.
      • 1
      • Like
×
×
  • Create New...

Important Information

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