Search in sources :

Example 6 with TagEntry

use of net.modificationstation.stationapi.api.tags.TagEntry 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)

Example 7 with TagEntry

use of net.modificationstation.stationapi.api.tags.TagEntry 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)));
}
Also used : TagEntry(net.modificationstation.stationapi.api.tags.TagEntry) ItemInstance(net.minecraft.item.ItemInstance)

Aggregations

TagEntry (net.modificationstation.stationapi.api.tags.TagEntry)7 ItemInstance (net.minecraft.item.ItemInstance)6 EventListener (net.mine_diver.unsafeevents.listener.EventListener)3 Identifier (net.modificationstation.stationapi.api.registry.Identifier)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 TagRegistry (net.modificationstation.stationapi.api.tags.TagRegistry)2 BlockBase (net.minecraft.block.BlockBase)1 ItemBase (net.minecraft.item.ItemBase)1