Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/09/20 in all areas

  1. You're welcome...Does it work correctly now?
    1 point
  2. OK thanks you guys.๐Ÿ˜๐Ÿ˜
    1 point
  3. They call it a crafting pad, but yeah the code shouldn't be overwhelming. hohserg mentioned another good place, although that mod's in 1.12.
    1 point
  4. Instead of storing a collection of items and comparing the contents of a the crafting grid against them, recipes now store a collection of Ingredient objects and ask each one whether the contents of the crafting grid match. Recipes are now stored in a Forge registry, so each one has a unique registry name. This also means that they should be registered in the corresponding registry event using IForgeRegistry#register. GameRegistry.addShapedRecipe works much like it did before, but now it requires you to specify the registry name (the first parameter) an optional recipe book group (the second parameter). Recipes with the same group will be shown together in the recipe book. The vararg parameter should contain the shape strings followed by the character and ingredient pairs, just like before. The ingredients can be ItemStacks, Items, Blocks, Strings (for ore dictionary matching) or Ingredients. I highly recommend learning the JSON system. If you're getting errors that you don't understand, post them along with your JSON files and we can try to help you. That's not quite what the OP is looking for. Forge already allows you to specify conditions for a recipe that can disable it at load time, that class allows you to specify conditions for an individual ingredient. diesieben07 explains how to create your own conditions here:
    1 point
  5. Only use AttachCapabilitiesEvent to attach capabilities to external objects. For your own Items, override Item#initCapabilities to return a new instance of an ICapabilityProvider implementation that provides the capability instance. Your ICapabilityProvider should store the IItemHandler instance, implement ICapabilityProvider#hasCapability to return true if the Capability argument is CapabilityItemHandler.ITEM_HANDLER_CAPABILITY and implement ICapabilityProvider#getCapability to return the IItemHandler instance if the Capability argument is CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.
    1 point
  6. If you put your recipe JSONs in a assets/modid/recipes package/directory, they will be automatically loaded by forge. If you are having trouble with the formatting of the files, look at how Vanilla does it. You can also search your log for JSON parsing errors, they will tell you what line and column any JSON errors appear on. As for having configs for disabling recipes, I'm not sure how it works but I think Choonster's test mod has something like that here: https://github.com/Choonster-Minecraft-Mods/TestMod3/blob/1.12.1/src/main/java/choonster/testmod3/crafting/ingredient/ConditionalIngredientFactory.java Trying to make recipes work without JSON files is a lot of unnecessary hard work, if you learn how to use the new system it will be a lot easier for you.
    0 points
×
×
  • Create New...

Important Information

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