From d98e2ca8f60d6ef3d81e3d8d7f7ec65d5dc7f426 Mon Sep 17 00:00:00 2001 From: Sergey Shatunov Date: Thu, 4 Feb 2016 18:21:25 +0700 Subject: [PATCH] Fix ender inventory not synced after cloning, fix #329 --- .../entity/player/EntityPlayer.java.patch | 17 +++++++++++++++-- .../entity/player/EntityPlayerMP.java.patch | 5 +++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/patches/net/minecraft/entity/player/EntityPlayer.java.patch b/patches/net/minecraft/entity/player/EntityPlayer.java.patch index 279978c..f8f3a67 100644 --- a/patches/net/minecraft/entity/player/EntityPlayer.java.patch +++ b/patches/net/minecraft/entity/player/EntityPlayer.java.patch @@ -23,8 +23,12 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandSender { public static final String PERSISTED_NBT_TAG = "PlayerPersisted"; -@@ -102,7 +118,7 @@ - private InventoryEnderChest theInventoryEnderChest = new InventoryEnderChest(); +@@ -99,10 +115,10 @@ + private HashMap spawnForcedMap = new HashMap(); + + public InventoryPlayer inventory = new InventoryPlayer(this); +- private InventoryEnderChest theInventoryEnderChest = new InventoryEnderChest(); ++ public InventoryEnderChest theInventoryEnderChest = new InventoryEnderChest(); public Container inventoryContainer; public Container openContainer; - protected FoodStats foodStats = new FoodStats(); @@ -499,3 +503,12 @@ } } +@@ -2023,7 +2246,7 @@ + this.setScore(p_71049_1_.getScore()); + } + +- this.theInventoryEnderChest = p_71049_1_.theInventoryEnderChest; ++ // this.theInventoryEnderChest = p_71049_1_.theInventoryEnderChest; // KCauldron - moved up + + this.spawnChunkMap = p_71049_1_.spawnChunkMap; + this.spawnForcedMap = p_71049_1_.spawnForcedMap; diff --git a/patches/net/minecraft/entity/player/EntityPlayerMP.java.patch b/patches/net/minecraft/entity/player/EntityPlayerMP.java.patch index 229915b..0a758dc 100644 --- a/patches/net/minecraft/entity/player/EntityPlayerMP.java.patch +++ b/patches/net/minecraft/entity/player/EntityPlayerMP.java.patch @@ -705,15 +705,16 @@ public void addChatComponentMessage(IChatComponent p_146105_1_) { this.playerNetServerHandler.sendPacket(new S02PacketChat(p_146105_1_)); -@@ -878,6 +1204,7 @@ +@@ -878,6 +1204,8 @@ public void clonePlayer(EntityPlayer p_71049_1_, boolean p_71049_2_) { ++ this.theInventoryEnderChest = p_71049_1_.theInventoryEnderChest; + if (p_71049_1_ instanceof EntityPlayerMP) ((org.bukkit.craftbukkit.entity.CraftLivingEntity) (bukkitEntity = ((EntityPlayerMP) p_71049_1_).bukkitEntity)).updateEntity(this); super.clonePlayer(p_71049_1_, p_71049_2_); this.lastExperience = -1; this.lastHealth = -1.0F; -@@ -1037,6 +1364,114 @@ +@@ -1037,6 +1365,114 @@ return this.field_143005_bX; }