Search in sources :

Example 1 with ItemIEBase

use of blusunrize.immersiveengineering.common.items.ItemIEBase in project ImmersiveEngineering by BluSunrize.

the class ImmersiveModelRegistry method registerCustomItemModel.

public void registerCustomItemModel(ItemStack stack, ItemModelReplacement replacement) {
    if (stack.getItem() instanceof ItemIEBase) {
        ResourceLocation loc;
        if (((ItemIEBase) stack.getItem()).getSubNames() != null && ((ItemIEBase) stack.getItem()).getSubNames().length > 0)
            loc = new ResourceLocation("immersiveengineering", ((ItemIEBase) stack.getItem()).itemName + "/" + ((ItemIEBase) stack.getItem()).getSubNames()[stack.getItemDamage()]);
        else
            loc = new ResourceLocation("immersiveengineering", ((ItemIEBase) stack.getItem()).itemName);
        itemModelReplacements.put(new ModelResourceLocation(loc, "inventory"), replacement);
    }
}
Also used : ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ItemIEBase(blusunrize.immersiveengineering.common.items.ItemIEBase)

Aggregations

ItemIEBase (blusunrize.immersiveengineering.common.items.ItemIEBase)1 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)1 ResourceLocation (net.minecraft.util.ResourceLocation)1