diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch index 18e9350..4ac84de 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java +@@ -296,7 +_,7 @@ + // Paper start - Sync offhand slot in menus + @Override + public void sendOffHandSlotChange() { +- this.sendSlotChange(ServerPlayer.this.inventoryMenu, net.minecraft.world.inventory.InventoryMenu.SHIELD_SLOT, ServerPlayer.this.inventoryMenu.getSlot(net.minecraft.world.inventory.InventoryMenu.SHIELD_SLOT).getItem().copy()); ++ this.sendSlotChange(ServerPlayer.this.inventoryMenu, net.minecraft.world.inventory.InventoryMenu.SHIELD_SLOT, ServerPlayer.this.inventoryMenu.getSlot(net.minecraft.world.inventory.InventoryMenu.SHIELD_SLOT).getItem().copyForPacket()); // Sakura - modify components sent to the client + } + // Paper end - Sync offhand slot in menus + @@ -429,6 +_,7 @@ public boolean isRealPlayer; // Paper public @Nullable com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/world/inventory/AbstractContainerMenu.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/world/inventory/AbstractContainerMenu.java.patch index 3a6caf7..0a68811 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/world/inventory/AbstractContainerMenu.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/world/inventory/AbstractContainerMenu.java.patch @@ -18,3 +18,21 @@ this.synchronizer.sendOffHandSlotChange(); // Paper - Sync offhand slot in menus; update player's offhand since the offhand slot is not added to the slots for menus but can be changed by swapping from a menu slot } } +@@ -239,7 +_,7 @@ + ItemStack carried = this.getCarried(); + this.remoteCarried.force(carried); + if (this.synchronizer != null) { +- this.synchronizer.sendCarriedChange(this, carried.copy()); ++ this.synchronizer.sendCarriedChange(this, carried.copyForPacket()); // Sakura - modify components sent to the client + } + } + // CraftBukkit end +@@ -343,7 +_,7 @@ + if (!this.remoteCarried.matches(carried)) { + this.remoteCarried.force(carried); + if (this.synchronizer != null) { +- this.synchronizer.sendCarriedChange(this, carried.copy()); ++ this.synchronizer.sendCarriedChange(this, carried.copyForPacket()); // Sakura - modify components sent to the client + } + } + } diff --git a/sakura-server/src/main/java/me/samsuik/sakura/player/item/BlockableSwordItem.java b/sakura-server/src/main/java/me/samsuik/sakura/player/item/BlockableSwordItem.java index 2fde532..7b21391 100644 --- a/sakura-server/src/main/java/me/samsuik/sakura/player/item/BlockableSwordItem.java +++ b/sakura-server/src/main/java/me/samsuik/sakura/player/item/BlockableSwordItem.java @@ -30,7 +30,7 @@ public final class BlockableSwordItem extends Item { @Override public void modifyComponentsSentToClient(PatchedDataComponentMap components) { - if (hasCustomAnimationOrDisabled(components)) { + if (!hasCustomAnimationOrDisabled(components)) { // When updating to 1.22 change CONSUMABLE to BLOCK_ATTACKS components.set(DataComponents.CONSUMABLE, BLOCKING_ANIMATION); }