mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-06 23:22:10 -07:00
Fixup sendAllDataToRemote calls
Reduces unnecessary item copies by a lot
This commit is contained in:
@@ -307,6 +307,15 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -299,7 +_,7 @@
|
||||
}
|
||||
|
||||
if (!player.isUsingItem()) {
|
||||
- player.inventoryMenu.sendAllDataToRemote();
|
||||
+ player.inventoryMenu.broadcastChanges(); // Paper - change to broadcastChanges, super old code that might not even be needed at all
|
||||
}
|
||||
|
||||
return interactionResult;
|
||||
@@ -307,15 +_,47 @@
|
||||
}
|
||||
}
|
||||
@@ -348,7 +357,7 @@
|
||||
+ } else if (blockState.is(net.minecraft.world.level.block.Blocks.JIGSAW) || blockState.is(net.minecraft.world.level.block.Blocks.STRUCTURE_BLOCK) || blockState.getBlock() instanceof net.minecraft.world.level.block.CommandBlock) {
|
||||
+ player.connection.send(new net.minecraft.network.protocol.game.ClientboundContainerClosePacket(this.player.containerMenu.containerId));
|
||||
+ }
|
||||
+ player.getBukkitEntity().updateInventory(); // SPIGOT-2867
|
||||
+ player.containerMenu.forceHeldSlot(hand); // SPIGOT-2867
|
||||
+ this.player.resyncUsingItem(this.player); // Paper - Properly cancel usable items
|
||||
+ return (event.useItemInHand() != org.bukkit.event.Event.Result.ALLOW) ? InteractionResult.SUCCESS : InteractionResult.PASS;
|
||||
+ } else if (this.gameModeForPlayer == GameType.SPECTATOR) {
|
||||
|
Reference in New Issue
Block a user