Files
2019-02-24 22:29:41 +08:00

104 lines
5.1 KiB
Diff

--- ../src-base/minecraft/net/minecraft/potion/PotionHelper.java
+++ ../src-work/minecraft/net/minecraft/potion/PotionHelper.java
@@ -13,8 +13,8 @@
public class PotionHelper
{
- private static final List<PotionHelper.MixPredicate<PotionType>> POTION_TYPE_CONVERSIONS = Lists.<PotionHelper.MixPredicate<PotionType>>newArrayList();
- private static final List<PotionHelper.MixPredicate<Item>> POTION_ITEM_CONVERSIONS = Lists.<PotionHelper.MixPredicate<Item>>newArrayList();
+ private static final List<MixPredicate<PotionType>> POTION_TYPE_CONVERSIONS = Lists.<MixPredicate<PotionType>>newArrayList();
+ private static final List<MixPredicate<Item>> POTION_ITEM_CONVERSIONS = Lists.<MixPredicate<Item>>newArrayList();
private static final List<Ingredient> POTION_ITEMS = Lists.<Ingredient>newArrayList();
private static final Predicate<ItemStack> IS_POTION_ITEM = new Predicate<ItemStack>()
{
@@ -86,9 +86,9 @@
for (int j = POTION_ITEM_CONVERSIONS.size(); i < j; ++i)
{
- PotionHelper.MixPredicate<Item> mixpredicate = (PotionHelper.MixPredicate)POTION_ITEM_CONVERSIONS.get(i);
+ MixPredicate<Item> mixpredicate = (MixPredicate)POTION_ITEM_CONVERSIONS.get(i);
- if (mixpredicate.input == item && mixpredicate.reagent.apply(reagent))
+ if (mixpredicate.input.get() == item && mixpredicate.reagent.apply(reagent))
{
return true;
}
@@ -104,9 +104,9 @@
for (int j = POTION_TYPE_CONVERSIONS.size(); i < j; ++i)
{
- PotionHelper.MixPredicate<PotionType> mixpredicate = (PotionHelper.MixPredicate)POTION_TYPE_CONVERSIONS.get(i);
+ MixPredicate<PotionType> mixpredicate = (MixPredicate)POTION_TYPE_CONVERSIONS.get(i);
- if (mixpredicate.input == potiontype && mixpredicate.reagent.apply(reagent))
+ if (mixpredicate.input.get() == potiontype && mixpredicate.reagent.apply(reagent))
{
return true;
}
@@ -125,11 +125,11 @@
for (int j = POTION_ITEM_CONVERSIONS.size(); i < j; ++i)
{
- PotionHelper.MixPredicate<Item> mixpredicate = (PotionHelper.MixPredicate)POTION_ITEM_CONVERSIONS.get(i);
+ MixPredicate<Item> mixpredicate = (MixPredicate)POTION_ITEM_CONVERSIONS.get(i);
- if (mixpredicate.input == item && mixpredicate.reagent.apply(reagent))
+ if (mixpredicate.input.get() == item && mixpredicate.reagent.apply(reagent))
{
- return PotionUtils.addPotionToItemStack(new ItemStack((Item)mixpredicate.output), potiontype);
+ return PotionUtils.addPotionToItemStack(new ItemStack((Item)mixpredicate.output.get()), potiontype);
}
}
@@ -137,11 +137,11 @@
for (int k = POTION_TYPE_CONVERSIONS.size(); i < k; ++i)
{
- PotionHelper.MixPredicate<PotionType> mixpredicate1 = (PotionHelper.MixPredicate)POTION_TYPE_CONVERSIONS.get(i);
+ MixPredicate<PotionType> mixpredicate1 = (MixPredicate)POTION_TYPE_CONVERSIONS.get(i);
- if (mixpredicate1.input == potiontype && mixpredicate1.reagent.apply(reagent))
+ if (mixpredicate1.input.get() == potiontype && mixpredicate1.reagent.apply(reagent))
{
- return PotionUtils.addPotionToItemStack(new ItemStack(item), (PotionType)mixpredicate1.output);
+ return PotionUtils.addPotionToItemStack(new ItemStack(item), (PotionType)mixpredicate1.output.get());
}
}
}
@@ -209,7 +209,7 @@
public static void addContainerRecipe(ItemPotion p_193355_0_, Item p_193355_1_, ItemPotion p_193355_2_)
{
- POTION_ITEM_CONVERSIONS.add(new PotionHelper.MixPredicate(p_193355_0_, Ingredient.fromItems(p_193355_1_), p_193355_2_));
+ POTION_ITEM_CONVERSIONS.add(new MixPredicate(p_193355_0_, Ingredient.fromItems(p_193355_1_), p_193355_2_));
}
public static void addContainer(ItemPotion p_193354_0_)
@@ -224,20 +224,20 @@
public static void addMix(PotionType p_193356_0_, Ingredient p_193356_1_, PotionType p_193356_2_)
{
- POTION_TYPE_CONVERSIONS.add(new PotionHelper.MixPredicate(p_193356_0_, p_193356_1_, p_193356_2_));
+ POTION_TYPE_CONVERSIONS.add(new MixPredicate(p_193356_0_, p_193356_1_, p_193356_2_));
}
- static class MixPredicate<T>
+ public static class MixPredicate<T extends net.minecraftforge.registries.IForgeRegistryEntry.Impl<T>>
{
- final T input;
+ final net.minecraftforge.registries.IRegistryDelegate<T> input;
final Ingredient reagent;
- final T output;
+ final net.minecraftforge.registries.IRegistryDelegate<T> output;
public MixPredicate(T p_i47570_1_, Ingredient p_i47570_2_, T p_i47570_3_)
{
- this.input = p_i47570_1_;
+ this.input = p_i47570_1_.delegate;
this.reagent = p_i47570_2_;
- this.output = p_i47570_3_;
+ this.output = p_i47570_3_.delegate;
}
}
}