aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/GT_UndergroundOil.java
diff options
context:
space:
mode:
authorTechnus <daniel112092@gmail.com>2017-10-01 15:19:28 +0200
committerTechnus <daniel112092@gmail.com>2017-10-01 15:19:28 +0200
commitff9f58d39a282aee81cc9ae72e7463e470dc596b (patch)
treeba23411d087d8e7d4126d467086901e9cd208fb3 /src/main/java/gregtech/common/GT_UndergroundOil.java
parent4ec739c927cb1b338383df2f49bb08e33737eb61 (diff)
downloadGT5-Unofficial-ff9f58d39a282aee81cc9ae72e7463e470dc596b.tar.gz
GT5-Unofficial-ff9f58d39a282aee81cc9ae72e7463e470dc596b.tar.bz2
GT5-Unofficial-ff9f58d39a282aee81cc9ae72e7463e470dc596b.zip
Optimize imports, optimize random number generation, make turbines loose 0.75 or normal durability in loose fitting mode.
Diffstat (limited to 'src/main/java/gregtech/common/GT_UndergroundOil.java')
-rw-r--r--src/main/java/gregtech/common/GT_UndergroundOil.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/gregtech/common/GT_UndergroundOil.java b/src/main/java/gregtech/common/GT_UndergroundOil.java
index f090498a4e..21c7a4aa0f 100644
--- a/src/main/java/gregtech/common/GT_UndergroundOil.java
+++ b/src/main/java/gregtech/common/GT_UndergroundOil.java
@@ -12,6 +12,7 @@ import net.minecraftforge.fluids.FluidStack;
import java.util.HashMap;
+import static gregtech.api.objects.XSTR.XSTR_INSTANCE;
import static gregtech.common.GT_Proxy.*;
/**
@@ -19,7 +20,6 @@ import static gregtech.common.GT_Proxy.*;
*/
public class GT_UndergroundOil {
public static final short DIVIDER=5000;
- private static final XSTR random=new XSTR();
public static FluidStack undergroundOilReadInformation(IGregTechTileEntity te){
return undergroundOil(te.getWorld().getChunkFromBlockCoords(te.getXCoord(),te.getZCoord()),-1);
@@ -74,7 +74,7 @@ public class GT_UndergroundOil {
fluidInChunk = new FluidStack(uoFluid.getFluid(),tInts[GTOIL]);
}else{
fluidInChunk = new FluidStack(uoFluid.getFluid(), uoFluid.getRandomAmount(tRandom));
- fluidInChunk.amount=(int)((float)fluidInChunk.amount*(0.75f+(random.nextFloat()/2f)));//Randomly change amounts by +/- 25%
+ fluidInChunk.amount=(int)((float)fluidInChunk.amount*(0.75f+(XSTR_INSTANCE.nextFloat()/2f)));//Randomly change amounts by +/- 25%
}
tInts[GTOIL]=fluidInChunk.amount;
tInts[GTOILFLUID]=fluidInChunk.getFluidID();
@@ -90,12 +90,12 @@ public class GT_UndergroundOil {
tInts[GTOIL]=0;//so in next access it will stop way above
}else{
fluidInChunk.amount = fluidExtracted;//give appropriate amount
- if(random.nextFloat()<(decrease-averageDecrease)) decrease--;//use random to "subtract double from int"
+ if(XSTR_INSTANCE.nextFloat()<(decrease-averageDecrease)) decrease--;//use XSTR_INSTANCE to "subtract double from int"
//ex.
// averageDecrease=3.9
// decrease= ceil from 3.9 = 4
// decrease-averageDecrease=0.1 -> chance to subtract 1
- // if random is < chance then subtract 1
+ // if XSTR_INSTANCE is < chance then subtract 1
tInts[GTOIL]-=decrease;//diminish amount, "randomly" adjusted to double value (averageDecrease)
}
}else{//just get info