Search in sources :

Example 1 with IModelSupplier

use of gregtech.client.model.IModelSupplier in project GregTech by GregTechCEu.

the class MetaBlocks method registerItemModels.

@SideOnly(Side.CLIENT)
public static void registerItemModels() {
    ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(MACHINE), stack -> MetaTileEntityRenderer.MODEL_LOCATION);
    for (BlockCable cable : CABLES) ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(cable), stack -> CableRenderer.INSTANCE.getModelLocation());
    for (BlockFluidPipe pipe : FLUID_PIPES) ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(pipe), stack -> FluidPipeRenderer.INSTANCE.getModelLocation());
    for (BlockItemPipe pipe : ITEM_PIPES) ModelLoader.setCustomMeshDefinition(Item.getItemFromBlock(pipe), stack -> ItemPipeRenderer.INSTANCE.getModelLocation());
    registerItemModel(BOILER_CASING);
    registerItemModel(BOILER_FIREBOX_CASING);
    registerItemModel(METAL_CASING);
    registerItemModel(TURBINE_CASING);
    registerItemModel(MACHINE_CASING);
    registerItemModel(STEAM_CASING);
    registerItemModel(MULTIBLOCK_CASING);
    registerItemModel(TRANSPARENT_CASING);
    registerItemModel(WIRE_COIL);
    registerItemModel(FUSION_CASING);
    registerItemModel(WARNING_SIGN);
    registerItemModel(HERMETIC_CASING);
    registerItemModel(ASPHALT);
    registerItemModel(STONE_SMOOTH);
    registerItemModel(STONE_COBBLE);
    registerItemModel(STONE_COBBLE_MOSSY);
    registerItemModel(STONE_POLISHED);
    registerItemModel(STONE_BRICKS);
    registerItemModel(STONE_BRICKS_CRACKED);
    registerItemModel(STONE_BRICKS_MOSSY);
    registerItemModel(STONE_CHISELED);
    registerItemModel(STONE_TILED);
    registerItemModel(STONE_TILED_SMALL);
    registerItemModel(STONE_BRICKS_SMALL);
    registerItemModel(STONE_WINDMILL_A);
    registerItemModel(STONE_WINDMILL_B);
    registerItemModel(STONE_BRICKS_SQUARE);
    registerItemModelWithOverride(RUBBER_LOG, ImmutableMap.of(BlockRubberLog.LOG_AXIS, EnumAxis.Y));
    registerItemModel(RUBBER_LEAVES);
    registerItemModel(RUBBER_SAPLING);
    ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RUBBER_SAPLING), 0, new ModelResourceLocation(RUBBER_SAPLING.getRegistryName(), "inventory"));
    registerItemModel(PLANKS);
    COMPRESSED.values().stream().distinct().forEach(IModelSupplier::onModelRegister);
    FRAMES.values().stream().distinct().forEach(IModelSupplier::onModelRegister);
    ORES.forEach(IModelSupplier::onModelRegister);
}
Also used : BlockItemPipe(gregtech.common.pipelike.itempipe.BlockItemPipe) ItemPipeRenderer(gregtech.client.renderer.pipe.ItemPipeRenderer) Item(net.minecraft.item.Item) Materials(gregtech.api.unification.material.Materials) StoneType(gregtech.api.unification.ore.StoneType) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) TileEntityFluidPipe(gregtech.common.pipelike.fluidpipe.tile.TileEntityFluidPipe) IProperty(net.minecraft.block.properties.IProperty) Block(net.minecraft.block.Block) Side(net.minecraftforge.fml.relauncher.Side) ClientProxy(gregtech.client.ClientProxy) SimpleStateMapper(gregtech.client.model.SimpleStateMapper) IModelSupplier(gregtech.client.model.IModelSupplier) FluidPipeRenderer(gregtech.client.renderer.pipe.FluidPipeRenderer) GENERATE_FRAME(gregtech.api.unification.material.info.MaterialFlags.GENERATE_FRAME) Insulation(gregtech.common.pipelike.cable.Insulation) BlockFluidBase(net.minecraftforge.fluids.BlockFluidBase) ImmutableMap(com.google.common.collect.ImmutableMap) Predicate(java.util.function.Predicate) PropertyKey(gregtech.api.unification.material.properties.PropertyKey) Collectors(java.util.stream.Collectors) BlockRubberLeaves(gregtech.common.blocks.wood.BlockRubberLeaves) CableRenderer(gregtech.client.renderer.pipe.CableRenderer) Entry(java.util.Map.Entry) OreDictUnifier(gregtech.api.unification.OreDictUnifier) TileEntityItemPipe(gregtech.common.pipelike.itempipe.tile.TileEntityItemPipe) java.util(java.util) BlockGregPlanks(gregtech.common.blocks.wood.BlockGregPlanks) Blocks(net.minecraft.init.Blocks) BakedModelHandler(gregtech.client.model.modelfactories.BakedModelHandler) MetaTileEntityRenderer(gregtech.client.renderer.handler.MetaTileEntityRenderer) FluidPipeType(gregtech.common.pipelike.fluidpipe.FluidPipeType) BlockRubberLog(gregtech.common.blocks.wood.BlockRubberLog) GameRegistry(net.minecraftforge.fml.common.registry.GameRegistry) BlockRubberSapling(gregtech.common.blocks.wood.BlockRubberSapling) ClientRegistry(net.minecraftforge.fml.client.registry.ClientRegistry) TileEntityCable(gregtech.common.pipelike.cable.tile.TileEntityCable) ItemStack(net.minecraft.item.ItemStack) GregTechAPI(gregtech.api.GregTechAPI) Minecraft(net.minecraft.client.Minecraft) MetaTileEntityTESR(gregtech.client.renderer.handler.MetaTileEntityTESR) ReferenceArrayList(it.unimi.dsi.fastutil.objects.ReferenceArrayList) TileEntityCableTickable(gregtech.common.pipelike.cable.tile.TileEntityCableTickable) BiConsumer(java.util.function.BiConsumer) Material(gregtech.api.unification.material.Material) OrePrefix(gregtech.api.unification.ore.OrePrefix) BlockCable(gregtech.common.pipelike.cable.BlockCable) ModelLoader(net.minecraftforge.client.model.ModelLoader) SideOnly(net.minecraftforge.fml.relauncher.SideOnly) Nonnull(javax.annotation.Nonnull) MetaTileEntityHolder(gregtech.api.metatileentity.MetaTileEntityHolder) TileEntityFluidPipeTickable(gregtech.common.pipelike.fluidpipe.tile.TileEntityFluidPipeTickable) FORCE_GENERATE_BLOCK(gregtech.api.unification.material.info.MaterialFlags.FORCE_GENERATE_BLOCK) Items(net.minecraft.init.Items) ItemPipeType(gregtech.common.pipelike.itempipe.ItemPipeType) BlockFoam(gregtech.common.blocks.foam.BlockFoam) IStateMapper(net.minecraft.client.renderer.block.statemap.IStateMapper) BlockPetrifiedFoam(gregtech.common.blocks.foam.BlockPetrifiedFoam) BlockFluidPipe(gregtech.common.pipelike.fluidpipe.BlockFluidPipe) IBlockState(net.minecraft.block.state.IBlockState) MinecraftForge(net.minecraftforge.common.MinecraftForge) GTValues(gregtech.api.GTValues) StateMapperBase(net.minecraft.client.renderer.block.statemap.StateMapperBase) ResourceLocation(net.minecraft.util.ResourceLocation) EnumAxis(net.minecraft.block.BlockLog.EnumAxis) TileEntityItemPipeTickable(gregtech.common.pipelike.itempipe.tile.TileEntityItemPipeTickable) BlockMachine(gregtech.api.block.machines.BlockMachine) BlockItemPipe(gregtech.common.pipelike.itempipe.BlockItemPipe) BlockFluidPipe(gregtech.common.pipelike.fluidpipe.BlockFluidPipe) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) BlockCable(gregtech.common.pipelike.cable.BlockCable) IModelSupplier(gregtech.client.model.IModelSupplier) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

