Merge pull request #889 from maixgame/unstable
Fix respawn oil amount if amount down to 0
This commit is contained in:
commit
5e19e7310f
2 changed files with 7 additions and 2 deletions
|
@ -1519,6 +1519,10 @@ public class GT_Utility {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static FluidStack getUndergroundOil(World aWorld, int aX, int aZ) {
|
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))));
|
Random tRandom = new Random((aWorld.getSeed() + (aX / 96) + (7 * (aZ / 96))));
|
||||||
|
@ -1554,7 +1558,8 @@ public class GT_Utility {
|
||||||
}
|
}
|
||||||
GT_Proxy.chunkData.remove(tPos);
|
GT_Proxy.chunkData.remove(tPos);
|
||||||
}
|
}
|
||||||
tAmount = tAmount - 5;
|
if (needConsumeOil && tAmount >= 5000)
|
||||||
|
tAmount = tAmount - 5;
|
||||||
tInts[0] = tAmount;
|
tInts[0] = tAmount;
|
||||||
GT_Proxy.chunkData.put(tPos, tInts);
|
GT_Proxy.chunkData.put(tPos, tInts);
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
if (tFluid == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue