diff options
author | Technus <daniel112092@gmail.com> | 2016-10-08 13:22:04 +0200 |
---|---|---|
committer | Technus <daniel112092@gmail.com> | 2016-10-08 13:22:04 +0200 |
commit | d8fd2c020bf9691c22e90e69e77ae03a8c479034 (patch) | |
tree | 9a4d53063588a96e594520470b600ab492b0e1f7 /src/main/java/gregtech/api/util | |
parent | 61a01ce3eaca6626ece32c9fe50c4ce1535d8813 (diff) | |
download | GT5-Unofficial-d8fd2c020bf9691c22e90e69e77ae03a8c479034.tar.gz GT5-Unofficial-d8fd2c020bf9691c22e90e69e77ae03a8c479034.tar.bz2 GT5-Unofficial-d8fd2c020bf9691c22e90e69e77ae03a8c479034.zip |
Changed chunk coordinate to unified >>4 metod
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_Recipe.java | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GT_Utility.java | 23 |
2 files changed, 11 insertions, 14 deletions
diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index 4deefcba2b..ea82a414f5 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -473,7 +473,7 @@ public class GT_Recipe { public static final GT_Recipe_Map sAutoclaveRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.autoclave", "Autoclave", null, RES_PATH_GUI + "basicmachines/Autoclave", 1, 1, 1, 1, 1, E, 1, E, true, true); public static final GT_Recipe_Map sElectroMagneticSeparatorRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(50), "gt.recipe.electromagneticseparator", "Electromagnetic Separator", null, RES_PATH_GUI + "basicmachines/ElectromagneticSeparator", 1, 3, 1, 0, 1, E, 1, E, true, true); public static final GT_Recipe_Map sPolarizerRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(100), "gt.recipe.polarizer", "Electromagnetic Polarizer", null, RES_PATH_GUI + "basicmachines/Polarizer", 1, 1, 1, 0, 1, E, 1, E, true, true); - public static final GT_Recipe_Map sMaceratorRecipes = new GT_Recipe_Map_Macerator(new HashSet<GT_Recipe>(10000), "gt.recipe.macerator", "Pulverization", null, RES_PATH_GUI + "basicmachines/Macerator4", 1, 4, 1, 0, 1, E, 1, E, true, true); + public static final GT_Recipe_Map sMaceratorRecipes = new GT_Recipe_Map_Macerator(new HashSet<GT_Recipe>(16000), "gt.recipe.macerator", "Pulverization", null, RES_PATH_GUI + "basicmachines/Macerator4", 1, 4, 1, 0, 1, E, 1, E, true, true); public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.chemicalbath", "Chemical Bath", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1, 1, E, 1, E, true, true); public static final GT_Recipe_Map sFluidCannerRecipes = new GT_Recipe_Map_FluidCanner(new HashSet<GT_Recipe>(100), "gt.recipe.fluidcanner", "Fluid Canning Machine", null, RES_PATH_GUI + "basicmachines/FluidCannerNEI", 1, 1, 1, 0, 1, E, 1, E, true, true); public static final GT_Recipe_Map sBrewingRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(100), "gt.recipe.brewer", "Brewing Machine", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 0, 1, 1, 1, E, 1, E, true, true); diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 8debfd1e58..8c86519d98 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -1516,13 +1516,10 @@ public class GT_Utility { } public static FluidStack getUndergroundOil(World aWorld, int aX, int aZ) { - - - Random tRandom = new Random((aWorld.getSeed() + (aX / 96) + (7 * (aZ / 96)))); - int oil = tRandom.nextInt(3); + Random tRandom = new Random((aWorld.getSeed() + (aX / 6) + (7 * (aZ / 6)))); + int oil = tRandom.nextInt(4); double amount = tRandom.nextInt(50) + tRandom.nextDouble(); - oil = tRandom.nextInt(4); -// System.out.println("Oil: "+(aX/96)+" "+(aZ/96)+" "+oil+" "+amount); +// System.out.println("Oil: "+(aX/6)+" "+(aZ/6)+" "+oil+" "+amount); // amount = 40; Fluid tFluid = null; switch (oil) { @@ -1542,16 +1539,16 @@ public class GT_Utility { tFluid = Materials.Oil.mFluid; } int tAmount = (int) (Math.pow(amount, 5) / 100); - ChunkPosition tPos = new ChunkPosition(aX/16, 1, aZ/16); - int[] tInts = new int[2]; + ChunkPosition tPos = new ChunkPosition(aX, 1, aZ); + int[] tInts = {0,0}; if(GT_Proxy.chunkData.containsKey(tPos)){ tInts = GT_Proxy.chunkData.get(tPos); - if(tInts.length>0){ - if(tInts[0]>=0){tAmount = tInts[0];} - } + if(tInts.length>0){ + if(tInts[0]>=0) tAmount = tInts[0]; + } GT_Proxy.chunkData.remove(tPos); } - tAmount = tAmount - 5; + tAmount = tAmount - 5>=0?tAmount-5:0; tInts[0] = tAmount; GT_Proxy.chunkData.put(tPos, tInts); @@ -1747,7 +1744,7 @@ public class GT_Utility { } } if (aPlayer.capabilities.isCreativeMode&>_Values.D1) { - FluidStack tFluid = getUndergroundOil(aWorld, aX, aZ); + FluidStack tFluid = getUndergroundOil(aWorld, aX>>4, aZ>>4); tList.add(EnumChatFormatting.GOLD+"Oil"+EnumChatFormatting.RESET+" in Chunk: " +EnumChatFormatting.YELLOW+ tFluid.amount + " " + tFluid.getLocalizedName()+EnumChatFormatting.RESET); } // if(aPlayer.capabilities.isCreativeMode){ |