Search in sources :

Example 6 with BlockModelEntry

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

the class ProxyArboricultureClient method initializeModels.

@Override
public void initializeModels() {
    {
        ModelResourceLocation blockModelLocation = new ModelResourceLocation("forestry:leaves");
        ModelResourceLocation itemModelLocation = new ModelResourceLocation("forestry:leaves", "inventory");
        BlockModelEntry blockModelIndex = new BlockModelEntry(blockModelLocation, itemModelLocation, new ModelLeaves(), ModuleArboriculture.getBlocks().leaves);
        ModelManager.getInstance().registerCustomBlockModel(blockModelIndex);
    }
    for (BlockDecorativeLeaves leaves : ModuleArboriculture.getBlocks().leavesDecorative) {
        String resourceName = "forestry:leaves.decorative." + leaves.getBlockNumber();
        ModelResourceLocation blockModelLocation = new ModelResourceLocation(resourceName);
        ModelResourceLocation itemModeLocation = new ModelResourceLocation(resourceName, "inventory");
        BlockModelEntry blockModelIndex = new BlockModelEntry(blockModelLocation, itemModeLocation, new ModelDecorativeLeaves(), leaves);
        ModelManager.getInstance().registerCustomBlockModel(blockModelIndex);
    }
    for (BlockDefaultLeaves leaves : ModuleArboriculture.getBlocks().leavesDefault) {
        String resourceName = "forestry:leaves.default." + leaves.getBlockNumber();
        ModelResourceLocation blockModelLocation = new ModelResourceLocation(resourceName);
        ModelResourceLocation itemModeLocation = new ModelResourceLocation(resourceName, "inventory");
        BlockModelEntry blockModelIndex = new BlockModelEntry(blockModelLocation, itemModeLocation, new ModelDefaultLeaves(), leaves);
        ModelManager.getInstance().registerCustomBlockModel(blockModelIndex);
    }
    ModelLoaderRegistry.registerLoader(WoodModelLoader.INSTANCE);
    for (BlockArbSlab slab : ModuleArboriculture.getBlocks().slabsDouble) {
        registerWoodModel(slab, true);
    }
    for (BlockArbSlab slab : ModuleArboriculture.getBlocks().slabsDoubleFireproof) {
        registerWoodModel(slab, true);
    }
}
Also used : BlockArbSlab(forestry.arboriculture.blocks.BlockArbSlab) BlockModelEntry(forestry.core.models.BlockModelEntry) ModelDefaultLeaves(forestry.arboriculture.models.ModelDefaultLeaves) ModelLeaves(forestry.arboriculture.models.ModelLeaves) BlockDecorativeLeaves(forestry.arboriculture.blocks.BlockDecorativeLeaves) ModelDecorativeLeaves(forestry.arboriculture.models.ModelDecorativeLeaves) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) BlockDefaultLeaves(forestry.arboriculture.blocks.BlockDefaultLeaves)

Example 7 with BlockModelEntry

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

the class BlockDesign 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 ModelMutlipass<>(BlockDesign.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)

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