diff --git a/patches/net/minecraft/entity/Entity.java.patch b/patches/net/minecraft/entity/Entity.java.patch index 291e53c6..4b6c3041 100644 --- a/patches/net/minecraft/entity/Entity.java.patch +++ b/patches/net/minecraft/entity/Entity.java.patch @@ -84,6 +84,7 @@ public ArrayList capturedDrops = new ArrayList(); private UUID persistentID; +- protected HashMap extendedProperties; + // Spigot start + public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getEntityTimings(this); // Spigot + public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); @@ -92,7 +93,7 @@ + public boolean fromMobSpawner; + public void inactiveTick() { } + // Spigot end - protected HashMap extendedProperties; ++ public HashMap extendedProperties; + public String spawnReason; // Cauldron - used to handle CraftBukkit's SpawnReason with CustomSpawners public int getEntityId() diff --git a/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch b/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch index 912e75b0..bf898c2c 100644 --- a/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch +++ b/patches/net/minecraft/server/management/ServerConfigurationManager.java.patch @@ -389,7 +389,7 @@ public EntityPlayerMP createPlayerForUser(GameProfile p_148545_1_) { UUID uuid = EntityPlayer.func_146094_a(p_148545_1_); -@@ -410,80 +621,262 @@ +@@ -410,80 +621,275 @@ return new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(0), p_148545_1_, (ItemInWorldManager)object); } @@ -533,15 +533,28 @@ + entityplayermp1.playerNetServerHandler.playerEntity = entityplayermp1; + if(!isdeath) + { -+ entityplayermp1.inventory.copyInventory(par1EntityPlayerMP.inventory); ++ entityplayermp1.clonePlayer(par1EntityPlayerMP, true); ++ entityplayermp1.activePotionsMap.clear(); ++ entityplayermp1.activePotionsMap.putAll(par1EntityPlayerMP.activePotionsMap); ++ //Let Forge do the heavy lifting... ++ /*entityplayermp1.inventory.copyInventory(par1EntityPlayerMP.inventory); + entityplayermp1.experienceLevel = par1EntityPlayerMP.experienceLevel; + entityplayermp1.experienceTotal = par1EntityPlayerMP.experienceTotal; + entityplayermp1.experience = par1EntityPlayerMP.experience; ++ entityplayermp1.setHealth(par1EntityPlayerMP.getHealth()); ++ entityplayermp1.foodStats = par1EntityPlayerMP.foodStats; ++ entityplayermp1.setScore(par1EntityPlayerMP.getScore()); ++ entityplayermp1.teleportDirection = par1EntityPlayerMP.teleportDirection; ++ //Copy and re-init ExtendedProperties when switching dimensions. ++ entityplayermp1.extendedProperties = par1EntityPlayerMP.extendedProperties; ++ for (net.minecraftforge.common.IExtendedEntityProperties p : par1EntityPlayerMP.extendedProperties.values()) ++ p.init(this, this.worldObj); ++ + entityplayermp1.activePotionsMap.clear(); + entityplayermp1.activePotionsMap.putAll(par1EntityPlayerMP.activePotionsMap); -+ entityplayermp1.setScore(par1EntityPlayerMP.getScore()); ++ entityplayermp1.setScore(par1EntityPlayerMP.getScore());*/ + } -+ entityplayermp1.clonePlayer(par1EntityPlayerMP, returnFromEnd); ++ else entityplayermp1.clonePlayer(par1EntityPlayerMP, returnFromEnd); + // entityplayermp1.dimension = targetDimension; Thermos move this call to later when actualDimension is found + // HEY don't setWorld here either, that has to down to the bottom + entityplayermp1.setEntityId(par1EntityPlayerMP.getEntityId()); @@ -690,7 +703,7 @@ return entityplayermp1; } -@@ -492,34 +885,112 @@ +@@ -492,34 +898,112 @@ transferPlayerToDimension(p_72356_1_, p_72356_2_, mcServer.worldServerForDimension(p_72356_2_).getDefaultTeleporter()); } @@ -822,7 +835,7 @@ } public void transferEntityToWorld(Entity p_82448_1_, int p_82448_2_, WorldServer p_82448_3_, WorldServer p_82448_4_, Teleporter teleporter) -@@ -605,6 +1076,109 @@ +@@ -605,6 +1089,109 @@ p_82448_1_.setWorld(p_82448_4_); } @@ -932,7 +945,7 @@ public void sendPlayerInfoToAllPlayers() { if (++this.playerPingIndex > 600) -@@ -612,11 +1186,13 @@ +@@ -612,11 +1199,13 @@ this.playerPingIndex = 0; } @@ -946,7 +959,7 @@ } public void sendPacketToAllPlayers(Packet p_148540_1_) -@@ -877,13 +1453,24 @@ +@@ -877,13 +1466,24 @@ for (int j = 0; j < this.playerEntityList.size(); ++j) { EntityPlayerMP entityplayermp = (EntityPlayerMP)this.playerEntityList.get(j); @@ -973,7 +986,7 @@ if (d4 * d4 + d5 * d5 + d6 * d6 < p_148543_8_ * p_148543_8_) { entityplayermp.playerNetServerHandler.sendPacket(p_148543_11_); -@@ -941,13 +1528,16 @@ +@@ -941,13 +1541,16 @@ p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(1, 0.0F)); p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(7, p_72354_2_.getRainStrength(1.0F))); p_72354_1_.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(8, p_72354_2_.getWeightedThunderStrength(1.0F))); @@ -991,7 +1004,7 @@ p_72385_1_.playerNetServerHandler.sendPacket(new S09PacketHeldItemChange(p_72385_1_.inventory.currentItem)); } -@@ -961,9 +1551,17 @@ +@@ -961,9 +1564,17 @@ return this.maxPlayers; } @@ -1010,7 +1023,7 @@ } public void setWhiteListEnabled(boolean p_72371_1_) -@@ -1032,12 +1630,30 @@ +@@ -1032,12 +1643,30 @@ public void removeAllPlayers() {