diff --git a/patches/minecraft/net/minecraft/potion/PotionHelper.java.patch b/patches/minecraft/net/minecraft/potion/PotionHelper.java.patch new file mode 100644 index 0000000000..eee86e03c9 --- /dev/null +++ b/patches/minecraft/net/minecraft/potion/PotionHelper.java.patch @@ -0,0 +1,67 @@ +--- ../src-base/minecraft/net/minecraft/potion/PotionHelper.java ++++ ../src-work/minecraft/net/minecraft/potion/PotionHelper.java +@@ -88,7 +88,7 @@ + { + PotionHelper.MixPredicate mixpredicate = (PotionHelper.MixPredicate)field_185214_b.get(i); + +- if (mixpredicate.field_185198_a == item && mixpredicate.field_185199_b.apply(p_185206_1_)) ++ if (mixpredicate.field_185198_a.get() == item && mixpredicate.field_185199_b.apply(p_185206_1_)) + { + return true; + } +@@ -106,7 +106,7 @@ + { + PotionHelper.MixPredicate mixpredicate = (PotionHelper.MixPredicate)field_185213_a.get(i); + +- if (mixpredicate.field_185198_a == potiontype && mixpredicate.field_185199_b.apply(p_185209_1_)) ++ if (mixpredicate.field_185198_a.get() == potiontype && mixpredicate.field_185199_b.apply(p_185209_1_)) + { + return true; + } +@@ -127,9 +127,9 @@ + { + PotionHelper.MixPredicate mixpredicate = (PotionHelper.MixPredicate)field_185214_b.get(i); + +- if (mixpredicate.field_185198_a == item && mixpredicate.field_185199_b.apply(p_185212_0_)) ++ if (mixpredicate.field_185198_a.get() == item && mixpredicate.field_185199_b.apply(p_185212_0_)) + { +- return PotionUtils.func_185188_a(new ItemStack((Item)mixpredicate.field_185200_c), potiontype); ++ return PotionUtils.func_185188_a(new ItemStack((Item)mixpredicate.field_185200_c.get()), potiontype); + } + } + +@@ -139,9 +139,9 @@ + { + PotionHelper.MixPredicate mixpredicate1 = (PotionHelper.MixPredicate)field_185213_a.get(i); + +- if (mixpredicate1.field_185198_a == potiontype && mixpredicate1.field_185199_b.apply(p_185212_0_)) ++ if (mixpredicate1.field_185198_a.get() == potiontype && mixpredicate1.field_185199_b.apply(p_185212_0_)) + { +- return PotionUtils.func_185188_a(new ItemStack(item), (PotionType)mixpredicate1.field_185200_c); ++ return PotionUtils.func_185188_a(new ItemStack(item), (PotionType)mixpredicate1.field_185200_c.get()); + } + } + } +@@ -227,17 +227,17 @@ + field_185213_a.add(new PotionHelper.MixPredicate(p_193356_0_, p_193356_1_, p_193356_2_)); + } + +- static class MixPredicate ++ static class MixPredicate> + { +- final T field_185198_a; ++ final net.minecraftforge.registries.IRegistryDelegate field_185198_a; + final Ingredient field_185199_b; +- final T field_185200_c; ++ final net.minecraftforge.registries.IRegistryDelegate field_185200_c; + + public MixPredicate(T p_i47570_1_, Ingredient p_i47570_2_, T p_i47570_3_) + { +- this.field_185198_a = p_i47570_1_; ++ this.field_185198_a = p_i47570_1_.delegate; + this.field_185199_b = p_i47570_2_; +- this.field_185200_c = p_i47570_3_; ++ this.field_185200_c = p_i47570_3_.delegate; + } + } + } diff --git a/src/main/resources/forge_at.cfg b/src/main/resources/forge_at.cfg index c5d15cf7a7..d3b2ef97c6 100644 --- a/src/main/resources/forge_at.cfg +++ b/src/main/resources/forge_at.cfg @@ -291,7 +291,6 @@ public net.minecraft.nbt.NBTPrimitive public net.minecraft.client.gui.GuiOverlayDebug func_181554_e()V # renderLagometer # Expose vanilla brewing recipe system -public net.minecraft.potion.PotionHelper$MixPredicate public net.minecraft.potion.PotionHelper func_193355_a(Lnet/minecraft/item/ItemPotion;Lnet/minecraft/item/Item;Lnet/minecraft/item/ItemPotion;)V # registerPotionItemConversion public net.minecraft.potion.PotionHelper func_193354_a(Lnet/minecraft/item/ItemPotion;)V # registerPotionItem public net.minecraft.potion.PotionHelper func_193357_a(Lnet/minecraft/potion/PotionType;Lnet/minecraft/item/Item;Lnet/minecraft/potion/PotionType;)V # registerPotionTypeConversion diff --git a/src/test/java/net/minecraftforge/debug/mod/RegistryOverrideTest.java b/src/test/java/net/minecraftforge/debug/mod/RegistryOverrideTest.java index 80151b2e0c..07727e30e3 100644 --- a/src/test/java/net/minecraftforge/debug/mod/RegistryOverrideTest.java +++ b/src/test/java/net/minecraftforge/debug/mod/RegistryOverrideTest.java @@ -26,6 +26,7 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; +import net.minecraft.potion.PotionType; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.AxisAlignedBB; @@ -66,6 +67,15 @@ public class RegistryOverrideTest ); } + @SubscribeEvent + public static void registerPotionTypes(RegistryEvent.Register event) + { + if (ENABLED) + { + event.getRegistry().register(new PotionType().setRegistryName("minecraft:awkward")); + } + } + private static class BlockReplacement extends Block { AxisAlignedBB BB = FULL_BLOCK_AABB.contract(0.1, 0, 0.1);