Search in sources :

Example 6 with ItemInstance

use of net.minecraft.item.ItemInstance in project StationAPI by ModificationStation.

the class TagBlockInit method addBlock0Damage.

private static void addBlock0Damage(String oreDictString, BlockBase itemBase) {
    ItemInstance itemInstanceToUse = new ItemInstance(itemBase, 1, 0);
    TagRegistry.INSTANCE.register(new TagEntry(itemInstanceToUse, itemInstanceToUse::isDamageAndIDIdentical, Identifier.of(oreDictString)));
}
Also used : TagEntry(net.modificationstation.stationapi.api.tags.TagEntry) ItemInstance(net.minecraft.item.ItemInstance)

Example 7 with ItemInstance

use of net.minecraft.item.ItemInstance in project StationAPI by ModificationStation.

the class TagItemInit method addItem.

private static void addItem(String oreDictString, ItemBase itemBase, int damage) {
    ItemInstance itemInstanceToUse = new ItemInstance(itemBase, 1, damage);
    TagRegistry.INSTANCE.register(new TagEntry(new ItemInstance(itemBase, 1, damage), itemInstanceToUse::isDamageAndIDIdentical, Identifier.of(oreDictString)));
}
Also used : TagEntry(net.modificationstation.stationapi.api.tags.TagEntry) ItemInstance(net.minecraft.item.ItemInstance)

Example 8 with ItemInstance

use of net.minecraft.item.ItemInstance in project StationAPI by ModificationStation.

the class TagItemInit method addItemIgnoreDamage.

private static void addItemIgnoreDamage(String oreDictString, ItemBase itemBase) {
    ItemInstance itemInstanceToUse = new ItemInstance(itemBase);
    TagRegistry.INSTANCE.register(new TagEntry(new ItemInstance(itemBase), itemInstance -> itemInstanceToUse.itemId == itemInstance.itemId, Identifier.of(oreDictString)));
}
Also used : EventListener(net.mine_diver.unsafeevents.listener.EventListener) ItemBase(net.minecraft.item.ItemBase) ListenerPriority(net.mine_diver.unsafeevents.listener.ListenerPriority) EventBusPolicy(net.modificationstation.stationapi.api.mod.entrypoint.EventBusPolicy) LOGGER(net.modificationstation.stationapi.api.StationAPI.LOGGER) TagRegistry(net.modificationstation.stationapi.api.tags.TagRegistry) Entrypoint(net.modificationstation.stationapi.api.mod.entrypoint.Entrypoint) Identifier(net.modificationstation.stationapi.api.registry.Identifier) ItemInstance(net.minecraft.item.ItemInstance) TagRegisterEvent(net.modificationstation.stationapi.api.event.tags.TagRegisterEvent) TagEntry(net.modificationstation.stationapi.api.tags.TagEntry) TagEntry(net.modificationstation.stationapi.api.tags.TagEntry) ItemInstance(net.minecraft.item.ItemInstance)

Example 9 with ItemInstance

use of net.minecraft.item.ItemInstance in project StationAPI by ModificationStation.

the class TagBlockInit method addBlockIgnoreDamage.

private static void addBlockIgnoreDamage(String oreDictString, BlockBase itemBase) {
    ItemInstance itemInstanceToUse = new ItemInstance(itemBase);
    TagRegistry.INSTANCE.register(new TagEntry(new ItemInstance(itemBase), itemInstance -> itemInstanceToUse.itemId == itemInstance.itemId, Identifier.of(oreDictString)));
}
Also used : EventListener(net.mine_diver.unsafeevents.listener.EventListener) ListenerPriority(net.mine_diver.unsafeevents.listener.ListenerPriority) EventBusPolicy(net.modificationstation.stationapi.api.mod.entrypoint.EventBusPolicy) LOGGER(net.modificationstation.stationapi.api.StationAPI.LOGGER) TagRegistry(net.modificationstation.stationapi.api.tags.TagRegistry) Entrypoint(net.modificationstation.stationapi.api.mod.entrypoint.Entrypoint) Identifier(net.modificationstation.stationapi.api.registry.Identifier) ItemInstance(net.minecraft.item.ItemInstance) BlockBase(net.minecraft.block.BlockBase) TagRegisterEvent(net.modificationstation.stationapi.api.event.tags.TagRegisterEvent) TagEntry(net.modificationstation.stationapi.api.tags.TagEntry) TagEntry(net.modificationstation.stationapi.api.tags.TagEntry) ItemInstance(net.minecraft.item.ItemInstance)

Example 10 with ItemInstance

use of net.minecraft.item.ItemInstance in project StationAPI by ModificationStation.

the class TagBlockInit method addBlock.

private static void addBlock(String oreDictString, BlockBase itemBase, int damage) {
    ItemInstance itemInstanceToUse = new ItemInstance(itemBase, 1, damage);
    TagRegistry.INSTANCE.register(new TagEntry(new ItemInstance(itemBase, 1, damage), itemInstanceToUse::isDamageAndIDIdentical, Identifier.of(oreDictString)));
}
Also used : TagEntry(net.modificationstation.stationapi.api.tags.TagEntry) ItemInstance(net.minecraft.item.ItemInstance)

Aggregations

ItemInstance (net.minecraft.item.ItemInstance)12 TagEntry (net.modificationstation.stationapi.api.tags.TagEntry)6 EventListener (net.mine_diver.unsafeevents.listener.EventListener)3 ListenerPriority (net.mine_diver.unsafeevents.listener.ListenerPriority)2 LOGGER (net.modificationstation.stationapi.api.StationAPI.LOGGER)2 TagRegisterEvent (net.modificationstation.stationapi.api.event.tags.TagRegisterEvent)2 Entrypoint (net.modificationstation.stationapi.api.mod.entrypoint.Entrypoint)2 EventBusPolicy (net.modificationstation.stationapi.api.mod.entrypoint.EventBusPolicy)2 Identifier (net.modificationstation.stationapi.api.registry.Identifier)2 TagRegistry (net.modificationstation.stationapi.api.tags.TagRegistry)2 BlockBase (net.minecraft.block.BlockBase)1 Slot (net.minecraft.container.slot.Slot)1 ItemBase (net.minecraft.item.ItemBase)1 CompoundTag (net.minecraft.util.io.CompoundTag)1 ListTag (net.minecraft.util.io.ListTag)1 Frozen (net.modificationstation.sltest.util.Frozen)1 TemplateItemBase (net.modificationstation.stationapi.api.template.item.TemplateItemBase)1