Skip to content

Commit

Permalink
Use ItemEnchantedBook#getEnchantedItemStack
Browse files Browse the repository at this point in the history
  • Loading branch information
naqaden authored Nov 29, 2018
1 parent 910034f commit c4e7d14
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.google.common.base.MoreObjects;
import mezz.jei.api.ingredients.IIngredientHelper;
import net.minecraft.enchantment.EnchantmentData;
import net.minecraft.init.Items;
import net.minecraft.item.ItemEnchantedBook;
import net.minecraft.item.ItemStack;

Expand Down Expand Up @@ -62,9 +61,7 @@ public String getResourceId(EnchantmentData ingredient) {

@Override
public ItemStack getCheatItemStack(EnchantmentData ingredient) {
ItemStack enchantedBook = new ItemStack(Items.ENCHANTED_BOOK);
ItemEnchantedBook.addEnchantment(enchantedBook, ingredient);
return enchantedBook;
return ItemEnchantedBook.getEnchantedItemStack(ingredient);
}

@Override
Expand All @@ -84,4 +81,4 @@ public String getErrorInfo(@Nullable EnchantmentData ingredient) {

return toStringHelper.toString();
}
}
}

0 comments on commit c4e7d14

Please sign in to comment.