Fix that so pollution is not negative.
This commit is contained in:
parent
b9ad640d99
commit
c855faa14e
1 changed files with 7 additions and 3 deletions
|
@ -242,9 +242,13 @@ public class GT_Pollution {
|
||||||
dataMap=new HashMap<>(1024);
|
dataMap=new HashMap<>(1024);
|
||||||
dimensionWiseChunkData.put(ch.worldObj.provider.dimensionId,dataMap);
|
dimensionWiseChunkData.put(ch.worldObj.provider.dimensionId,dataMap);
|
||||||
}
|
}
|
||||||
if(dataMap.get(ch.getChunkCoordIntPair())==null)
|
int[] dataArr=dataMap.get(ch.getChunkCoordIntPair());
|
||||||
dataMap.put(ch.getChunkCoordIntPair(),getDefaultChunkDataOnCreation());
|
if(dataArr==null){
|
||||||
dataMap.get(ch.getChunkCoordIntPair())[GTPOLLUTION]+=aPollution;
|
dataArr=getDefaultChunkDataOnCreation();
|
||||||
|
dataMap.put(ch.getChunkCoordIntPair(),dataArr);
|
||||||
|
}
|
||||||
|
dataArr[GTPOLLUTION]+=aPollution;
|
||||||
|
if(dataArr[GTPOLLUTION]<0)dataArr[GTPOLLUTION]=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getPollution(IGregTechTileEntity te){
|
public static int getPollution(IGregTechTileEntity te){
|
||||||
|
|
Loading…
Reference in a new issue