Posted July 24, 20196 yr Hello, Does anyone find how to implement a brewing reciepe in 1.13.2 yet ? It doesn't seem to be in datapack, the fonction "addmix" in PotionBrewing class is now private, and IForgeRegistry doesn't work for this class (as it's neither Potion class, neither PotionType class) Thank
July 25, 20196 yr This was registered as an issue. Probably pretty low on the devs priority list for 1.14 just yet though. https://github.com/MinecraftForge/MinecraftForge/issues/5814
July 25, 20196 yr Author ok ty i'll probably try to see if i can rewitre entirely the brewing_stand by now ^^ it's a lot of work for a tiny potion, but as long as it works as final ...
July 26, 20196 yr On 7/25/2019 at 3:17 PM, sunsigne said: ok ty i'll probably try to see if i can rewitre entirely the brewing_stand by now ^^ it's a lot of work for a tiny potion, but as long as it works as final ... Even if there is no way of adding a brewing recipe, there is reflection. It would be better than copying & pasting an entire vanilla class and screwing all mods with custom brewing stands... Edited July 26, 20196 yr by DavidM Some tips: Spoiler Modder Support: Spoiler 1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code. 2. Always post your code. 3. Never copy and paste code. You won't learn anything from doing that. 4. Quote Programming via Eclipse's hotfixes will get you nowhere 5. Learn to use your IDE, especially the debugger. 6. Quote The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it. Support & Bug Reports: Spoiler 1. Read the EAQ before asking for help. Remember to provide the appropriate log(s). 2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.
July 30, 20196 yr Author Perfect ! I finally found out how to register potion recipes ! (thank to reflection) for curious people, here is the solution : Spoiler In MAIN class : public YourMainClass () { FMLJavaModLoadingContext.get().getModEventBus().addListener(this::RegisterPlus); } private void RegisterPlus(final FMLCommonSetupEvent event) { try { RegisterPlus.addMix(PotionTypes.AWKWARD, Items.REDSTONE, ModPotionType.your_potion); } catch (Exception e) { e.printStackTrace();} } In a classe you called RegisterPlus : public class RegisterPlus { public static void addMix(PotionType p_193357_0_, Item p_193357_1_, PotionType p_193357_2_) throws Exception { Method method = PotionBrewing.class.getDeclaredMethod("addMix", PotionType.class, Item.class, PotionType.class); method.setAccessible(true); method.invoke(null, p_193357_0_, p_193357_1_, p_193357_2_); } } Hope it will help someone ^^
July 30, 20196 yr If you only need to use addMix there is also a non-reflection alternative that uses a brewing recipe via BrewingRecipeRegistry.addRecipe(...). Note there is a bug (1.14.3) in the Forge default BrewingRecipe so you should roll your own fixing the following in the isInput method like: public class ModBrewingRecipe extends BrewingRecipe { public ModBrewingRecipe(ItemStack input, Ingredient ingredient, ItemStack output) { super(input,ingredient,output); } @Override public boolean isInput(ItemStack stack) { return ItemStack.areItemsEqual(super.getInput(),stack); //THIS IS BROKEN in super 1.14.3 } } Pass in filled in potion itemstacks (see PotionUtils.addPotionToItemStack) for the input and outputs (eg Awkward potion -> Your potion)
July 31, 20196 yr 9 hours ago, sunsigne said: public static void addMix(PotionType p_193357_0_, Item p_193357_1_, PotionType p_193357_2_) throws Exception { Method method = PotionBrewing.class.getDeclaredMethod("addMix", PotionType.class, Item.class, PotionType.class); method.setAccessible(true); method.invoke(null, p_193357_0_, p_193357_1_, p_193357_2_); } Reflection is expensive. Use it once and store the method in a static field. Some tips: Spoiler Modder Support: Spoiler 1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code. 2. Always post your code. 3. Never copy and paste code. You won't learn anything from doing that. 4. Quote Programming via Eclipse's hotfixes will get you nowhere 5. Learn to use your IDE, especially the debugger. 6. Quote The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it. Support & Bug Reports: Spoiler 1. Read the EAQ before asking for help. Remember to provide the appropriate log(s). 2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.