From 31cdc9fe6ccb3a83deeb2c4022b84f81df818110 Mon Sep 17 00:00:00 2001 From: Prototik Date: Thu, 28 May 2015 17:34:42 +0700 Subject: [PATCH] Check for valid entities on load stage --- patches/net/minecraft/world/World.java.patch | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/patches/net/minecraft/world/World.java.patch b/patches/net/minecraft/world/World.java.patch index d1d1aee..1a20f1a 100644 --- a/patches/net/minecraft/world/World.java.patch +++ b/patches/net/minecraft/world/World.java.patch @@ -1209,7 +1209,15 @@ ++i; } } -@@ -3314,8 +3971,17 @@ +@@ -3298,6 +3955,7 @@ + for (int i = 0; i < p_72868_1_.size(); ++i) + { + Entity entity = (Entity)p_72868_1_.get(i); ++ if (!entity.entityAllowedToSpawn()) continue; + if (!MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(entity, this))) + { + loadedEntityList.add(entity); +@@ -3314,8 +3972,17 @@ public boolean canPlaceEntityOnSide(Block p_147472_1_, int p_147472_2_, int p_147472_3_, int p_147472_4_, boolean p_147472_5_, int p_147472_6_, Entity p_147472_7_, ItemStack p_147472_8_) { Block block1 = this.getBlock(p_147472_2_, p_147472_3_, p_147472_4_); @@ -1228,7 +1236,7 @@ } public PathEntity getPathEntityToEntity(Entity p_72865_1_, Entity p_72865_2_, float p_72865_3_, boolean p_72865_4_, boolean p_72865_5_, boolean p_72865_6_, boolean p_72865_7_) -@@ -3464,6 +4130,12 @@ +@@ -3464,6 +4131,12 @@ for (int i = 0; i < this.playerEntities.size(); ++i) { EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i); @@ -1241,7 +1249,7 @@ double d5 = entityplayer1.getDistanceSq(p_72977_1_, p_72977_3_, p_72977_5_); if ((p_72977_7_ < 0.0D || d5 < p_72977_7_ * p_72977_7_) && (d4 == -1.0D || d5 < d4)) -@@ -3489,7 +4161,12 @@ +@@ -3489,7 +4162,12 @@ for (int i = 0; i < this.playerEntities.size(); ++i) { EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i); @@ -1255,7 +1263,7 @@ if (!entityplayer1.capabilities.disableDamage && entityplayer1.isEntityAlive()) { double d5 = entityplayer1.getDistanceSq(p_72846_1_, p_72846_3_, p_72846_5_); -@@ -3660,6 +4337,18 @@ +@@ -3660,6 +4338,18 @@ public void updateAllPlayersSleepingFlag() {} @@ -1274,7 +1282,7 @@ public float getWeightedThunderStrength(float p_72819_1_) { return (this.prevThunderingStrength + (this.thunderingStrength - this.prevThunderingStrength) * p_72819_1_) * this.getRainStrength(p_72819_1_); -@@ -3932,8 +4621,8 @@ +@@ -3932,8 +4622,8 @@ */ public void addTileEntity(TileEntity entity) { @@ -1285,7 +1293,7 @@ { dest.add(entity); } -@@ -4029,4 +4718,73 @@ +@@ -4029,4 +4719,73 @@ } return count; }