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);
}
}
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));
}
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);
}
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();
}
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));
}
Aggregations