Remove dead code, param renames in added methods

This commit is contained in:
Nassim Jahnke
2024-12-17 21:59:59 +01:00
parent 2612fb57dc
commit 972266605e
4 changed files with 11 additions and 60 deletions

View File

@ -974,13 +974,12 @@
leashable.removeLeash();
} else {
leashable.dropLeash();
@@ -2043,6 +_,14 @@
@@ -2043,6 +_,13 @@
ItemStack itemInHand = player.getItemInHand(hand);
if (itemInHand.is(Items.LEAD) && leashable.canHaveALeashAttachedToIt()) {
if (!this.level().isClientSide()) {
+ // CraftBukkit start - fire PlayerLeashEntityEvent
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerLeashEntityEvent(this, player, player, hand).isCancelled()) {
+ // ((ServerPlayer) player).resendItemInHands(); // SPIGOT-7615: Resend to fix client desync with used item // Paper - Fix inventory desync
+ ((ServerPlayer) player).connection.send(new net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket(this, leashable.getLeashHolder()));
+ player.containerMenu.sendAllDataToRemote(); // Paper - Fix inventory desync
+ return InteractionResult.PASS;