diff --git a/patches/server/Properly-resend-entities.patch b/patches/server/Properly-resend-entities.patch index 635496ad4d..73e35286bf 100644 --- a/patches/server/Properly-resend-entities.patch +++ b/patches/server/Properly-resend-entities.patch @@ -114,25 +114,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.sendLevelInfo(player, worldserver1); -@@ -0,0 +0,0 @@ public abstract class PlayerList { - } - - public void sendActiveEffects(LivingEntity entity, ServerGamePacketListenerImpl networkHandler) { -+ // Paper start - collect packets -+ this.sendActiveEffects(entity, networkHandler::send); -+ } -+ public void sendActiveEffects(LivingEntity entity, java.util.function.Consumer> packetConsumer) { -+ // Paper end - collect packets - Iterator iterator = entity.getActiveEffects().iterator(); - - while (iterator.hasNext()) { - MobEffectInstance mobeffect = (MobEffectInstance) iterator.next(); - -- networkHandler.send(new ClientboundUpdateMobEffectPacket(entity.getId(), mobeffect, false)); -+ packetConsumer.accept(new ClientboundUpdateMobEffectPacket(entity.getId(), mobeffect, false)); // Paper - collect packets - } - - } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java @@ -201,6 +182,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private void updatingUsingItem() { if (this.isUsingItem()) { if (ItemStack.isSameItem(this.getItemInHand(this.getUsedItemHand()), this.useItem)) { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { + 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) { ++ if (false && consumable != null) { // Paper + consumable.cancelUsingItem(entityPlayer, this.useItem); + } + entityPlayer.getBukkitEntity().updateInventory(); diff --git a/src/main/java/net/minecraft/world/entity/animal/Bucketable.java b/src/main/java/net/minecraft/world/entity/animal/Bucketable.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bucketable.java @@ -215,26 +205,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return Optional.of(InteractionResult.FAIL); } entity.playSound(((Bucketable) entity).getPickupSound(), 1.0F, 1.0F); -diff --git a/src/main/java/net/minecraft/world/item/component/SuspiciousStewEffects.java b/src/main/java/net/minecraft/world/item/component/SuspiciousStewEffects.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/item/component/SuspiciousStewEffects.java -+++ b/src/main/java/net/minecraft/world/item/component/SuspiciousStewEffects.java -@@ -0,0 +0,0 @@ public record SuspiciousStewEffects(List effects) i - // CraftBukkit start - @Override - public void cancelUsingItem(net.minecraft.server.level.ServerPlayer entityplayer, ItemStack itemstack) { -+ final List> packets = new java.util.ArrayList<>(); // Paper - bundlize packets - for (SuspiciousStewEffects.Entry suspicioussteweffects_a : this.effects) { -- entityplayer.connection.send(new net.minecraft.network.protocol.game.ClientboundRemoveMobEffectPacket(entityplayer.getId(), suspicioussteweffects_a.effect())); -+ packets.add(new net.minecraft.network.protocol.game.ClientboundRemoveMobEffectPacket(entityplayer.getId(), suspicioussteweffects_a.effect())); // Paper - bundlize packets - } -+ // Paper start - bundlize packets -+ entityplayer.server.getPlayerList().sendActiveEffects(entityplayer, packets::add); -+ entityplayer.connection.send(new net.minecraft.network.protocol.game.ClientboundBundlePacket(packets)); -+ // Paper end - bundlize packets - } - // CraftBukkit end - diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java