From b119833e39d49a7fcfc777f63c9065617e6a77b6 Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Sat, 20 Nov 2021 14:09:19 -0500 Subject: [PATCH] Fix AnvilPrepareEvent not working with zero xp (#6895) Co-authored-by: Jan Tuck --- ...epare-event-not-working-with-zero-xp.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 patches/server/Fix-anvil-prepare-event-not-working-with-zero-xp.patch diff --git a/patches/server/Fix-anvil-prepare-event-not-working-with-zero-xp.patch b/patches/server/Fix-anvil-prepare-event-not-working-with-zero-xp.patch new file mode 100644 index 0000000000..5fa8b4fd67 --- /dev/null +++ b/patches/server/Fix-anvil-prepare-event-not-working-with-zero-xp.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jan Tuck +Date: Mon, 15 Nov 2021 15:20:41 -0500 +Subject: [PATCH] Fix anvil prepare event not working with zero xp + + +diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java ++++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java +@@ -0,0 +0,0 @@ public class AnvilMenu extends ItemCombinerMenu { + + @Override + protected boolean mayPickup(Player player, boolean present) { +- return (player.getAbilities().instabuild || player.experienceLevel >= this.cost.get()) && this.cost.get() > 0; ++ return (player.getAbilities().instabuild || player.experienceLevel >= this.cost.get()) && this.cost.get() >= 0; // Paper - fix anvil prepare event not working with 0 xp + } + + @Override