diff options
author | Wo0kiee <wo0kiejke@gmail.com> | 2018-03-04 14:53:07 +0600 |
---|---|---|
committer | David Vierra <codewarrior@hawaii.rr.com> | 2018-03-22 10:44:02 -1000 |
commit | 3434f90839b6302a8effcd00a9e7c7adfdb9d053 (patch) | |
tree | 0ed07ff1504778d5f89b836658c1ed422f94f3d9 /src/main/java/gregtech | |
parent | 158d67c7397f004cd2dfb1077e6322d7bd9c25b4 (diff) | |
download | GT5-Unofficial-3434f90839b6302a8effcd00a9e7c7adfdb9d053.tar.gz GT5-Unofficial-3434f90839b6302a8effcd00a9e7c7adfdb9d053.tar.bz2 GT5-Unofficial-3434f90839b6302a8effcd00a9e7c7adfdb9d053.zip |
Cleanup
# Conflicts:
#
src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java
Diffstat (limited to 'src/main/java/gregtech')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_Utility.java | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java | 44 |
2 files changed, 17 insertions, 29 deletions
diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 4c78cdee33..7e81cbb8d0 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -2117,7 +2117,7 @@ public class GT_Utility { ArrayList<String> tOilsTransformed = new ArrayList<String>(aOils.size()); for (String aStr : aOils) { String[] aStats = aStr.split(","); - tOilsTransformed.add(aStats[0] + ":" + aStats[1] + "L " + aStats[2]); + tOilsTransformed.add(aStats[0] + ": " + aStats[1] + "L " + aStats[2]); } tNBT.setString("prospection_oils", joinListToString(tOilsTransformed)); diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java index f91be2e4d3..705f76be8e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java @@ -155,42 +155,30 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba int xChunk = (tChunk.xPosition / range) * range - ((tChunk.xPosition < 0 && tChunk.xPosition % range != 0) ? range : 0); int zChunk = (tChunk.zPosition / range) * range - ((tChunk.zPosition < 0 && tChunk.zPosition % range != 0) ? range : 0); - HashMap<Integer, FluidStack> tFluids = new HashMap<>(); - ArrayList<String> minmax = new ArrayList<>(); + ArrayList<Integer> minMaxValue = new ArrayList<>(); + ArrayList<FluidStack> FluidName = new ArrayList<>(); int cInts = 0; try { - for (int x = -1; x < 2; ++x) { - for (int z = -1; z < 2; ++z) { - int min = 1000; - int max = 0; - + for (int z = -1; z <= 1; ++z) { + for (int x = -1; x <= 1; ++x) { for (int i = 0; i < range; i++) { for (int j = 0; j < range; j++) { - tChunk = getBaseMetaTileEntity().getWorld().getChunkFromChunkCoords(xChunk + i + z * 6, zChunk + j + x * 6); + tChunk = getBaseMetaTileEntity().getWorld().getChunkFromChunkCoords(xChunk + i + x * 6, zChunk + j + z * 6); tFluid = undergroundOilReadInformation(tChunk); if (tFluid != null) { - if (max < tFluid.amount) - max = tFluid.amount; - if (min > tFluid.amount) - min = tFluid.amount; - - if (tFluids.containsKey(cInts)) { - if (tFluids.get(cInts).amount < tFluid.amount) - tFluids.get(cInts).amount = tFluid.amount; - } else tFluids.put(cInts, tFluid); + minMaxValue.add(tFluid.amount); + FluidName.add(cInts, tFluid); } } } - cInts++; - minmax.add(min + "-" + max); - } - } + int min = Collections.min(minMaxValue); + int max = Collections.max(minMaxValue); + aOils.add(cInts + 1 + "," + min + "-" + max + "," + FluidName.get(cInts).getLocalizedName()); - int i = 0; - for (Map.Entry<Integer, FluidStack> fl : tFluids.entrySet()) { - aOils.add(i + 1 + "," + minmax.get(i) + "," + fl.getValue().getLocalizedName()); - i++; + minMaxValue.clear(); + cInts++; + } } } catch (Exception e) { @@ -203,7 +191,7 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba // aOils.put(x + "," + z + "," + (tFluid.amount / 5000) + "," + tFluid.getLocalizedName(), tFluid.amount / 5000); //} - private void prospectOres(Map<String, Integer> aNearOres, Map<String, Integer> aMiddleOres, Map<String, Integer> aFarOres) { + private void prospectOres(Map<String, Integer> aNearOres, Map<String, Integer> aMiddleOres, Map<String, Integer> aFarOres) { int tLeftXBound = this.getBaseMetaTileEntity().getXCoord() - radius; int tRightXBound = tLeftXBound + 2*radius; @@ -221,13 +209,13 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba prospectHole(i, k, aMiddleOres); else prospectHole(i, k, aFarOres); - } + } } private void prospectHole(int i, int k, Map<String, Integer> aOres) { String tFoundOre; for (int j = this.getBaseMetaTileEntity().getYCoord(); j > 0; j--) { - tFoundOre = checkForOre(i, j, k); + tFoundOre = checkForOre(i, j, k); if (tFoundOre != null) countOre(aOres, tFoundOre); } |