diff options
| author | Muramasa- <haydenkilloh@gmail.com> | 2016-09-20 17:03:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-20 17:03:18 +0100 |
| commit | 8f2e13681b91a6e531ee9c199cbf78be077e6381 (patch) | |
| tree | e59861327c07b8a4f63632d0c57afc4b4f274d6c /src/main/java/gregtech/api/util/GT_Utility.java | |
| parent | a03fc7fc1dcc57168e567fbdd09afdd895ce2570 (diff) | |
| parent | 312141cd1096a19d07aa0a5186cd3e7eeee51a9d (diff) | |
| download | GT5-Unofficial-8f2e13681b91a6e531ee9c199cbf78be077e6381.tar.gz GT5-Unofficial-8f2e13681b91a6e531ee9c199cbf78be077e6381.tar.bz2 GT5-Unofficial-8f2e13681b91a6e531ee9c199cbf78be077e6381.zip | |
Merge pull request #632 from Muramasa-/Bugfixes
Various Bugfixes
Diffstat (limited to 'src/main/java/gregtech/api/util/GT_Utility.java')
| -rw-r--r-- | src/main/java/gregtech/api/util/GT_Utility.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 309dc47889..34ef3d0963 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -920,7 +920,7 @@ public class GT_Utility { } public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, double aX, double aY, double aZ) { - return doSoundAtClient(aSoundName, aTimeUntilNextSound, aSoundStrength, 0.9F + new Random().nextFloat() * 0.2F, aX, aY, aZ); + return doSoundAtClient(aSoundName, aTimeUntilNextSound, aSoundStrength, 1.01818028F, aX, aY, aZ); } public static boolean doSoundAtClient(String aSoundName, int aTimeUntilNextSound, float aSoundStrength, float aSoundModulation, double aX, double aY, double aZ) { @@ -1094,7 +1094,6 @@ public class GT_Utility { * Converts a Number to a String */ public static String parseNumberToString(int aNumber) { - String tString = E; boolean temp = true, negative = false; if (aNumber < 0) { @@ -1102,15 +1101,18 @@ public class GT_Utility { negative = true; } + StringBuilder tStringB = new StringBuilder(); for (int i = 1000000000; i > 0; i /= 10) { int tDigit = (aNumber / i) % 10; if (temp && tDigit != 0) temp = false; if (!temp) { - tString += tDigit; - if (i != 1) for (int j = i; j > 0; j /= 1000) if (j == 1) tString += ","; + tStringB.append(tDigit); + if (i != 1) for (int j = i; j > 0; j /= 1000) if (j == 1) tStringB.append(","); } } + String tString = tStringB.toString(); + if (tString.equals(E)) tString = "0"; return negative ? "-" + tString : tString; @@ -1409,7 +1411,7 @@ public class GT_Utility { Collections.sort(tEntrySet, new Comparator<Map.Entry<X, Y>>() { @Override public int compare(Entry<X, Y> aValue1, Entry<X, Y> aValue2) { - return -aValue1.getValue().compareTo(aValue2.getValue()); + return aValue2.getValue().compareTo(aValue1.getValue());//FB: RV - RV_NEGATING_RESULT_OF_COMPARETO } }); LinkedHashMap<X, Y> rMap = new LinkedHashMap<X, Y>(); @@ -1721,10 +1723,11 @@ public class GT_Utility { + " Humidity: " + ((ic2.api.crops.ICropTile) tTileEntity).getHumidity() + " Air-Quality: " + ((ic2.api.crops.ICropTile) tTileEntity).getAirQuality() ); - String tString = E; + StringBuilder tStringB = new StringBuilder(); for (String tAttribute : ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile) tTileEntity).getID()].attributes()) { - tString += ", " + tAttribute; + tStringB.append(", ").append(tAttribute); } + String tString = tStringB.toString(); tList.add("Attributes:" + tString.replaceFirst(",", E)); tList.add("Discovered by: " + ic2.api.crops.Crops.instance.getCropList()[((ic2.api.crops.ICropTile) tTileEntity).getID()].discoveredBy()); } |
