diff --git a/src/main/java/gregtech/common/GT_Pollution.java b/src/main/java/gregtech/common/GT_Pollution.java index 19784cae..970f129c 100644 --- a/src/main/java/gregtech/common/GT_Pollution.java +++ b/src/main/java/gregtech/common/GT_Pollution.java @@ -1,14 +1,10 @@ package gregtech.common; -import java.util.ArrayList; -import java.util.List; - import gregtech.GT_Mod; import gregtech.api.objects.XSTR; import gregtech.api.util.GT_Utility; import net.minecraft.block.Block; import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; import net.minecraft.entity.EntityLiving; import net.minecraft.init.Blocks; import net.minecraft.potion.Potion; @@ -16,9 +12,11 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.ChunkPosition; import net.minecraft.world.World; -import net.minecraft.world.WorldManager; import net.minecraftforge.common.DimensionManager; +import java.util.ArrayList; +import java.util.List; + public class GT_Pollution { @@ -26,7 +24,7 @@ public class GT_Pollution { static int loops = 1; static XSTR tRan = new XSTR(); - public static void onWorldTick(int aTick){ + public static void onWorldTick(World aWorld, int aTick){ if(!GT_Mod.gregtechproxy.mPollution)return; if(aTick == 0 || (tList==null && GT_Proxy.chunkData!=null)){ tList = new ArrayList(GT_Proxy.chunkData.keySet()); @@ -63,7 +61,7 @@ public class GT_Pollution { GT_Proxy.chunkData.get(tNPos)[1] = tNPol; } }else{ - GT_Utility.getUndergroundOil(Minecraft.getMinecraft().theWorld,tPos.chunkPosX*16,tPos.chunkPosZ*16); + GT_Utility.getUndergroundOil(aWorld,tPos.chunkPosX*16,tPos.chunkPosZ*16); } }} int[] tArray = GT_Proxy.chunkData.get(tPos); @@ -77,7 +75,7 @@ public class GT_Pollution { // Poison effects if(tPollution > GT_Mod.gregtechproxy.mPollutionPoisonLimit){ AxisAlignedBB chunk = AxisAlignedBB.getBoundingBox(tPos.chunkPosX*16, 0, tPos.chunkPosZ*16, tPos.chunkPosX*16+16, 256, tPos.chunkPosZ*16+16); - List tEntitys = Minecraft.getMinecraft().theWorld.getEntitiesWithinAABB(EntityLiving.class, chunk); + List tEntitys = aWorld.getEntitiesWithinAABB(EntityLiving.class, chunk); for(EntityLiving tEnt : tEntitys){ if(tRan.nextInt(tPollution/25000) > 20){ tEnt.addPotionEffect(new PotionEffect(Potion.poison.id, tPollution/25000, 1)); diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index e23fced7..ce1d30b0 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -1452,7 +1452,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { } } if(aEvent.world.provider.dimensionId==0) - GT_Pollution.onWorldTick((int) (aEvent.world.getTotalWorldTime() % 1200)); + GT_Pollution.onWorldTick(aEvent.world, (int) (aEvent.world.getTotalWorldTime() % 1200)); } }