Merge pull request #889 from maixgame/unstable

Fix respawn oil amount if amount down to 0
This commit is contained in:
Blood-Asp 2017-02-05 17:35:40 +01:00 committed by GitHub
commit 5e19e7310f
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;
}