diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-03-08 03:14:13 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-03-08 03:14:13 +0000 |
commit | 064c0dc0cfab1cc677dfffc4b3b56642017e412b (patch) | |
tree | 4ca26291abe64632a63bc0d72a510079a1766d7f /src/Java/gtPlusPlus/core/util/data | |
parent | 5ec18de508e12da48c68ef679f6b8646f12cb0c2 (diff) | |
download | GT5-Unofficial-064c0dc0cfab1cc677dfffc4b3b56642017e412b.tar.gz GT5-Unofficial-064c0dc0cfab1cc677dfffc4b3b56642017e412b.tar.bz2 GT5-Unofficial-064c0dc0cfab1cc677dfffc4b3b56642017e412b.zip |
+ Added some AgriChem. (You can now use Raw waste as a fuel source)
+ Added OreDict names to vanilla items, as was done in Forge 1.8.9.
+ Added functions to allow other mods to add Semifluid Fuels.
+ Added functions to handle String data into StringUtils.java.
% Renamed getItemStack -> getItemStackFromFQRN.
$ Fixed handling of custom cells for fluids using '.' within their names.
$ Fixed HF exploit.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util/data')
-rw-r--r-- | src/Java/gtPlusPlus/core/util/data/StringUtils.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/util/data/StringUtils.java b/src/Java/gtPlusPlus/core/util/data/StringUtils.java index b64266b5d4..2821a0c1c9 100644 --- a/src/Java/gtPlusPlus/core/util/data/StringUtils.java +++ b/src/Java/gtPlusPlus/core/util/data/StringUtils.java @@ -1,5 +1,7 @@ package gtPlusPlus.core.util.data; +import gtPlusPlus.api.objects.data.AutoMap; + public class StringUtils { public static String superscript(String str) { @@ -131,4 +133,42 @@ public class StringUtils { return aData; } } + + public static String splitAndUppercase(String aInput, String aDelim) { + String[] aSplit = aInput.split(aDelim); + if (aSplit == null || aSplit.length == 0) { + return aInput; + } + else { + AutoMap<String> aTemp = new AutoMap<String>(); + for (String s : aSplit) { + aTemp.put(firstLetterCaps(s)); + } + String aReturn = ""; + for (String s : aTemp) { + aReturn += s; + } + return aReturn; + } + } + + public static int characterCount(String aString, char aChar) { + return characterCount(aString, ""+aChar); + } + + public static int characterCount(String aString, String aChar) { + int aLength = aString.length(); + int aFound = 0; + if (aLength == 0 || !aString.contains(aChar)) { + return 0; + } + else { + for (int index = 0; index < aLength; index++) { + if (aString.substring(index, index+1).equals(aChar)) { + aFound++; + } + } + return aFound; + } + } } |