aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0798-Fix-anvil-prepare-event-not-working-with-zero-xp.patch
blob: efa5aa2399a2fdb330608df6a4e1020dac10391c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jan Tuck <jan@tuck.dk>
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 aa8c101b29f7d9269f3766476ff7d552c2ab0c36..af199f8bb4e25b25653aa780fd02573b5a974904 100644
--- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java
@@ -58,7 +58,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