From 2c82f057aa0a01862d487d73aacebc13fbdebf93 Mon Sep 17 00:00:00 2001 From: Maxime Legkiy Date: Sun, 5 Feb 2017 18:36:34 +0300 Subject: [PATCH] Fix respawn oil amount if amount down to 0 and reduction amount oil if use Seismic Prospector or more --- src/main/java/gregtech/api/util/GT_Utility.java | 7 ++++++- .../machines/multi/GT_MetaTileEntity_OilDrill.java | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index b652696d..b3fffa5b 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -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); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java index d90093fc..eef57f90 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrill.java @@ -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; }