Search in sources :

Example 1 with TemplateItemBase

use of net.modificationstation.stationapi.api.template.item.TemplateItemBase in project StationAPI by ModificationStation.

the class ItemListener method registerItems.

@EventListener
public void registerItems(ItemRegistryEvent event) {
    // 8475
    testItem = new ModdedItem(of(MODID, "test_item")).setTranslationKey(MODID, "testItem");
    testMaterial = ToolMaterialFactory.create("testMaterial", 3, Integer.MAX_VALUE, Float.MAX_VALUE, Integer.MAX_VALUE - 2);
    // 8476
    testPickaxe = new ModdedPickaxe(of(MODID, "test_pickaxe"), testMaterial).setTranslationKey(MODID, "testPickaxe");
    // 8477
    testNBTItem = new NBTItem(of(MODID, "nbt_item")).setTranslationKey(MODID, "nbt_item");
    testModelItem = new ModelItem(of(MODID, "model_item")).setMaxStackSize(1).setTranslationKey(MODID, "idkSomething");
    ironOre = new TemplateItemBase(Identifier.of(MODID, "ironOre")).setTranslationKey(MODID, "ironOre");
    TagRegistry.INSTANCE.register(Identifier.of("blocks/ores/iron"), new ItemInstance(ironOre), e -> ironOre.id == e.itemId);
    TagRegistry.INSTANCE.register(Identifier.of("items/tools/pickaxes/testpickaxe"), new ItemInstance(testPickaxe), (e) -> e.itemId == testPickaxe.id);
}
Also used : TemplateItemBase(net.modificationstation.stationapi.api.template.item.TemplateItemBase) ItemInstance(net.minecraft.item.ItemInstance) EventListener(net.mine_diver.unsafeevents.listener.EventListener)

Aggregations

EventListener (net.mine_diver.unsafeevents.listener.EventListener)1 ItemInstance (net.minecraft.item.ItemInstance)1 TemplateItemBase (net.modificationstation.stationapi.api.template.item.TemplateItemBase)1