Jump to content

elytraByte

Members
  • Posts

    9
  • Joined

  • Last visited

elytraByte's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. the test.json recipe was the recipe that I was alluding to. Although it seems that separator.json was the file throwing the error!
  2. Hello, I am working to implement a json recipe file into one of my mod's machine blocks. Everything seems to be going as desired, except I am getting the following error on startup. https://gist.github.com/elytraByte/62e6b3a56c1342c7c64b4c85a8505dc5 My recipe file has the following: { "type": "boulanger:separating", "ingredients": [ { "item": "boulanger:hard_red_spring_wheat_item" } ], "output": [ { "item": "boulanger:wheat_berries", "chance": 1.0 }, { "item": "minecraft:iron_nugget", "chance": 0.1 } ] } As you can see, the recipe file contains the "type" so I am confused as to how I am receiving this error. My recipe serializer lives in this class. You can view all my code on my Github repository. Thank you for your time and insight!
  3. Well when I refactored, I must have made an error. Changing the location of my recipes folder has fixed the issue of the recipes producing a result inside the Stone Mill. I'm sorry I am still new at this. I appreciate your assistance.
  4. I must have something wrong then because buf.writeItem(recipe.output) doesn't work either.
  5. After looking into this issue some more, I have made some changes to my methods. I have added level.registryAccess() to my getResultItem() fields but my recipes are still not functioning. I've committed my changes to my repo for viewing. @Override public void toNetwork(FriendlyByteBuf buf, StoneMillRecipe recipe) { buf.writeInt(recipe.getIngredients().size()); for (Ingredient ing : recipe.getIngredients()) { ing.toNetwork(buf); } buf.writeItem(recipe.getResultItem(level.registryAccess())); }
  6. I am working to add recipes to my tile entity, but I've run into an issue. The method getResultItem from the Recipe class requires a Registry Access parameter, but I am not sure what to place in this field. Does anyone have any information on how I should proceed? Here is my method that use getResultItem @Override public void toNetwork(FriendlyByteBuf buf, StoneMillRecipe recipe) { buf.writeInt(recipe.getIngredients().size()); for (Ingredient ing : recipe.getIngredients()) { ing.toNetwork(buf); } buf.writeItemStack(recipe.getResultItem(), false); } All my code is available on my Github. The file in question is here. Thank you for your time!
  7. Oh what an oversight on my part! Adding a line to my main class has resolved this issue! Thank you so much for the help!
  8. I've looked through the primer on porting and I've made some changes to the code: private static <T extends Block> RegistryObject<Item> registerBlockItem(String name, RegistryObject<T> block) { return ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties())); } This doesn't show any errors in IntelliJ, but I get a java.lang.NullPointerException: Registry Object not present: boulanger:hard_red_spring_wheat now. Crash report. I thought that I was registering my block with the following code: public static final RegistryObject<Block> HARD_RED_SPRING_WHEAT = BLOCKS.register("hard_red_spring_wheat", () -> new HardRedSpringWheat(BlockBehaviour.Properties.copy(Blocks.WHEAT))); My class file as well as all the source code on Github.
  9. I am using the latest version (1.19.4-45.0.40) of forge to develop a mod. I can't seem to find any up to date information on the newest changes and I am stuck now. I have a custom crop that I am trying to register with the following code: private static <T extends Block> RegistryObject<Item> registerBlockItem(String name, RegistryObject<T> block, CreativeModeTab tab) { return ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties().tab(tab))); } Item.Properties does not have a tab method anymore and I am not sure what I need to do to fix this issue. My complete class file is on Github. Thanks everyone!
×
×
  • Create New...

Important Information

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