diff options
author | Jordan Byrne <draknyte1@hotmail.com> | 2018-03-28 21:54:34 +1000 |
---|---|---|
committer | Jordan Byrne <draknyte1@hotmail.com> | 2018-03-28 21:54:34 +1000 |
commit | 634ba57d8239096e36ef23d62c52763e442c2375 (patch) | |
tree | b927b6ec21d475ca6e8ce01696955617eae35ca7 /src/Java/gtPlusPlus/api | |
parent | dfabbe2c18c26725cb03b01746868f087e022732 (diff) | |
download | GT5-Unofficial-634ba57d8239096e36ef23d62c52763e442c2375.tar.gz GT5-Unofficial-634ba57d8239096e36ef23d62c52763e442c2375.tar.bz2 GT5-Unofficial-634ba57d8239096e36ef23d62c52763e442c2375.zip |
$ Rewrote handling for the ABS to dynamically generate all recipes based on all pre-existing EBF recipes.
$ Rewrote ABS recipe handler to support temps within the recipes. This will allow coil upgrades like the EBF for higher tier smelting.
$ Fix Polonium Material trying to access ELEMENT.java instance before it's created.
+ Added ItemStackData.java, which allows storing ItemStacks for easy retrieval.
Diffstat (limited to 'src/Java/gtPlusPlus/api')
-rw-r--r-- | src/Java/gtPlusPlus/api/objects/minecraft/ItemStackData.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/api/objects/minecraft/ItemStackData.java b/src/Java/gtPlusPlus/api/objects/minecraft/ItemStackData.java new file mode 100644 index 0000000000..4fb6b9d8a7 --- /dev/null +++ b/src/Java/gtPlusPlus/api/objects/minecraft/ItemStackData.java @@ -0,0 +1,33 @@ +package gtPlusPlus.api.objects.minecraft; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import gtPlusPlus.core.util.minecraft.ItemUtils; + +public class ItemStackData { + + protected final Item mItem; + protected final int mDamage; + protected final int mStackSize; + protected final NBTTagCompound mNBT; + protected final String mUniqueDataTag; + + public ItemStackData (ItemStack aStack) { + mItem = aStack.getItem(); + mDamage = aStack.getItemDamage(); + mStackSize = aStack.stackSize; + mNBT = (aStack.getTagCompound() != null ? aStack.getTagCompound() : new NBTTagCompound()); + mUniqueDataTag = ""+Item.getIdFromItem(mItem)+""+mDamage+""+mStackSize+""+mNBT.getId(); + } + + public String getUniqueDataIdentifier() { + return this.mUniqueDataTag; + } + + public ItemStack getStack() { + return ItemUtils.simpleMetaStack(mItem, mDamage, mStackSize); + } + +} |