From 1b6f3ab64d6c293fd6a48a826038f90ccd31c57e Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Tue, 29 Dec 2015 15:20:14 +0100 Subject: [PATCH] Revert "Fixed world event lag and related cauldron crash (LemADEC)" This reverts commit 10d1e48220974c1c39e96e84108f8b908b0b43b1. --- src/main/java/gregtech/common/GT_Proxy.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index f4d405c0..0868a50f 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -1418,20 +1418,20 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } } if ((aEvent.world.getTotalWorldTime() % 100L == 0L) && ((this.mItemDespawnTime != 6000) || (this.mMaxEqualEntitiesAtOneSpot > 0))) { - for (Object object : aEvent.world.loadedEntityList) { - if (object instanceof Entity) { - Entity tEntity = (Entity) object; - if ((tEntity instanceof EntityItem) && (this.mItemDespawnTime != 6000) && (((EntityItem) tEntity).lifespan == 6000)) { + for (int i = 0; i < aEvent.world.loadedEntityList.size(); i++) { + if ((aEvent.world.loadedEntityList.get(i) instanceof Entity)) { + Entity tEntity = (Entity) aEvent.world.loadedEntityList.get(i); + if (((tEntity instanceof EntityItem)) && (this.mItemDespawnTime != 6000) && (((EntityItem) tEntity).lifespan == 6000)) { ((EntityItem) tEntity).lifespan = this.mItemDespawnTime; - } else if ((tEntity instanceof EntityLivingBase) && (this.mMaxEqualEntitiesAtOneSpot > 0) && (!(tEntity instanceof EntityPlayer)) + } else if (((tEntity instanceof EntityLivingBase)) && (this.mMaxEqualEntitiesAtOneSpot > 0) && (!(tEntity instanceof EntityPlayer)) && (((EntityLivingBase) tEntity).canBePushed()) && (((EntityLivingBase) tEntity).getHealth() > 0.0F)) { - List tList = tEntity.worldObj.getEntitiesWithinAABBExcludingEntity(tEntity, + List tList = tEntity.worldObj.getEntitiesWithinAABBExcludingEntity(tEntity, tEntity.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); Class tClass = tEntity.getClass(); int tEntityCount = 1; if (tList != null) { - for (Entity nearbyEntity : tList) { - if ((nearbyEntity != null) && (nearbyEntity.getClass() == tClass)) { + for (int j = 0; j < tList.size(); j++) { + if ((tList.get(j) != null) && (tList.get(j).getClass() == tClass)) { tEntityCount++; } }