From 82458fed2e4c065091f38340ceb05e98f28fc459 Mon Sep 17 00:00:00 2001 From: Technus Date: Mon, 1 May 2017 08:18:30 +0200 Subject: Cherry-Pick c12e474 https://github.com/GTNewHorizons/GT5-Unofficial/commit/c12e474c23ca02fb3479312850f6ae07e623d8b9 --- src/main/java/gregtech/api/objects/GT_UO_Dimension.java | 8 ++------ src/main/java/gregtech/api/objects/GT_UO_DimensionList.java | 11 ++++++----- src/main/java/gregtech/api/objects/GT_UO_Fluid.java | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) (limited to 'src/main/java/gregtech/api/objects') diff --git a/src/main/java/gregtech/api/objects/GT_UO_Dimension.java b/src/main/java/gregtech/api/objects/GT_UO_Dimension.java index ffad72868c..657e9353c6 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_Dimension.java +++ b/src/main/java/gregtech/api/objects/GT_UO_Dimension.java @@ -18,7 +18,7 @@ public class GT_UO_Dimension { private int maxChance; public String Dimension = "null"; - public GT_UO_Dimension(ConfigCategory aConfigCategory) { + public GT_UO_Dimension(ConfigCategory aConfigCategory) {//TODO CONFIGURE fFluids = HashBiMap.create(); if (aConfigCategory.containsKey("Dimension")) { @@ -35,18 +35,14 @@ public class GT_UO_Dimension { } public GT_UO_Fluid getRandomFluid (Random aRandom) { - int random = aRandom.nextInt(3); - random = aRandom.nextInt(1000); - int step = 0; + int random = aRandom.nextInt(1000); for (BiMap.Entry fl : fFluids.entrySet()) { int chance = fl.getValue().Chance*1000/maxChance; if (random<=chance) return fl.getValue(); //System.out.println("GT UO "+fl.getValue().Registry+" Chance:"+chance+" Random:"+random); random-=chance; } - return null; - } } diff --git a/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java b/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java index 89340132be..c566affe41 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java +++ b/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java @@ -48,15 +48,16 @@ public class GT_UO_DimensionList { fConfig.get(Category, "MaxAmount", aMaxAmount).getInt(aMaxAmount); fConfig.get(Category, "Chance", aChance).getInt(aChance); fConfig.get(Category, "DecreasePerOperationAmount", aDecreasePerOperationAmount).getInt(aDecreasePerOperationAmount); + //IT IS IN BUCKETS!!! } public void SetDafultValues() { - SetConfigValues("Overworld", "0", "gas_natural_gas", "gas_natural_gas", 0, 625, 20, 5); + SetConfigValues("Overworld", "0", "gas_natural_gas", "gas_natural_gas", 0, 625, 20, 7); SetConfigValues("Overworld", "0", "liquid_light_oil", "liquid_light_oil", 0, 625, 20, 5); - SetConfigValues("Overworld", "0", "liquid_medium_oil", "liquid_medium_oil", 0, 625, 20, 5); - SetConfigValues("Overworld", "0", "liquid_heavy_oil", "liquid_heavy_oil", 0, 625, 20, 5); - SetConfigValues("Overworld", "0", "oil", "oil", 0, 625, 20, 5); - SetConfigValues("Moon", "Moon", "helium-3", "helium-3", 0, 375, 100, 5); + SetConfigValues("Overworld", "0", "liquid_medium_oil", "liquid_medium_oil", 0, 625, 20, 3); + SetConfigValues("Overworld", "0", "liquid_heavy_oil", "liquid_heavy_oil", 0, 625, 20, 1); + SetConfigValues("Overworld", "0", "oil", "oil", 0, 625, 20, 3); + SetConfigValues("Moon", "Moon", "helium-3", "helium-3", 1, 375, 100, 1); } public void getConfig(Configuration aConfig, String aCategory) { 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..d65e94c4f1 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_Fluid.java +++ b/src/main/java/gregtech/api/objects/GT_UO_Fluid.java @@ -53,7 +53,7 @@ public class GT_UO_Fluid { } } - public int getRandomAmount(Random aRandom){ + public int getRandomAmount(Random aRandom){//generates milliBuckets 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(); -- cgit From a4f0426159749f93f3ba1cee3927700196b30d0f Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 7 May 2017 22:21:44 +0200 Subject: 8e0e516 --- .../gregtech/api/objects/GT_UO_DimensionList.java | 14 ++++++------ .../java/gregtech/api/objects/GT_UO_Fluid.java | 25 ++++++++++++---------- 2 files changed, 21 insertions(+), 18 deletions(-) (limited to 'src/main/java/gregtech/api/objects') diff --git a/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java b/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java index c566affe41..ce3bdc51cb 100644 --- a/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java +++ b/src/main/java/gregtech/api/objects/GT_UO_DimensionList.java @@ -2,9 +2,9 @@ package gregtech.api.objects; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; - import gregtech.GT_Mod; import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_Log; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.Configuration; @@ -53,11 +53,11 @@ public class GT_UO_DimensionList { public void SetDafultValues() { SetConfigValues("Overworld", "0", "gas_natural_gas", "gas_natural_gas", 0, 625, 20, 7); - SetConfigValues("Overworld", "0", "liquid_light_oil", "liquid_light_oil", 0, 625, 20, 5); - SetConfigValues("Overworld", "0", "liquid_medium_oil", "liquid_medium_oil", 0, 625, 20, 3); - SetConfigValues("Overworld", "0", "liquid_heavy_oil", "liquid_heavy_oil", 0, 625, 20, 1); - SetConfigValues("Overworld", "0", "oil", "oil", 0, 625, 20, 3); - SetConfigValues("Moon", "Moon", "helium-3", "helium-3", 1, 375, 100, 1); + SetConfigValues("Overworld", "0", "liquid_light_oil", "liquid_light_oil", 0, 625, 20, 6); + SetConfigValues("Overworld", "0", "liquid_medium_oil", "liquid_medium_oil", 0, 625, 20, 5); + SetConfigValues("Overworld", "0", "liquid_heavy_oil", "liquid_heavy_oil", 0, 625, 20, 4); + SetConfigValues("Overworld", "0", "oil", "oil", 0, 625, 20, 5); + SetConfigValues("Moon", "Moon", "helium-3", "helium-3", 24, 128, 100, 1); } public void getConfig(Configuration aConfig, String aCategory) { @@ -66,7 +66,7 @@ public class GT_UO_DimensionList { if (!fConfig.hasCategory(fCategory)) SetDafultValues(); - fConfig.setCategoryComment(fCategory, "Config Undeground Fluids (Delete this Category for regenerate)"); + fConfig.setCategoryComment(fCategory, "Config Underground Fluids (Delete this Category for regenerate)"); fConfig.setCategoryComment(fCategory+".Default", "Set Default Generating (Use this Category for Default settings)"); fConfig.setCategoryComment(fCategory+".Overworld", "Set Overworld Generating"); fConfig.setCategoryComment(fCategory+".Moon", "Set Moon Generating"); 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 d65e94c4f1..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){//generates milliBuckets - 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 -- cgit From c1f85264a09c174b964d16d145e24b16f26dfcbc Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Mon, 5 Jun 2017 20:45:15 +0200 Subject: Add missing translation lines. #772 --- src/main/java/gregtech/api/objects/GT_Cover_Default.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/api/objects') diff --git a/src/main/java/gregtech/api/objects/GT_Cover_Default.java b/src/main/java/gregtech/api/objects/GT_Cover_Default.java index bf3bc84497..82946f18d4 100644 --- a/src/main/java/gregtech/api/objects/GT_Cover_Default.java +++ b/src/main/java/gregtech/api/objects/GT_Cover_Default.java @@ -22,7 +22,7 @@ public class GT_Cover_Default extends GT_CoverBehavior { @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = ((aCoverVariable + 1) & 15); - GT_Utility.sendChatToPlayer(aPlayer, ((aCoverVariable & 1) != 0 ? "Redstone " : "") + ((aCoverVariable & 2) != 0 ? "Energy " : "") + ((aCoverVariable & 4) != 0 ? "Fluids " : "") + ((aCoverVariable & 8) != 0 ? "Items " : "")); + GT_Utility.sendChatToPlayer(aPlayer, ((aCoverVariable & 1) != 0 ? trans("128") : "") + ((aCoverVariable & 2) != 0 ? trans("129") : "") + ((aCoverVariable & 4) != 0 ? trans("130") : "") + ((aCoverVariable & 8) != 0 ? trans("131") : "")); return aCoverVariable; } -- cgit From 4ac668066b90ef7f7e9fd85b0fad398fc76c848b Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Tue, 13 Jun 2017 22:50:19 +0200 Subject: missed one file --- src/main/java/gregtech/api/objects/GT_Cover_Default.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/gregtech/api/objects') diff --git a/src/main/java/gregtech/api/objects/GT_Cover_Default.java b/src/main/java/gregtech/api/objects/GT_Cover_Default.java index 82946f18d4..fa6d3bcc26 100644 --- a/src/main/java/gregtech/api/objects/GT_Cover_Default.java +++ b/src/main/java/gregtech/api/objects/GT_Cover_Default.java @@ -22,7 +22,7 @@ public class GT_Cover_Default extends GT_CoverBehavior { @Override public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { aCoverVariable = ((aCoverVariable + 1) & 15); - GT_Utility.sendChatToPlayer(aPlayer, ((aCoverVariable & 1) != 0 ? trans("128") : "") + ((aCoverVariable & 2) != 0 ? trans("129") : "") + ((aCoverVariable & 4) != 0 ? trans("130") : "") + ((aCoverVariable & 8) != 0 ? trans("131") : "")); + GT_Utility.sendChatToPlayer(aPlayer, ((aCoverVariable & 1) != 0 ? trans("128", "Redstone ") : "") + ((aCoverVariable & 2) != 0 ? trans("129", "Energy ") : "") + ((aCoverVariable & 4) != 0 ? trans("130", "Fluids ") : "") + ((aCoverVariable & 8) != 0 ? trans("131", "Items ") : "")); return aCoverVariable; } -- cgit