ImmutableMap (com.google.common.collect.ImmutableMap)1 GTValues (gregtech.api.GTValues)1 GregTechAPI (gregtech.api.GregTechAPI)1 BlockMachine (gregtech.api.block.machines.BlockMachine)1 MetaTileEntityHolder (gregtech.api.metatileentity.MetaTileEntityHolder)1 OreDictUnifier (gregtech.api.unification.OreDictUnifier)1 Material (gregtech.api.unification.material.Material)1 Materials (gregtech.api.unification.material.Materials)1 FORCE_GENERATE_BLOCK (gregtech.api.unification.material.info.MaterialFlags.FORCE_GENERATE_BLOCK)1 GENERATE_FRAME (gregtech.api.unification.material.info.MaterialFlags.GENERATE_FRAME)1 PropertyKey (gregtech.api.unification.material.properties.PropertyKey)1 OrePrefix (gregtech.api.unification.ore.OrePrefix)1 StoneType (gregtech.api.unification.ore.StoneType)1 ClientProxy (gregtech.client.ClientProxy)1 IModelSupplier (gregtech.client.model.IModelSupplier)1 SimpleStateMapper (gregtech.client.model.SimpleStateMapper)1 BakedModelHandler (gregtech.client.model.modelfactories.BakedModelHandler)1 MetaTileEntityRenderer (gregtech.client.renderer.handler.MetaTileEntityRenderer)1 MetaTileEntityTESR (gregtech.client.renderer.handler.MetaTileEntityTESR)1 CableRenderer (gregtech.client.renderer.pipe.CableRenderer)1