Search in sources :

Example 16 with ModelResourceLocation

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

the class IRailcraftItemBlock method getModelLocation.

@SideOnly(Side.CLIENT)
default default ModelResourceLocation getModelLocation(IBlockState state) {
    StateMapperBase stateMapper = null;
    if (state.getBlock() instanceof IRailcraftBlock)
        stateMapper = ((IRailcraftBlock) state.getBlock()).getStateMapper();
    if (stateMapper == null)
        return new ModelResourceLocation(state.getBlock().getRegistryName(), new DefaultStateMapper().getPropertyString(state.getProperties()));
    Map<IBlockState, ModelResourceLocation> stateMap = stateMapper.putStateModelLocations(state.getBlock());
    return stateMap.get(state);
}
Also used : StateMapperBase(net.minecraft.client.renderer.block.statemap.StateMapperBase) DefaultStateMapper(net.minecraft.client.renderer.block.statemap.DefaultStateMapper) IBlockState(net.minecraft.block.state.IBlockState) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 17 with ModelResourceLocation

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

the class ModelManager method registerItemModel.

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

Example 18 with ModelResourceLocation

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

the class ModelManager method registerItemModel.

public static void registerItemModel(Item item, int meta, String domain, String json) {
    ModelResourceLocation location = new ModelResourceLocation(new ResourceLocation(domain, json), "inventory");
    registerItemModel(item, meta, location);
}
Also used : ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation)

Example 19 with ModelResourceLocation

use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Overloaded by CJ-MC-Mods.

the class BlockEnergyExtractor method registerModel.

@Override
@SideOnly(Side.CLIENT)
public void registerModel() {
    ModelResourceLocation location = new ModelResourceLocation(getRegistryName(), null);
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, location);
    FacingStateMapper stateMapper = new FacingStateMapper(getRegistryName());
    ModelLoader.setCustomStateMapper(this, stateMapper);
}
Also used : FacingStateMapper(com.cjm721.overloaded.util.FacingStateMapper) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 20 with ModelResourceLocation

use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Overloaded by CJ-MC-Mods.

the class ItemMultiBoots method registerModel.

@SideOnly(Side.CLIENT)
@Override
public void registerModel() {
    ModelResourceLocation location = new ModelResourceLocation(getRegistryName(), null);
    ModelLoader.setCustomModelResourceLocation(this, 0, location);
}
Also used : ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)106 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)44 ResourceLocation (net.minecraft.util.ResourceLocation)31 ArrayList (java.util.ArrayList)20 Item (net.minecraft.item.Item)19 IBlockState (net.minecraft.block.state.IBlockState)10 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)8 Block (net.minecraft.block.Block)7 RenderItem (net.minecraft.client.renderer.RenderItem)7 StateMapperBase (net.minecraft.client.renderer.block.statemap.StateMapperBase)7 Map (java.util.Map)6 ItemMeshDefinition (net.minecraft.client.renderer.ItemMeshDefinition)6 IBakedModel (net.minecraft.client.renderer.block.model.IBakedModel)6 EnumFacing (net.minecraft.util.EnumFacing)6 StateMap (net.minecraft.client.renderer.block.statemap.StateMap)5 ItemStack (net.minecraft.item.ItemStack)4 HashMap (java.util.HashMap)3 BlockFenceGate (net.minecraft.block.BlockFenceGate)3 BlockSlab (net.minecraft.block.BlockSlab)3 BlockWall (net.minecraft.block.BlockWall)3