use of net.minecraft.item.ItemInstance in project StationAPI by ModificationStation.
the class TagItemInit method addItem0Damage.
private static void addItem0Damage(String oreDictString, ItemBase itemBase) {
ItemInstance itemInstanceToUse = new ItemInstance(itemBase, 1, 0);
TagRegistry.INSTANCE.register(new TagEntry(itemInstanceToUse, itemInstanceToUse::isDamageAndIDIdentical, Identifier.of(oreDictString)));
}
use of net.minecraft.item.ItemInstance in project StationAPI by ModificationStation.
the class TileEntityFreezer method readIdentifyingData.
@Override
public void readIdentifyingData(CompoundTag nbttagcompound) {
super.readIdentifyingData(nbttagcompound);
ListTag nbttaglist = nbttagcompound.getListTag("Items");
frozenItemStacks = new ItemInstance[getInventorySize()];
for (int i = 0; i < nbttaglist.size(); i++) {
CompoundTag nbttagcompound1 = (CompoundTag) nbttaglist.get(i);
byte byte0 = nbttagcompound1.getByte("Slot");
if (byte0 >= 0 && byte0 < frozenItemStacks.length) {
frozenItemStacks[byte0] = new ItemInstance(nbttagcompound1);
}
}
frozenProgress = nbttagcompound.getShort("BurnTime");
frozenTimeForItem = nbttagcompound.getShort("CookTime");
}
Aggregations