diff options
| author | LemADEC <lemadec.fr@gmail.com> | 2015-12-19 21:09:16 +0100 | 
|---|---|---|
| committer | LemADEC <lemadec.fr@gmail.com> | 2015-12-19 21:09:16 +0100 | 
| commit | 63f8506fd6c40552281457ecc65f7000631ad61a (patch) | |
| tree | 80217964d4ed0b1c3824badfeeefdd6f3aefdae8 /src | |
| parent | 259ef97c7c2a81aa7103b68236abe4638e1c577f (diff) | |
| download | GT5-Unofficial-63f8506fd6c40552281457ecc65f7000631ad61a.tar.gz GT5-Unofficial-63f8506fd6c40552281457ecc65f7000631ad61a.tar.bz2 GT5-Unofficial-63f8506fd6c40552281457ecc65f7000631ad61a.zip | |
Fixed world event lag and related cauldron crash
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/gregtech/common/GT_Proxy.java | 16 | 
1 files 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 13f2551a81..9e600a9c09 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -1415,20 +1415,20 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler {                  }              }              if ((aEvent.world.getTotalWorldTime() % 100L == 0L) && ((this.mItemDespawnTime != 6000) || (this.mMaxEqualEntitiesAtOneSpot > 0))) { -                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)) { +                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)) {                              ((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<Entity> 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 (int j = 0; j < tList.size(); j++) { -                                    if ((tList.get(j) != null) && (tList.get(j).getClass() == tClass)) { +                                for (Entity nearbyEntity : tList) { +                                    if ((nearbyEntity != null) && (nearbyEntity.getClass() == tClass)) {                                          tEntityCount++;                                      }                                  } | 
