I - The type of the item (e.g. Integer)S - The type of the item stack (e.g. LegacyItemStack)public abstract class AItemStack<I,S extends AItemStack<I,S>>
extends java.lang.Object
implements net.lenni0451.mcstructs.core.ICopyable<S>
LegacyItemStack which has the damage stored in the item stack itselfItemStack which has the damage stored in the item stack's Nbt data| Constructor and Description |
|---|
AItemStack(ItemRegistry<I,S> registry,
I item) |
| Modifier and Type | Method and Description |
|---|---|
S |
copy() |
net.lenni0451.mcstructs.nbt.tags.CompoundTag |
copyTag() |
abstract boolean |
equals(java.lang.Object other) |
int |
getCount() |
java.lang.String |
getCustomName() |
abstract int |
getDamage() |
I |
getItem() |
ItemMeta |
getMeta() |
net.lenni0451.mcstructs.nbt.tags.CompoundTag |
getOrCreateTag()
Get or create a new Nbt tag for this item stack.
|
ItemRegistry<I,S> |
getRegistry() |
int |
getRepairCost() |
net.lenni0451.mcstructs.nbt.tags.CompoundTag |
getTag() |
boolean |
hasCustomName() |
abstract int |
hashCode() |
boolean |
hasTag() |
boolean |
isEmpty() |
void |
removeCustomName()
Remove the custom name of this item stack.
|
void |
setCount(int count)
Set the count of this item stack.
|
void |
setCustomName(java.lang.String name)
Set the custom name of this item stack.
|
abstract void |
setDamage(int damage)
Set the damage of this item stack.
|
void |
setRepairCost(int cost)
Set the repair cost of this item stack.
|
void |
setTag(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag)
Set the Nbt tag of this item stack.
|
S |
split(int count)
Split an item stack into two stacks.
|
abstract java.lang.String |
toString() |
public AItemStack(@Nonnull
ItemRegistry<I,S> registry,
@Nullable
I item)
public ItemRegistry<I,S> getRegistry()
public ItemMeta getMeta()
@Nullable public I getItem()
public boolean isEmpty()
public int getCount()
public void setCount(int count)
count - The new countpublic abstract int getDamage()
public abstract void setDamage(int damage)
damage - The new damage@Nullable public net.lenni0451.mcstructs.nbt.tags.CompoundTag getTag()
@Nullable public net.lenni0451.mcstructs.nbt.tags.CompoundTag copyTag()
public net.lenni0451.mcstructs.nbt.tags.CompoundTag getOrCreateTag()
public void setTag(net.lenni0451.mcstructs.nbt.tags.CompoundTag tag)
tag - The new Nbt tagpublic boolean hasTag()
public S copy()
copy in interface net.lenni0451.mcstructs.core.ICopyable<S extends AItemStack<I,S>>public S split(int count)
count - The count of the new stackpublic int getRepairCost()
public void setRepairCost(int cost)
cost - The new repair costpublic boolean hasCustomName()
public java.lang.String getCustomName()
public void setCustomName(java.lang.String name)
name - The new custom namepublic void removeCustomName()
public abstract boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic abstract int hashCode()
hashCode in class java.lang.Objectpublic abstract java.lang.String toString()
toString in class java.lang.Object