Fix crash with IC2 setItemDamage (#387)

* Ducttape fix for crash with IC2 setItemDamage

* Use Items.feather
This commit is contained in:
miozune authored and GitHub committed 2023-06-01 07:20:24 +02:00
1 parent 4124151208
commit d86c472790
2 files changed
+5 -4

No files matched your search

@@ -21,6 +21,7 @@ import java.util.stream.Collectors;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.Container;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -210,7 +211,7 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
for (int i = 0; i < stack.items.length; i++) {
if (NEIServerUtils.areStacksSameTypeCrafting(ingredient, stack.items[i])) {
stack.item = stack.items[i];
stack.item.setItemDamage(ingredient.getItemDamage());
Items.feather.setDamage(stack.item, Items.feather.getDamage(ingredient));
if (ingredient.hasTagCompound()) {
stack.item.setTagCompound((NBTTagCompound) ingredient.getTagCompound().copy());
}