Search in sources :

Example 1 with ModSpawnEggItem

use of logictechcorp.libraryex.item.ModSpawnEggItem in project NetherEx by LogicTechCorp.

the class NetherEx method onRegisterItemColor.

@OnlyIn(Dist.CLIENT)
private void onRegisterItemColor(ColorHandlerEvent.Item event) {
    ItemColors colors = event.getItemColors();
    NetherExItems.getItems().forEach(registryObject -> {
        registryObject.ifPresent(item -> {
            if (item instanceof ModSpawnEggItem) {
                colors.register((color, index) -> ((ModSpawnEggItem) item).getColor(index), item);
            }
        });
    });
}
Also used : ItemColors(net.minecraft.client.renderer.color.ItemColors) ModSpawnEggItem(logictechcorp.libraryex.item.ModSpawnEggItem) OnlyIn(net.minecraftforge.api.distmarker.OnlyIn)

Aggregations

ModSpawnEggItem (logictechcorp.libraryex.item.ModSpawnEggItem)1 ItemColors (net.minecraft.client.renderer.color.ItemColors)1 OnlyIn (net.minecraftforge.api.distmarker.OnlyIn)1