diff options
| author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-12-10 09:51:39 +0000 |
|---|---|---|
| committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2021-12-10 09:51:39 +0000 |
| commit | cf938c1ed77f873782e2c2c4869947562236b7b3 (patch) | |
| tree | cc7aa78ef92b263b3d8a4ffaec6c10ee603f889f /src/Java/gtPlusPlus/core/util/data | |
| parent | 8f6560f3c2cfaa36f57d3220a72fbb931fb9324d (diff) | |
| download | GT5-Unofficial-cf938c1ed77f873782e2c2c4869947562236b7b3.tar.gz GT5-Unofficial-cf938c1ed77f873782e2c2c4869947562236b7b3.tar.bz2 GT5-Unofficial-cf938c1ed77f873782e2c2c4869947562236b7b3.zip | |
Added ability to clear all output hatches on GT++ multis with a plunger.
Changed fluid textures for many autogenerated fluids.
Renamed & remapped Cryolite to Cryolite (F).
Fixed toArray() in AutoMap.java.
Fixed Sparging.
Final touches to Nuclear Fuel reprocessing.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util/data')
| -rw-r--r-- | src/Java/gtPlusPlus/core/util/data/ArrayUtils.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java b/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java index c9c8d26744..62f703f5f5 100644 --- a/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java +++ b/src/Java/gtPlusPlus/core/util/data/ArrayUtils.java @@ -26,6 +26,18 @@ public class ArrayUtils { return series; } + public static <V> V[] insertElementAtIndex(V[] aArray, int aIndex, V aObjectToInsert) { + V[] newArray = Arrays.copyOf(aArray, aArray.length + 1); + for (int i=0;i<aIndex;i++) { + newArray[i] = aArray[i]; + } + newArray[aIndex] = aObjectToInsert; + for (int i=(aIndex+1);i<newArray.length;i++) { + newArray[i] = aArray[i-1]; + } + return newArray; + } + /*public static <V> Object getMostCommonElement(List<V> list) { Optional r = list.stream().map(V::getTextureSet).collect(Collectors.groupingBy(Function.identity(), Collectors.counting())).entrySet().stream().max(Map.Entry.comparingByValue()).map(Map.Entry::getKey); return r.get(); |
