aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/objects/GT_UO_Fluid.java
diff options
context:
space:
mode:
authorJohannes Gäßler <updrn@student.kit.edu>2017-06-15 12:28:14 +0200
committerJohannes Gäßler <updrn@student.kit.edu>2017-06-15 12:28:14 +0200
commit34474480f73ca5ab1c711d73bdb4bd809673e063 (patch)
tree794ef12002b88e2f01b5f6d76c9c1f9b62a48961 /src/main/java/gregtech/api/objects/GT_UO_Fluid.java
parentc3f2b2b49dc3911a377fd062908d4df78bd3e58d (diff)
parent08c75fd813a4b48ba7a6b58391767161791c96e7 (diff)
downloadGT5-Unofficial-34474480f73ca5ab1c711d73bdb4bd809673e063.tar.gz
GT5-Unofficial-34474480f73ca5ab1c711d73bdb4bd809673e063.tar.bz2
GT5-Unofficial-34474480f73ca5ab1c711d73bdb4bd809673e063.zip
Merge remote-tracking branch 'origin/unstable' into ChemistryUpdate
Conflicts: src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeBoiler.java src/main/java/gregtech/loaders/load/GT_FuelLoader.java src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java src/main/java/gregtech/nei/GT_NEI_DefaultHandler.java
Diffstat (limited to 'src/main/java/gregtech/api/objects/GT_UO_Fluid.java')
-rw-r--r--src/main/java/gregtech/api/objects/GT_UO_Fluid.java25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/main/java/gregtech/api/objects/GT_UO_Fluid.java b/src/main/java/gregtech/api/objects/GT_UO_Fluid.java
index c2d9b70bd2..5eea9c323f 100644
--- a/src/main/java/gregtech/api/objects/GT_UO_Fluid.java
+++ b/src/main/java/gregtech/api/objects/GT_UO_Fluid.java
@@ -9,6 +9,10 @@ import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
+import java.util.Random;
+
+import static gregtech.common.GT_UndergroundOil.DIVIDER;
+
public class GT_UO_Fluid {
public String Registry = "null";
public int MaxAmount = 0;
@@ -19,27 +23,27 @@ public class GT_UO_Fluid {
public GT_UO_Fluid(ConfigCategory aConfigCategory) {
if (aConfigCategory.containsKey("Registry"))
{
- aConfigCategory.get("Registry").comment = "Fluid registry";
+ aConfigCategory.get("Registry").comment = "Fluid registry name";
Registry = aConfigCategory.get("Registry").getString();
}
if (aConfigCategory.containsKey("MaxAmount"))
{
- aConfigCategory.get("MaxAmount").comment = "Max amount generation (per operation Amount)";
+ aConfigCategory.get("MaxAmount").comment = "Max amount generation (per operation, sets the VeinData) 80000 MAX";
MaxAmount = aConfigCategory.get("MaxAmount").getInt(0);
}
if (aConfigCategory.containsKey("MinAmount"))
{
- aConfigCategory.get("MinAmount").comment = "Max amount generation (per operation Amount)";
+ aConfigCategory.get("MinAmount").comment = "Min amount generation (per operation, sets the VeinData) 0 MIN";
MinAmount = aConfigCategory.get("MinAmount").getInt(0);
}
if (aConfigCategory.containsKey("Chance"))
{
- aConfigCategory.get("Chance").comment = "Chance generating";
+ aConfigCategory.get("Chance").comment = "Chance generating (weighted chance!, there will be a fluid in chunk always!)";
Chance = aConfigCategory.get("Chance").getInt(0);
}
if (aConfigCategory.containsKey("DecreasePerOperationAmount"))
{
- aConfigCategory.get("DecreasePerOperationAmount").comment = "Decrease per operation Amount (X/5000L per operation)";
+ aConfigCategory.get("DecreasePerOperationAmount").comment = "Decrease per operation (actual fluid gained works like (Litre)VeinData/5000)";
DecreasePerOperationAmount = aConfigCategory.get("DecreasePerOperationAmount").getInt(5);
}
//System.out.println("GT UO "+aConfigCategory.getName()+" Fluid:"+Registry+" Max:"+MaxAmount+" Min:"+MinAmount+" Chance:"+Chance);
@@ -53,11 +57,10 @@ public class GT_UO_Fluid {
}
}
- public int getRandomAmount(Random aRandom){
- int r1 = (int)Math.round(Math.pow((MaxAmount-MinAmount)*500000.d, 0.2));
- int r2 = (int)Math.floor(Math.pow(MinAmount*500000.d, 0.2));
- double amount = aRandom.nextInt(r1)+r2+aRandom.nextDouble();
- return (int) (Math.pow(amount, 5) / 100);
+ public int getRandomAmount(Random aRandom){//generates some random ass number that correlates to extraction speeds
+ int div = (int)Math.floor(Math.pow((MaxAmount-MinAmount)*100.d*DIVIDER, 0.2d));
+ int min = (int)Math.floor(Math.pow(MinAmount*100.d*DIVIDER, 0.2d));
+ double amount = min+aRandom.nextInt(div)+aRandom.nextDouble();
+ return (int) (Math.pow(amount, 5) / 100);//reverses the computation above
}
-
} \ No newline at end of file