mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 11:59:25 +00:00
Re-enable Vanilla's Shapeless recipe matching.
This commit is contained in:
1 parent
ccc44956fd
commit
239b9d36a4
4 files changed
+25
-4
No files matched your search
@@ -0,0 +1,19 @@
|
||||
--- ../src-base/minecraft/net/minecraft/client/util/RecipeItemHelper.java
|
||||
+++ ../src-work/minecraft/net/minecraft/client/util/RecipeItemHelper.java
|
||||
@@ -24,10 +24,15 @@
|
||||
|
||||
public void func_194112_a(ItemStack p_194112_1_)
|
||||
{
|
||||
+ this.accountStack(p_194112_1_, -1);
|
||||
+ }
|
||||
+
|
||||
+ public void accountStack(ItemStack p_194112_1_, int forceCount)
|
||||
+ {
|
||||
if (!p_194112_1_.func_190926_b() && !p_194112_1_.func_77951_h() && !p_194112_1_.func_77948_v() && !p_194112_1_.func_82837_s())
|
||||
{
|
||||
int i = func_194113_b(p_194112_1_);
|
||||
- int j = p_194112_1_.func_190916_E();
|
||||
+ int j = forceCount == -1 ? p_194112_1_.func_190916_E() : forceCount;
|
||||
this.func_194117_b(i, j);
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
+ boolean simple = true;
|
||||
+ for (Ingredient i : p_i47500_3_)
|
||||
+ simple &= i.isSimple();
|
||||
+ this.isSimple = false; //simple; Always use Forge logic until Grum finds a fix for https://github.com/MinecraftForge/MinecraftForge/issues/4557
|
||||
+ this.isSimple = simple;
|
||||
}
|
||||
|
||||
- @SideOnly(Side.CLIENT)
|
||||
@@ -75,7 +75,7 @@
|
||||
- }
|
||||
+ ++ingredientCount;
|
||||
+ if (this.isSimple)
|
||||
+ recipeItemHelper.func_194112_a(itemstack);
|
||||
+ recipeItemHelper.accountStack(itemstack, 1);
|
||||
+ else
|
||||
+ inputs.add(itemstack);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ShapelessOreRecipe extends IForgeRegistryEntry.Impl<IRecipe> implem
|
||||
protected ItemStack output = ItemStack.EMPTY;
|
||||
protected NonNullList<Ingredient> input = NonNullList.create();
|
||||
protected ResourceLocation group;
|
||||
protected boolean isSimple = false; //true; Always use Forge logic until Grum finds a fix for https://github.com/MinecraftForge/MinecraftForge/issues/4557
|
||||
protected boolean isSimple = true;
|
||||
|
||||
public ShapelessOreRecipe(ResourceLocation group, Block result, Object... recipe){ this(group, new ItemStack(result), recipe); }
|
||||
public ShapelessOreRecipe(ResourceLocation group, Item result, Object... recipe){ this(group, new ItemStack(result), recipe); }
|
||||
@@ -108,7 +108,7 @@ public class ShapelessOreRecipe extends IForgeRegistryEntry.Impl<IRecipe> implem
|
||||
{
|
||||
++ingredientCount;
|
||||
if (this.isSimple)
|
||||
recipeItemHelper.accountStack(itemstack);
|
||||
recipeItemHelper.accountStack(itemstack, 1);
|
||||
else
|
||||
items.add(itemstack);
|
||||
}
|
||||
|
||||
@@ -65,3 +65,5 @@ net/minecraft/village/Village.modifyPlayerReputation(Ljava/util/UUID;I)I=|p_8268
|
||||
net/minecraft/command/EntitySelector.matchEntitiesDefault(Lnet/minecraft/command/ICommandSender;Ljava/lang/String;Ljava/lang/Class;)Ljava/util/List;=|p_179656_0_,p_179656_1_,p_179656_2_
|
||||
net/minecraft/command/EntitySelector.matchesMultiplePlayersDefault(Ljava/lang/String;)Z=|p_82377_0_
|
||||
net/minecraft/command/EntitySelector.isSelectorDefault(Ljava/lang/String;)Z=|p_82378_0_
|
||||
|
||||
net/minecraft/client/util/RecipeItemHelper.accountStack(Lnet/minecraft/item/ItemStack;I)V=|p_194112_1_,forceCount
|
||||
Reference in new issue
Block a user