diff options
author | Alkalus <draknyte1@hotmail.com> | 2018-01-29 19:14:43 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-29 19:14:43 +1000 |
commit | 0d44c0b8810bda7a6d16b7a3aa27affa28f648f2 (patch) | |
tree | db3ece2aded1ee760c2b91a8b1d6a6300a15abf6 /src/Java/gtPlusPlus/core/util | |
parent | e56eccacee3e865638b0e6f0652d2ff1009c184f (diff) | |
parent | f0b2da3cc57441dc5ef468c33a68788b47f073b2 (diff) | |
download | GT5-Unofficial-0d44c0b8810bda7a6d16b7a3aa27affa28f648f2.tar.gz GT5-Unofficial-0d44c0b8810bda7a6d16b7a3aa27affa28f648f2.tar.bz2 GT5-Unofficial-0d44c0b8810bda7a6d16b7a3aa27affa28f648f2.zip |
Merge pull request #196 from codewarrior0/refactor-check-recipe
$ Rewrite and refactor checkRecipe() for several multiblocks, restore machine sounds
$ Fixes #182.
$ Fixes #183.
$ Fixes #184.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util')
-rw-r--r-- | src/Java/gtPlusPlus/core/util/array/ArrayUtils.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/util/array/ArrayUtils.java b/src/Java/gtPlusPlus/core/util/array/ArrayUtils.java index cd8a1a7fd7..fbab888cbf 100644 --- a/src/Java/gtPlusPlus/core/util/array/ArrayUtils.java +++ b/src/Java/gtPlusPlus/core/util/array/ArrayUtils.java @@ -1,6 +1,11 @@ package gtPlusPlus.core.util.array; +import net.minecraft.item.ItemStack; + +import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; +import java.util.List; public class ArrayUtils { @@ -20,5 +25,10 @@ public class ArrayUtils { return r.get(); }*/ + public static ItemStack[] removeNulls(final ItemStack[] v) { + List<ItemStack> list = new ArrayList<ItemStack>(Arrays.asList(v)); + list.removeAll(Collections.singleton((ItemStack)null)); + return list.toArray(new ItemStack[list.size()]); + } } |