Search in sources :

Example 91 with ModelResourceLocation

use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Bewitchment by Um-Mitternacht.

the class ItemBroom method registerModel.

@Override
public void registerModel() {
    for (int i = 0; i < EnumSaplingType.values().length + 1; i++) {
        String ext = i == 0 ? "mundane" : EnumSaplingType.values()[i - 1].getName();
        ModelResourceLocation modelResourceLocation = new ModelResourceLocation(this.getRegistryName() + "_" + ext, "inventory");
        ModelLoader.setCustomModelResourceLocation(this, i, modelResourceLocation);
    }
}
Also used : ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation)

Example 92 with ModelResourceLocation

use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Bewitchment by Um-Mitternacht.

the class ModelHandler method registerModel.

public static <T extends Enum<T> & IStringSerializable> void registerModel(Item item, Class<T> clazz) {
    for (T t : clazz.getEnumConstants()) {
        ResourceLocation location = new ResourceLocation(item.getRegistryName() + "_" + t.getName());
        ModelResourceLocation modelResourceLocation = new ModelResourceLocation(location, "inventory");
        ModelLoader.setCustomModelResourceLocation(item, t.ordinal(), modelResourceLocation);
    }
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation)

Example 93 with ModelResourceLocation

use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Bewitchment by Um-Mitternacht.

the class ModelHandler method registerModel.

public static void registerModel(Item item, int meta) {
    ModelResourceLocation modelResourceLocation = new ModelResourceLocation(item.getRegistryName(), "inventory");
    ModelLoader.setCustomModelResourceLocation(item, meta, modelResourceLocation);
}
Also used : ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation)

Example 94 with ModelResourceLocation

use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Bewitchment by Um-Mitternacht.

the class ItemGemPowder method registerModel.

@Override
@SideOnly(Side.CLIENT)
public void registerModel() {
    for (int i = 0; i < names.length; i++) {
        ResourceLocation rl = new ResourceLocation(this.getRegistryName().getResourceDomain(), "powders/" + this.getRegistryName().getResourcePath() + "_" + names[i]);
        ModelResourceLocation mrl = new ModelResourceLocation(rl, "inventory");
        ModelLoader.setCustomModelResourceLocation(this, i, mrl);
    }
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 95 with ModelResourceLocation

use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Bewitchment by Um-Mitternacht.

the class BlockBarrel method registerModel.

@Override
public void registerModel() {
    for (WoodType wt : WoodType.values()) {
        ModelResourceLocation modelResourceLocation = new ModelResourceLocation(this.getRegistryName() + "_" + wt.getName(), "inventory");
        ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), wt.ordinal(), modelResourceLocation);
    }
}
Also used : ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation)

Aggregations

ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)320 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)129 ResourceLocation (net.minecraft.util.ResourceLocation)101 Item (net.minecraft.item.Item)55 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)52 IBlockState (net.minecraft.block.state.IBlockState)48 IBakedModel (net.minecraft.client.renderer.block.model.IBakedModel)26 ArrayList (java.util.ArrayList)25 Block (net.minecraft.block.Block)21 StateMapperBase (net.minecraft.client.renderer.block.statemap.StateMapperBase)20 ItemStack (net.minecraft.item.ItemStack)16 EnumFacing (net.minecraft.util.EnumFacing)13 Map (java.util.Map)12 ItemMeshDefinition (net.minecraft.client.renderer.ItemMeshDefinition)11 IModel (net.minecraftforge.client.model.IModel)11 Nonnull (javax.annotation.Nonnull)10 IProperty (net.minecraft.block.properties.IProperty)9 Side (net.minecraftforge.fml.relauncher.Side)9 DefaultStateMapper (net.minecraft.client.renderer.block.statemap.DefaultStateMapper)8 RenderItem (net.minecraft.client.renderer.RenderItem)7