diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-01-20 14:24:34 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-01-20 14:24:34 +1000 |
commit | 869c206c4fcc8001bd2e1d66f704290331813835 (patch) | |
tree | 96735ce8fe4665e2759c3374221d6f06f4527df2 /src/Java/binnie/core/util/UniqueItemStackSet.java | |
parent | ec2c72827f01dd4bb2174137f1ab162f9ddaab62 (diff) | |
download | GT5-Unofficial-869c206c4fcc8001bd2e1d66f704290331813835.tar.gz GT5-Unofficial-869c206c4fcc8001bd2e1d66f704290331813835.tar.bz2 GT5-Unofficial-869c206c4fcc8001bd2e1d66f704290331813835.zip |
Initial Commit
Diffstat (limited to 'src/Java/binnie/core/util/UniqueItemStackSet.java')
-rw-r--r-- | src/Java/binnie/core/util/UniqueItemStackSet.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Java/binnie/core/util/UniqueItemStackSet.java b/src/Java/binnie/core/util/UniqueItemStackSet.java new file mode 100644 index 0000000000..f9571e8fee --- /dev/null +++ b/src/Java/binnie/core/util/UniqueItemStackSet.java @@ -0,0 +1,28 @@ +package binnie.core.util; + +import java.util.List; +import net.minecraft.item.ItemStack; + +public class UniqueItemStackSet + extends ItemStackSet +{ + public boolean add(ItemStack e) + { + if ((e != null) && + (getExisting(e) == null)) { + return this.itemStacks.add(e.copy()); + } + return false; + } + + public boolean remove(Object o) + { + if (contains(o)) + { + ItemStack r = (ItemStack)o; + ItemStack existing = getExisting(r); + this.itemStacks.remove(existing); + } + return false; + } +} |