Fix respawn oil amount if amount down to 0 and reduction amount oil if use Seismic Prospector or more

This commit is contained in:
Maxime Legkiy 2017-02-05 18:36:34 +03:00
parent f00ccaa279
commit 2c82f057aa
2 changed files with 7 additions and 2 deletions

View file

@ -1519,6 +1519,10 @@ public class GT_Utility {
}
public static FluidStack getUndergroundOil(World aWorld, int aX, int aZ) {
return getUndergroundOil(aWorld, aX, aZ, false);
}
public static FluidStack getUndergroundOil(World aWorld, int aX, int aZ, boolean needConsumeOil) {
Random tRandom = new Random((aWorld.getSeed() + (aX / 96) + (7 * (aZ / 96))));
@ -1554,7 +1558,8 @@ public class GT_Utility {
}
GT_Proxy.chunkData.remove(tPos);
}
tAmount = tAmount - 5;
if (needConsumeOil && tAmount >= 5000)
tAmount = tAmount - 5;
tInts[0] = tAmount;
GT_Proxy.chunkData.put(tPos, tInts);

View file

@ -73,7 +73,7 @@ public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase
}
}
}
FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord());
FluidStack tFluid = GT_Utility.getUndergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord(), getBaseMetaTileEntity().getZCoord(), true);
if (tFluid == null) {
return false;
}