Skip to content

Commit

Permalink
Terrasteel armor upgrade copies all NBT
Browse files Browse the repository at this point in the history
(fixes  #4643)
  • Loading branch information
TheRealWormbo committed May 13, 2024
1 parent 806f8ab commit b654ebb
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import net.minecraft.world.item.crafting.CraftingBookCategory;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.item.crafting.ShapedRecipe;
import net.minecraft.world.item.enchantment.EnchantmentHelper;

import org.jetbrains.annotations.NotNull;

Expand All @@ -39,8 +38,8 @@ public ItemStack assemble(@NotNull CraftingContainer inv, @NotNull RegistryAcces
ItemStack out = super.assemble(inv, registries);
for (int i = 0; i < inv.getContainerSize(); i++) {
ItemStack stack = inv.getItem(i);
if (!stack.isEmpty() && stack.getItem() instanceof ArmorItem && stack.hasTag()) {
EnchantmentHelper.setEnchantments(EnchantmentHelper.getEnchantments(stack), out);
if (stack.hasTag() && stack.getItem() instanceof ArmorItem) {
out.setTag(stack.getTag());
break;
}
}
Expand Down

0 comments on commit b654ebb

Please sign in to comment.