Search in sources :

Example 1 with BlockModelEntry

use of forestry.core.models.BlockModelEntry in project ForestryMC by ForestryMC.

the class ProxyGreenhouseClient method initializeModels.

@Override
public void initializeModels() {
    BlockRegistryGreenhouse blocks = ModuleGreenhouse.getBlocks();
    Preconditions.checkState(blocks != null);
    ModelManager modelManager = ModelManager.getInstance();
    Block greenhouseBlock = blocks.greenhouseBlock;
    if (greenhouseBlock != null) {
        ModelResourceLocation blockModelLocation = new ModelResourceLocation("forestry:greenhouse");
        ModelResourceLocation itemModelLocation = new ModelResourceLocation("forestry:greenhouse", "inventory");
        BlockModelEntry blockModelIndex = new BlockModelEntry(blockModelLocation, itemModelLocation, new ModelCamouflaged(BlockGreenhouse.class), greenhouseBlock);
        modelManager.registerCustomBlockModel(blockModelIndex);
    }
    Block climatiserBlock = blocks.climatiserBlock;
    if (climatiserBlock != null) {
        ModelResourceLocation blockModelLocation = new ModelResourceLocation("forestry:climatiser");
        ModelResourceLocation itemModelLocation = new ModelResourceLocation("forestry:climatiser", "inventory");
        BlockModelEntry blockModelIndex = new BlockModelEntry(blockModelLocation, itemModelLocation, new ModelCamouflaged(BlockClimatiser.class), climatiserBlock);
        modelManager.registerCustomBlockModel(blockModelIndex);
    }
    {
        ModelResourceLocation blockModelLocation = new ModelResourceLocation("forestry:greenhouse.window");
        ModelResourceLocation itemModelLocation = new ModelResourceLocation("forestry:greenhouse_window", "inventory");
        BlockModelEntry blockModelIndex = new BlockModelEntry(blockModelLocation, itemModelLocation, new ModelGreenhouseWindow(), ModuleGreenhouse.getBlocks().window);
        modelManager.registerCustomBlockModel(blockModelIndex);
    }
    {
        ModelResourceLocation blockModelLocation = new ModelResourceLocation("forestry:greenhouse.window_up");
        ModelResourceLocation itemModelLocation = new ModelResourceLocation("forestry:greenhouse_window_up", "inventory");
        BlockModelEntry blockModelIndex = new BlockModelEntry(blockModelLocation, itemModelLocation, new ModelGreenhouseWindow(), ModuleGreenhouse.getBlocks().roofWindow);
        modelManager.registerCustomBlockModel(blockModelIndex);
    }
    {
        ModelResourceLocation modelLocation = new ModelResourceLocation("forestry:camouflage_spray_can", "inventory");
        ModelEntry itemModelIndex = new ModelEntry(modelLocation, new ModelCamouflageSprayCan());
        modelManager.registerCustomModel(itemModelIndex);
    }
}
Also used : ModelEntry(forestry.core.models.ModelEntry) BlockModelEntry(forestry.core.models.BlockModelEntry) BlockModelEntry(forestry.core.models.BlockModelEntry) ModelCamouflaged(forestry.greenhouse.models.ModelCamouflaged) BlockClimatiser(forestry.greenhouse.blocks.BlockClimatiser) ModelCamouflageSprayCan(forestry.greenhouse.models.ModelCamouflageSprayCan) BlockGreenhouse(forestry.greenhouse.blocks.BlockGreenhouse) Block(net.minecraft.block.Block) IGreenhouseBlock(forestry.greenhouse.api.greenhouse.IGreenhouseBlock) BlockRegistryGreenhouse(forestry.greenhouse.blocks.BlockRegistryGreenhouse) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ModelManager(forestry.core.models.ModelManager) ModelGreenhouseWindow(forestry.greenhouse.models.ModelGreenhouseWindow)

Example 2 with BlockModelEntry

use of forestry.core.models.BlockModelEntry in project Binnie by ForestryMC.

the class BlockCeramicBrick method registerStateMapper.

@SideOnly(Side.CLIENT)
@Override
public void registerStateMapper() {
    ResourceLocation resourceLocation = new ResourceLocation(Constants.BOTANY_MOD_ID, "ceramicBrick");
    ModelLoader.setCustomStateMapper(this, new DefaultStateMapper(resourceLocation));
    ModelManager.registerCustomBlockModel(new BlockModelEntry(new ModelResourceLocation(resourceLocation, "normal"), new ModelResourceLocation(resourceLocation, "inventory"), new ModelMutlipass<>(BlockCeramicBrick.class), this));
}
Also used : DefaultStateMapper(binnie.core.models.DefaultStateMapper) BlockModelEntry(forestry.core.models.BlockModelEntry) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) ModelMutlipass(binnie.core.models.ModelMutlipass) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 3 with BlockModelEntry

use of forestry.core.models.BlockModelEntry in project Binnie by ForestryMC.

the class ModelManager method registerCustomModels.

