diff options
author | Josh Roy <[email protected]> | 2021-11-20 14:09:19 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2021-11-20 14:09:19 -0500 |
commit | 284b3b8dd2822b314d7788b878a7978d9eee9bae (patch) | |
tree | 846d0881453e9c9e914c7b60ca588732b1fda71d | |
parent | e22a1a9d053a8f3cf56f62ef1749434a398e4a57 (diff) | |
download | Paper-284b3b8dd2822b314d7788b878a7978d9eee9bae.tar.gz Paper-284b3b8dd2822b314d7788b878a7978d9eee9bae.zip |
Fix AnvilPrepareEvent not working with zero xp (#6895)
Co-authored-by: Jan Tuck <[email protected]>
-rw-r--r-- | patches/server/0845-Fix-anvil-prepare-event-not-working-with-zero-xp.patch | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/patches/server/0845-Fix-anvil-prepare-event-not-working-with-zero-xp.patch b/patches/server/0845-Fix-anvil-prepare-event-not-working-with-zero-xp.patch new file mode 100644 index 0000000000..1ee105facf --- /dev/null +++ b/patches/server/0845-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 <[email protected]> +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 593e23c10f2b1616db7256158dfe564b2d289df1..b62c6b56867b645520cb3c3e382ec96d421e7e97 100644 +--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java ++++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java +@@ -60,7 +60,7 @@ 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 |