Search in sources :

Example 46 with ModelResourceLocation

use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project RFToolsDimensions by McJty.

the class DimletEnergyModuleItem method initModel.

@Override
@SideOnly(Side.CLIENT)
public void initModel() {
    ModelResourceLocation[] models = new ModelResourceLocation[3];
    for (int i = 0; i < 3; i++) {
        ResourceLocation registryName = getRegistryName();
        registryName = new ResourceLocation(registryName.getResourceDomain(), registryName.getResourcePath() + i);
        models[i] = new ModelResourceLocation(registryName, "inventory");
        ModelBakery.registerItemVariants(this, models[i]);
    }
    ModelLoader.setCustomMeshDefinition(this, stack -> models[stack.getItemDamage()]);
}
Also used : ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 47 with ModelResourceLocation

use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Gaspunk by Ladysnake.

the class ModItems method registerRenders.

@SideOnly(Side.CLIENT)
@SubscribeEvent
public static void registerRenders(ModelRegistryEvent event) {
    ModelLoader.setCustomModelResourceLocation(EMPTY_SYRINGE, 0, new ModelResourceLocation(new ResourceLocation("pathos:empty_syringe"), "inventory"));
    ModelLoader.setCustomModelResourceLocation(FILLED_SYRINGE, 0, new ModelResourceLocation(new ResourceLocation("pathos:filled_syringe"), "inventory"));
}
Also used : ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 48 with ModelResourceLocation

use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project MorePlanets by SteveKunG.

the class RenderTier4Rocket method updateModel.

private void updateModel() {
    if (this.rocketModel == null) {
        ModelResourceLocation modelResourceLocation = new ModelResourceLocation("moreplanets:tier_4_rocket", "inventory");
        this.rocketModel = (ItemRendererTieredRocket) Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getModelManager().getModel(modelResourceLocation);
    }
}
Also used : ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation)

Example 49 with ModelResourceLocation

use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project SilentGems by SilentChaos512.

the class ItemTipUpgrade method getModels.

@Override
public void getModels(Map<Integer, ModelResourceLocation> models) {
    int i = 0;
    for (String str : NAMES) {
        String name = (SilentGems.RESOURCE_PREFIX + str).toLowerCase();
        models.put(i++, new ModelResourceLocation(name, "inventory"));
    }
}
Also used : ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation)

Example 50 with ModelResourceLocation

use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project SilentGems by SilentChaos512.

the class ToolRenderHelper method getModels.

@Override
public void getModels(Map<Integer, ModelResourceLocation> models) {
    buildModelSet();
    modelSet.forEach(model -> models.put(models.size(), model));
    String prefix = SilentGems.RESOURCE_PREFIX.toLowerCase();
    // Extra models
    int i = models.size();
    modelGooglyEyes = new ModelResourceLocation(prefix + "googlyeyes", "inventory");
    models.put(i++, modelGooglyEyes);
    modelError = new ModelResourceLocation(prefix + "error", "inventory");
    models.put(i++, modelError);
    // Error and broken models.
    for (String str : new String[] { "sword", "dagger", "katana", "machete", "scepter", "tomahawk", "pickaxe", "shovel", "axe", "paxel", "hoe", "sickle", "bow" }) {
        models.put(i++, new ModelResourceLocation(prefix + str + "/_error", "inventory"));
        models.put(i++, new ModelResourceLocation(prefix + str + "/" + str + "_broken", "inventory"));
    }
}
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