mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-21 00:17:56 +01:00
Add back more patches
This commit is contained in:
parent
60f3bd8d0c
commit
752f957e12
@ -5024,10 +5024,10 @@ index 0000000000000000000000000000000000000000..755b08dd32e568d341ceef8a8aef8418
|
|||||||
+}
|
+}
|
||||||
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..f85820b959213c9bb566897c173f644fd430d01a
|
index 0000000000000000000000000000000000000000..19672631d7c69ade16a6f966c72a4a9d57b77c55
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||||
@@ -0,0 +1,810 @@
|
@@ -0,0 +1,811 @@
|
||||||
+package ca.spottedleaf.moonrise.patches.chunk_system.level.entity;
|
+package ca.spottedleaf.moonrise.patches.chunk_system.level.entity;
|
||||||
+
|
+
|
||||||
+import ca.spottedleaf.moonrise.common.list.EntityList;
|
+import ca.spottedleaf.moonrise.common.list.EntityList;
|
||||||
@ -5056,6 +5056,7 @@ index 0000000000000000000000000000000000000000..f85820b959213c9bb566897c173f644f
|
|||||||
+import java.util.Iterator;
|
+import java.util.Iterator;
|
||||||
+import java.util.List;
|
+import java.util.List;
|
||||||
+import java.util.function.Predicate;
|
+import java.util.function.Predicate;
|
||||||
|
+import org.bukkit.event.entity.EntityRemoveEvent;
|
||||||
+
|
+
|
||||||
+public final class ChunkEntitySlices {
|
+public final class ChunkEntitySlices {
|
||||||
+
|
+
|
||||||
@ -5176,12 +5177,12 @@ index 0000000000000000000000000000000000000000..f85820b959213c9bb566897c173f644f
|
|||||||
+ continue;
|
+ continue;
|
||||||
+ }
|
+ }
|
||||||
+ if (entity.shouldBeSaved()) {
|
+ if (entity.shouldBeSaved()) {
|
||||||
+ entity.setRemoved(Entity.RemovalReason.UNLOADED_TO_CHUNK);
|
+ entity.setRemoved(Entity.RemovalReason.UNLOADED_TO_CHUNK, EntityRemoveEvent.Cause.UNLOAD);
|
||||||
+ if (entity.isVehicle()) {
|
+ if (entity.isVehicle()) {
|
||||||
+ // we cannot assume that these entities are contained within this chunk, because entities can
|
+ // we cannot assume that these entities are contained within this chunk, because entities can
|
||||||
+ // desync - so we need to remove them all
|
+ // desync - so we need to remove them all
|
||||||
+ for (final Entity passenger : entity.getIndirectPassengers()) {
|
+ for (final Entity passenger : entity.getIndirectPassengers()) {
|
||||||
+ passenger.setRemoved(Entity.RemovalReason.UNLOADED_TO_CHUNK);
|
+ passenger.setRemoved(Entity.RemovalReason.UNLOADED_TO_CHUNK, EntityRemoveEvent.Cause.UNLOAD);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
@ -8,8 +8,31 @@ to a chunk. The default values of -1 disable the limit. Although
|
|||||||
defaults are only included for certain entites, this allows setting
|
defaults are only included for certain entites, this allows setting
|
||||||
limits for any entity type.
|
limits for any entity type.
|
||||||
|
|
||||||
|
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||||
|
index 19672631d7c69ade16a6f966c72a4a9d57b77c55..df4aadd40c0033c852af575fd11dce8eb3f2959e 100644
|
||||||
|
--- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||||
|
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
|
||||||
|
@@ -100,7 +100,18 @@ public final class ChunkEntitySlices {
|
||||||
|
}
|
||||||
|
|
||||||
|
final ListTag entitiesTag = new ListTag();
|
||||||
|
+ final java.util.Map<net.minecraft.world.entity.EntityType<?>, Integer> savedEntityCounts = new java.util.HashMap<>(); // Paper - Entity load/save limit per chunk
|
||||||
|
for (final Entity entity : entities) {
|
||||||
|
+ // Paper start - Entity load/save limit per chunk
|
||||||
|
+ final EntityType<?> entityType = entity.getType();
|
||||||
|
+ final int saveLimit = world.paperConfig().chunks.entityPerChunkSaveLimit.getOrDefault(entityType, -1);
|
||||||
|
+ if (saveLimit > -1) {
|
||||||
|
+ if (savedEntityCounts.getOrDefault(entityType, 0) >= saveLimit) {
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ savedEntityCounts.merge(entityType, 1, Integer::sum);
|
||||||
|
+ }
|
||||||
|
+ // Paper end - Entity load/save limit per chunk
|
||||||
|
CompoundTag compoundTag = new CompoundTag();
|
||||||
|
if (entity.save(compoundTag)) {
|
||||||
|
entitiesTag.add(compoundTag);
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||||
index 56b51096ca4147363a843accf6ef2510f05e8f1a..a46bf73c608641bf1f00fd55242de71a0f2ee06e 100644
|
index 842b0cec0397d7ae5166617627340ffac0e35db1..cb61462d4691a055a4b25f7b953609d8a154fdfe 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||||
@@ -649,9 +649,20 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
@@ -649,9 +649,20 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||||
@ -34,18 +57,18 @@ index 56b51096ca4147363a843accf6ef2510f05e8f1a..a46bf73c608641bf1f00fd55242de71a
|
|||||||
return entity;
|
return entity;
|
||||||
});
|
});
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java
|
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java
|
||||||
index 9fdf8f857a5f9b231c6d0633eaba498244214f74..bee39dee1b96023c907407877aedf3aafaf5e1b8 100644
|
index 503ac0374e0c9f9993ad37bb8bd8cf1570d3615a..d4a505ef4af9ded02aeb1a817bcbe5b1a912a5b3 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java
|
--- a/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java
|
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/EntityStorage.java
|
||||||
@@ -105,7 +105,18 @@ public class EntityStorage implements EntityPersistentStorage<Entity> {
|
@@ -92,7 +92,18 @@ public class EntityStorage implements EntityPersistentStorage<Entity> {
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
ListTag listTag = new ListTag();
|
ListTag listTag = new ListTag();
|
||||||
+ final java.util.Map<net.minecraft.world.entity.EntityType<?>, Integer> savedEntityCounts = new java.util.HashMap<>(); // Paper - Entity load/save limit per chunk
|
+ final java.util.Map<net.minecraft.world.entity.EntityType<?>, Integer> savedEntityCounts = new java.util.HashMap<>(); // Paper - Entity load/save limit per chunk
|
||||||
entities.forEach((entity) -> { // diff here: use entities parameter
|
dataList.getEntities().forEach(entity -> {
|
||||||
+ // Paper start - Entity load/save limit per chunk
|
+ // Paper start - Entity load/save limit per chunk
|
||||||
+ final EntityType<?> entityType = entity.getType();
|
+ final EntityType<?> entityType = entity.getType();
|
||||||
+ final int saveLimit = level.paperConfig().chunks.entityPerChunkSaveLimit.getOrDefault(entityType, -1);
|
+ final int saveLimit = this.level.paperConfig().chunks.entityPerChunkSaveLimit.getOrDefault(entityType, -1);
|
||||||
+ if (saveLimit > -1) {
|
+ if (saveLimit > -1) {
|
||||||
+ if (savedEntityCounts.getOrDefault(entityType, 0) >= saveLimit) {
|
+ if (savedEntityCounts.getOrDefault(entityType, 0) >= saveLimit) {
|
||||||
+ return;
|
+ return;
|
||||||
@ -53,6 +76,6 @@ index 9fdf8f857a5f9b231c6d0633eaba498244214f74..bee39dee1b96023c907407877aedf3aa
|
|||||||
+ savedEntityCounts.merge(entityType, 1, Integer::sum);
|
+ savedEntityCounts.merge(entityType, 1, Integer::sum);
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end - Entity load/save limit per chunk
|
+ // Paper end - Entity load/save limit per chunk
|
||||||
CompoundTag compoundTag = new CompoundTag();
|
CompoundTag compoundTagx = new CompoundTag();
|
||||||
if (entity.save(compoundTag)) {
|
if (entity.save(compoundTagx)) {
|
||||||
listTag.add(compoundTag);
|
listTag.add(compoundTagx);
|
@ -57,10 +57,10 @@ index 02bf2705ca1c99023a83a22d92e1962181102297..0f99733660f91280e4c6262cf75b3c9c
|
|||||||
|
|
||||||
final EntityDataAccessor<T> accessor;
|
final EntityDataAccessor<T> accessor;
|
||||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||||
index 56de0da254c8f027fa23afc261be3b5e5ffdde93..c7efde4e2b87b14e768429748b01c1bce659682b 100644
|
index e9dcdb1e09e84a9b451034ff4bdfa6eae2dd1c04..24b1715397ba8e6f5e9841a030d0e3d964356f89 100644
|
||||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||||
@@ -556,6 +556,7 @@ public class ServerPlayerGameMode {
|
@@ -561,6 +561,7 @@ public class ServerPlayerGameMode {
|
||||||
}
|
}
|
||||||
// Paper end - extend Player Interact cancellation
|
// Paper end - extend Player Interact cancellation
|
||||||
player.getBukkitEntity().updateInventory(); // SPIGOT-2867
|
player.getBukkitEntity().updateInventory(); // SPIGOT-2867
|
||||||
@ -68,7 +68,7 @@ index 56de0da254c8f027fa23afc261be3b5e5ffdde93..c7efde4e2b87b14e768429748b01c1bc
|
|||||||
return (event.useItemInHand() != Event.Result.ALLOW) ? InteractionResult.SUCCESS : InteractionResult.PASS;
|
return (event.useItemInHand() != Event.Result.ALLOW) ? InteractionResult.SUCCESS : InteractionResult.PASS;
|
||||||
} else if (this.gameModeForPlayer == GameType.SPECTATOR) {
|
} else if (this.gameModeForPlayer == GameType.SPECTATOR) {
|
||||||
MenuProvider itileinventory = iblockdata.getMenuProvider(world, blockposition);
|
MenuProvider itileinventory = iblockdata.getMenuProvider(world, blockposition);
|
||||||
@@ -607,6 +608,11 @@ public class ServerPlayerGameMode {
|
@@ -612,6 +613,11 @@ public class ServerPlayerGameMode {
|
||||||
|
|
||||||
return enuminteractionresult;
|
return enuminteractionresult;
|
||||||
} else {
|
} else {
|
||||||
@ -81,10 +81,10 @@ index 56de0da254c8f027fa23afc261be3b5e5ffdde93..c7efde4e2b87b14e768429748b01c1bc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
index 56d32a919cff2a9d4a5775665ed4d1d14b9c708b..3faf80fca51d66480265eaf3cc89149e53ceb215 100644
|
index be2e97e4de911ad9570a9b4e9f3c5fafa93f6203..199e2f447ddb319387a15c934da71c27aab6da1e 100644
|
||||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||||
@@ -2004,6 +2004,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -1949,6 +1949,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cancelled) {
|
if (cancelled) {
|
||||||
@ -92,17 +92,17 @@ index 56d32a919cff2a9d4a5775665ed4d1d14b9c708b..3faf80fca51d66480265eaf3cc89149e
|
|||||||
this.player.getBukkitEntity().updateInventory(); // SPIGOT-2524
|
this.player.getBukkitEntity().updateInventory(); // SPIGOT-2524
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2786,7 +2787,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
@@ -2718,7 +2719,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||||
|
|
||||||
// Entity in bucket - SPIGOT-4048 and SPIGOT-6859a
|
// Entity in bucket - SPIGOT-4048 and SPIGOT-6859a
|
||||||
if ((entity instanceof Bucketable && entity instanceof LivingEntity && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) {
|
if ((entity instanceof Bucketable && entity instanceof LivingEntity && origItem != null && origItem.asItem() == Items.WATER_BUCKET) && (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem)) {
|
||||||
- ServerGamePacketListenerImpl.this.send(new ClientboundAddEntityPacket(entity));
|
- entity.getBukkitEntity().update(ServerGamePacketListenerImpl.this.player);
|
||||||
+ entity.resendPossiblyDesyncedEntityData(ServerGamePacketListenerImpl.this.player); // Paper - The entire mob gets deleted, so resend it.
|
+ entity.resendPossiblyDesyncedEntityData(ServerGamePacketListenerImpl.this.player); // Paper - The entire mob gets deleted, so resend it
|
||||||
ServerGamePacketListenerImpl.this.player.containerMenu.sendAllDataToRemote();
|
ServerGamePacketListenerImpl.this.player.containerMenu.sendAllDataToRemote();
|
||||||
}
|
}
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
index 68446b7532dfbda303293aa9e756644c6fcdffca..a2142930b4d4b05987c90496fb9d733d99040aa0 100644
|
index 0d0b07c9199be9ca0d5ac3feb1d44f149ba69283..3d30427e75bdfb9cf453fb5cd2a344227da1641a 100644
|
||||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||||
@@ -393,7 +393,7 @@ public abstract class PlayerList {
|
@@ -393,7 +393,7 @@ public abstract class PlayerList {
|
||||||
@ -115,10 +115,10 @@ index 68446b7532dfbda303293aa9e756644c6fcdffca..a2142930b4d4b05987c90496fb9d733d
|
|||||||
this.sendLevelInfo(player, worldserver1);
|
this.sendLevelInfo(player, worldserver1);
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
index 9153c15cd2b8a3811d5f1c16ac2221aea7c3aacd..7ef9f67d27cc240191dd5d07e8dcf5fbdebe1049 100644
|
index 14db8510af7465eb663501008ca35f8ec63bfe30..898651b7cfff15fe1afb690c247cdc3936d12fa6 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||||
@@ -703,13 +703,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
@@ -664,13 +664,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
public void refreshEntityData(ServerPlayer to) {
|
public void refreshEntityData(ServerPlayer to) {
|
||||||
@ -166,10 +166,10 @@ index 9153c15cd2b8a3811d5f1c16ac2221aea7c3aacd..7ef9f67d27cc240191dd5d07e8dcf5fb
|
|||||||
public boolean equals(Object object) {
|
public boolean equals(Object object) {
|
||||||
return object instanceof Entity ? ((Entity) object).id == this.id : false;
|
return object instanceof Entity ? ((Entity) object).id == this.id : false;
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
index 9601d3def5e4ac0650bae42a1da2a64ab1e5aef7..81a8296e25275639718e0839888ac6a900b54bf3 100644
|
index 25a7dfddb44a11f6e20c459141a61270c0c12d4c..e980c8c356b30d25e2fc5a73b91ad2c6edd4fe05 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||||
@@ -3818,6 +3818,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
@@ -3840,6 +3840,11 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||||
return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 2) > 0 ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND;
|
return ((Byte) this.entityData.get(LivingEntity.DATA_LIVING_ENTITY_FLAGS) & 2) > 0 ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,38 +182,38 @@ index 9601d3def5e4ac0650bae42a1da2a64ab1e5aef7..81a8296e25275639718e0839888ac6a9
|
|||||||
if (this.isUsingItem()) {
|
if (this.isUsingItem()) {
|
||||||
if (ItemStack.isSameItem(this.getItemInHand(this.getUsedItemHand()), this.useItem)) {
|
if (ItemStack.isSameItem(this.getItemInHand(this.getUsedItemHand()), this.useItem)) {
|
||||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bucketable.java b/src/main/java/net/minecraft/world/entity/animal/Bucketable.java
|
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 cb4a6439e9774bbec07e69b13df8dddd395b9ece..cfe37b4f5e33795ee717d824d86e3a0919129cf5 100644
|
index b586116d8cca1585f9c9e618ed4d0cb2ef2747be..acf38ef6d8de8b15cf2b09eb7bda390c4e446e9a 100644
|
||||||
--- a/src/main/java/net/minecraft/world/entity/animal/Bucketable.java
|
--- a/src/main/java/net/minecraft/world/entity/animal/Bucketable.java
|
||||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Bucketable.java
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Bucketable.java
|
||||||
@@ -109,8 +109,7 @@ public interface Bucketable {
|
@@ -108,8 +108,7 @@ public interface Bucketable {
|
||||||
itemstack1 = CraftItemStack.asNMSCopy(playerBucketFishEvent.getEntityBucket());
|
itemstack1 = CraftItemStack.asNMSCopy(playerBucketFishEvent.getEntityBucket());
|
||||||
if (playerBucketFishEvent.isCancelled()) {
|
if (playerBucketFishEvent.isCancelled()) {
|
||||||
((ServerPlayer) player).containerMenu.sendAllDataToRemote(); // We need to update inventory to resync client's bucket
|
((ServerPlayer) player).containerMenu.sendAllDataToRemote(); // We need to update inventory to resync client's bucket
|
||||||
- ((ServerPlayer) player).connection.send(new ClientboundAddEntityPacket(entity)); // We need to play out these packets as the client assumes the fish is gone
|
- entity.getBukkitEntity().update((ServerPlayer) player); // We need to play out these packets as the client assumes the fish is gone
|
||||||
- entity.refreshEntityData((ServerPlayer) player); // Need to send data such as the display name to client
|
- entity.refreshEntityData((ServerPlayer) player); // Need to send data such as the display name to client
|
||||||
+ entity.resendPossiblyDesyncedEntityData((ServerPlayer) player); // Paper
|
+ entity.resendPossiblyDesyncedEntityData((ServerPlayer) player); // Paper
|
||||||
return Optional.of(InteractionResult.FAIL);
|
return Optional.of(InteractionResult.FAIL);
|
||||||
}
|
}
|
||||||
entity.playSound(((Bucketable) entity).getPickupSound(), 1.0F, 1.0F);
|
entity.playSound(((Bucketable) entity).getPickupSound(), 1.0F, 1.0F);
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
index 3ab04c4bdbe26ff7f6f54eb9cdd58376c592fa05..a2d336ceb52b63db5c03432ee7bc94dc6a742b82 100644
|
index b8eb9166e44da8745a056bf68f2f9316ce25d7a7..2cde808bfa797256409879505ba205a71f381981 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||||
@@ -1010,7 +1010,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
@@ -1012,7 +1012,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
- entityTracker.broadcast(this.getHandle().getAddEntityPacket());
|
- entityTracker.broadcast(this.getHandle().getAddEntityPacket(entityTracker.serverEntity));
|
||||||
+ // Paper start, resend possibly desynced entity instead of add entity packet
|
+ // Paper start - resend possibly desynced entity instead of add entity packet
|
||||||
+ for (ServerPlayerConnection playerConnection : entityTracker.seenBy) {
|
+ for (final ServerPlayerConnection connection : entityTracker.seenBy) {
|
||||||
+ this.getHandle().resendPossiblyDesyncedEntityData(playerConnection.getPlayer());
|
+ this.getHandle().resendPossiblyDesyncedEntityData(connection.getPlayer());
|
||||||
+ }
|
+ }
|
||||||
+ // Paper end
|
+ // Paper end - resend possibly desynced entity instead of add entity packet
|
||||||
}
|
}
|
||||||
|
|
||||||
private static PermissibleBase getPermissibleBase() {
|
public void update(ServerPlayer player) {
|
||||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java
|
||||||
index 0801bcdee8fcff0d388d302387e4f1d587e0a283..2fcd9b836d42e3549a3b6b921c57a4c103146dff 100644
|
index f3a9b3380246fb2dd4b60a8d1a94c5dfed98d316..350ad61ab3fe66abd528e353b431a4a6dac17506 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java
|
||||||
@@ -39,9 +39,11 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame {
|
@@ -39,9 +39,11 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame {
|
Loading…
Reference in New Issue
Block a user