Correctly cancel consumption of consumable

See: #11534
This commit is contained in:
Bjarne Koll
2024-10-31 12:44:02 +01:00
parent ec53bd41e7
commit d1ca62a9d0
2 changed files with 91 additions and 15 deletions

View File

@@ -13,10 +13,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.level().getCraftServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
}
entityPlayer.getBukkitEntity().updateInventory();
entityPlayer.getBukkitEntity().updateScaledHealth();
+ this.stopUsingItem(); // Paper - event is using an item, clear active item to reset its use
// Update client
Consumable consumable = this.useItem.get(DataComponents.CONSUMABLE);
if (consumable != null) {
return;
}