diff --git a/sources/src/main/java/net/minecraft/server/Chunk.java b/sources/src/main/java/net/minecraft/server/Chunk.java index 5d243d212..245ac4ff3 100644 --- a/sources/src/main/java/net/minecraft/server/Chunk.java +++ b/sources/src/main/java/net/minecraft/server/Chunk.java @@ -2,6 +2,7 @@ package net.minecraft.server; import com.destroystokyo.paper.exception.ServerInternalException; import com.google.common.base.Predicate; +import com.google.common.collect.Maps; import com.google.common.collect.Queues; import java.util.Arrays; import java.util.Collection; @@ -681,7 +682,9 @@ public class Chunk { entity.ac = k; entity.ad = this.locZ; this.entitySlices[k].add(entity); - // Paper start - update count + // Paper start + entity.setCurrentChunk(this); + entityCounts.increment(entity.entityKeyString); if (entity instanceof EntityItem) { itemCounts[k]++; } else if (entity instanceof IInventory) { @@ -703,10 +706,6 @@ public class Chunk { this.entityCount.adjustOrPutValue( creatureType.a(), 1, 1 ); } } - // Paper start - entity.setCurrentChunk(this); - entityCounts.increment(entity.entityKeyString); - // Paper end // Spigot end } @@ -724,8 +723,10 @@ public class Chunk { i = this.entitySlices.length - 1; } - if (!this.entitySlices[i].remove(entity)) { return; } // Paper - // Paper start - update counts + // Paper start + if (!this.entitySlices[i].remove(entity)) { return; } + entity.setCurrentChunk(null); + entityCounts.decrement(entity.entityKeyString); if (entity instanceof EntityItem) { itemCounts[i]--; } else if (entity instanceof IInventory) { @@ -747,10 +748,6 @@ public class Chunk { this.entityCount.adjustValue( creatureType.a(), -1 ); } } - // Paper start - entity.setCurrentChunk(null); - entityCounts.decrement(entity.entityKeyString); - // Paper end // Spigot end } diff --git a/sources/src/main/java/net/minecraft/server/PlayerConnection.java b/sources/src/main/java/net/minecraft/server/PlayerConnection.java index e08407443..e247281db 100644 --- a/sources/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/sources/src/main/java/net/minecraft/server/PlayerConnection.java @@ -1686,6 +1686,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { } if (event.isCancelled()) { + this.player.updateInventory(this.player.activeContainer); // Paper - Refresh player inventory return; } // CraftBukkit end diff --git a/work/Paper b/work/Paper index f8452c8f6..0e5eec62e 160000 --- a/work/Paper +++ b/work/Paper @@ -1 +1 @@ -Subproject commit f8452c8f617c51e7ef753e564c72dd8ee69f4ab8 +Subproject commit 0e5eec62e7aa70c29e0254ecd3cde996397322b0