2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Lukasz Derlatka <toranktto@gmail.com>
|
|
|
|
Date: Mon, 11 Nov 2019 16:08:13 +0100
|
|
|
|
Subject: [PATCH] Fix AssertionError when player hand set to empty type
|
|
|
|
|
|
|
|
Fixes an AssertionError when setting the player's item in hand to null or a new ItemStack of Air in PlayerInteractEvent
|
|
|
|
Fixes GH-2718
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
2022-06-07 19:03:07 +02:00
|
|
|
index b37a611c4492a46a72bc7d1d6216efdfed4ff2de..d5ee915958710a65ecaf8f17d3d07e47060b3eae 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
2022-03-16 16:57:51 +01:00
|
|
|
@@ -1757,6 +1757,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
|
2021-06-11 14:02:28 +02:00
|
|
|
this.player.getBukkitEntity().updateInventory(); // SPIGOT-2524
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
+ // Paper start
|
|
|
|
+ itemstack = this.player.getItemInHand(enumhand);
|
|
|
|
+ if (itemstack.isEmpty()) return;
|
|
|
|
+ // Paper end
|
|
|
|
InteractionResult enuminteractionresult = this.player.gameMode.useItem(this.player, worldserver, itemstack, enumhand);
|
|
|
|
|
|
|
|
if (enuminteractionresult.shouldSwing()) {
|