public static void registerCustomModels(ModelBakeEvent event) {
    IRegistry<ModelResourceLocation, IBakedModel> registry = event.getModelRegistry();
    for (final BlockModelEntry entry : customBlockModels) {
        registry.putObject(entry.blockModelLocation, entry.model);
        if (entry.itemModelLocation != null) {
            registry.putObject(entry.itemModelLocation, entry.model);
        }
    }
    IModelState defaultBlockState = ModelUtil.loadModelState(new ResourceLocation("minecraft:models/block/block"));
    IModelState defaultFenceState = ModelUtil.loadModelState(new ResourceLocation("minecraft:models/block/fence_inventory"));
    ModelManager.defaultFenceState = mergeStates(defaultBlockState, defaultFenceState);
}
Also used : BlockModelEntry(forestry.core.models.BlockModelEntry) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) IModelState(net.minecraftforge.common.model.IModelState) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) IBakedModel(net.minecraft.client.renderer.block.model.IBakedModel)

Example 4 with BlockModelEntry

use of forestry.core.models.BlockModelEntry in project Binnie by ForestryMC.

the class ProxyClient method registerModels.

@Override
public void registerModels() {
    for (BlockETDecorativeLeaves leaves : ModuleWood.leavesDecorative) {
        String resourceName = leaves.getRegistryName().toString();
        ModelResourceLocation blockModelLocation = new ModelResourceLocation(resourceName);
        ModelResourceLocation itemModeLocation = new ModelResourceLocation(resourceName, "inventory");
        BlockModelEntry blockModelIndex = new BlockModelEntry(blockModelLocation, itemModeLocation, new ModelETDecorativeLeaves(), leaves);
        registerBlockModel(blockModelIndex);
    }
    for (BlockETDefaultLeaves leaves : ModuleWood.leavesDefault) {
        String resourceName = leaves.getRegistryName().toString();
        ModelResourceLocation blockModelLocation = new ModelResourceLocation(resourceName);
        ModelResourceLocation itemModeLocation = new ModelResourceLocation(resourceName, "inventory");
        BlockModelEntry blockModelIndex = new BlockModelEntry(blockModelLocation, itemModeLocation, new ModelDefaultETLeaves(), leaves);
        registerBlockModel(blockModelIndex);
    }
    for (BlockETSlab slab : ModuleWood.slabsDouble) {
        ModuleArboriculture.proxy.registerWoodModel(slab, true);
    }
    for (BlockETSlab slab : ModuleWood.slabsDoubleFireproof) {
        ModuleArboriculture.proxy.registerWoodModel(slab, true);
    }
    modelManager.registerModels();
}
Also used : ModelDefaultETLeaves(binnie.extratrees.models.ModelDefaultETLeaves) BlockModelEntry(forestry.core.models.BlockModelEntry) BlockETSlab(binnie.extratrees.blocks.wood.BlockETSlab) BlockETDecorativeLeaves(binnie.extratrees.blocks.BlockETDecorativeLeaves) ModelETDecorativeLeaves(binnie.extratrees.models.ModelETDecorativeLeaves) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) BlockETDefaultLeaves(binnie.extratrees.blocks.BlockETDefaultLeaves)

Example 5 with BlockModelEntry

use of forestry.core.models.BlockModelEntry in project Binnie by ForestryMC.

the class BlockMultiFence method registerStateMapper.

@SideOnly(Side.CLIENT)
@Override
public void registerStateMapper() {
    ResourceLocation registryName = getRegistryName();
    ModelLoader.setCustomStateMapper(this, new DefaultStateMapper(registryName));
    ModelManager.registerCustomBlockModel(new BlockModelEntry(new ModelResourceLocation(registryName, "normal"), new ModelResourceLocation(registryName, "inventory"), new ModelMultiFence(), this));
}
Also used : DefaultStateMapper(binnie.core.models.DefaultStateMapper) BlockModelEntry(forestry.core.models.BlockModelEntry) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ResourceLocation(net.minecraft.util.ResourceLocation) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) ModelMultiFence(binnie.extratrees.models.ModelMultiFence) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

BlockModelEntry (forestry.core.models.BlockModelEntry)7 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)7 ResourceLocation (net.minecraft.util.ResourceLocation)4 DefaultStateMapper (binnie.core.models.DefaultStateMapper)3 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)3 ModelMutlipass (binnie.core.models.ModelMutlipass)2 BlockETDecorativeLeaves (binnie.extratrees.blocks.BlockETDecorativeLeaves)1 BlockETDefaultLeaves (binnie.extratrees.blocks.BlockETDefaultLeaves)1 BlockETSlab (binnie.extratrees.blocks.wood.BlockETSlab)1 ModelDefaultETLeaves (binnie.extratrees.models.ModelDefaultETLeaves)1 ModelETDecorativeLeaves (binnie.extratrees.models.ModelETDecorativeLeaves)1 ModelMultiFence (binnie.extratrees.models.ModelMultiFence)1 BlockArbSlab (forestry.arboriculture.blocks.BlockArbSlab)1 BlockDecorativeLeaves (forestry.arboriculture.blocks.BlockDecorativeLeaves)1 BlockDefaultLeaves (forestry.arboriculture.blocks.BlockDefaultLeaves)1 ModelDecorativeLeaves (forestry.arboriculture.models.ModelDecorativeLeaves)1 ModelDefaultLeaves (forestry.arboriculture.models.ModelDefaultLeaves)1 ModelLeaves (forestry.arboriculture.models.ModelLeaves)1 ModelEntry (forestry.core.models.ModelEntry)1 ModelManager (forestry.core.models.ModelManager)1