Skip to content

Commit

Permalink
Merge pull request #368 from ferriarnus/enchanter-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rover656 committed Jul 27, 2023
2 parents bfab47f + 964374e commit 6d7e29e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void onTake(Player pPlayer, ItemStack pStack) {
@Override
public boolean mayPickup(Player playerIn) {
Optional<EnchanterRecipe> recipe = level.getRecipeManager().getRecipeFor(MachineRecipes.ENCHANTING.type().get(), blockEntity.getContainer(), level);
if (recipe.isPresent() && (playerIn.experienceLevel > recipe.get().getXPCost(blockEntity.getContainer()) || playerIn.isCreative()) && blockEntity.canAct()) {
if (recipe.isPresent() && (playerIn.experienceLevel >= recipe.get().getXPCost(blockEntity.getContainer()) || playerIn.isCreative()) && blockEntity.canAct()) {
return super.mayPickup(playerIn);
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public ItemStack quickMoveStack(Player pPlayer, int pIndex) {
} else {
slot.setChanged();
}

slot.onTake(pPlayer, itemstack1);
}

return itemstack;
Expand Down

0 comments on commit 6d7e29e

Please sign in to comment.