diff --git a/src/machines/java/com/enderio/machines/common/menu/EnchanterMenu.java b/src/machines/java/com/enderio/machines/common/menu/EnchanterMenu.java index a4cce9d3c2..f69c1dbee2 100644 --- a/src/machines/java/com/enderio/machines/common/menu/EnchanterMenu.java +++ b/src/machines/java/com/enderio/machines/common/menu/EnchanterMenu.java @@ -35,15 +35,15 @@ public EnchanterMenu(@Nullable EnchanterBlockEntity blockEntity, Inventory inven @Override public void onTake(Player pPlayer, ItemStack pStack) { Optional recipe = level.getRecipeManager().getRecipeFor(MachineRecipes.ENCHANTING.type().get(), blockEntity.getContainer(), level); - if (recipe.isPresent() && (pPlayer.experienceLevel > recipe.get().getXPCost(blockEntity.getContainer()) || pPlayer.isCreative())) { + if (recipe.isPresent() && (pPlayer.experienceLevel >= recipe.get().getXPCost(blockEntity.getContainer()) || pPlayer.isCreative())) { int amount = recipe.get().getInputAmountConsumed(blockEntity.getContainer()); int lapizForLevel = recipe.get().getLapisForLevel(recipe.get().getEnchantmentLevel(EnchanterBlockEntity.CATALYST.getItemStack(blockEntity).getCount())); pPlayer.giveExperienceLevels(-recipe.get().getXPCost(blockEntity.getContainer())); EnchanterBlockEntity.BOOK.getItemStack(blockEntity).shrink(1); EnchanterBlockEntity.CATALYST.getItemStack(blockEntity).shrink(amount); EnchanterBlockEntity.LAPIS.getItemStack(blockEntity).shrink(lapizForLevel); + super.onTake(pPlayer, pStack); } - super.onTake(pPlayer, pStack); } @Override