Search in sources :

Example 1 with IModelBaker

use of forestry.api.core.IModelBaker in project ForestryMC by ForestryMC.

the class ModelBlockDefault method bakeModel.

protected IBakedModel bakeModel(ItemStack stack, World world, K key) {
    IModelBaker baker = new ModelBaker();
    Block block = Block.getBlockFromItem(stack.getItem());
    Preconditions.checkArgument(blockClass.isInstance(block));
    B bBlock = blockClass.cast(block);
    bakeBlock(bBlock, key, baker, true);
    return itemModel = baker.bakeModel(true);
}
Also used : IModelBaker(forestry.api.core.IModelBaker) IModelBaker(forestry.api.core.IModelBaker) ModelBaker(forestry.core.models.baker.ModelBaker) Block(net.minecraft.block.Block)

Example 2 with IModelBaker

use of forestry.api.core.IModelBaker in project ForestryMC by ForestryMC.

the class ModelBlockDefault method bakeModel.

protected IBakedModel bakeModel(IBlockState state, K key, B block) {
    IModelBaker baker = new ModelBaker();
    if (state instanceof IExtendedBlockState) {
        IExtendedBlockState stateExtended = (IExtendedBlockState) state;
        IBlockAccess world = stateExtended.getValue(UnlistedBlockAccess.BLOCKACCESS);
        BlockPos pos = stateExtended.getValue(UnlistedBlockPos.POS);
    }
    bakeBlock(block, key, baker, false);
    blockModel = baker.bakeModel(false);
    onCreateModel(blockModel);
    return blockModel;
}
Also used : IExtendedBlockState(net.minecraftforge.common.property.IExtendedBlockState) IModelBaker(forestry.api.core.IModelBaker) IModelBaker(forestry.api.core.IModelBaker) ModelBaker(forestry.core.models.baker.ModelBaker) IBlockAccess(net.minecraft.world.IBlockAccess) BlockPos(net.minecraft.util.math.BlockPos) UnlistedBlockPos(forestry.core.blocks.properties.UnlistedBlockPos)

Example 3 with IModelBaker

use of forestry.api.core.IModelBaker in project Binnie by ForestryMC.

the class ModelETDecorativeLeaves method bakeModel.

@Override
protected IBakedModel bakeModel(IBlockState state, ETTreeDefinition key, BlockETDecorativeLeaves block) {
    if (key == null) {
        return null;
    }
    IModelBaker baker = new ModelBaker();
    if (!blockClass.isInstance(block)) {
        return null;
    }
    BlockETDecorativeLeaves bBlock = blockClass.cast(block);
    // baker.setRenderBounds(Block.FULL_BLOCK_AABB);
    bakeBlock(bBlock, key, baker, false);
    blockModel = baker.bakeModel(false);
    onCreateModel(blockModel);
    return blockModel;
}
Also used : BlockETDecorativeLeaves(binnie.extratrees.blocks.BlockETDecorativeLeaves) IModelBaker(forestry.api.core.IModelBaker) IModelBaker(forestry.api.core.IModelBaker) ModelBaker(forestry.core.models.baker.ModelBaker)

Example 4 with IModelBaker

use of forestry.api.core.IModelBaker in project ForestryMC by ForestryMC.

the class ModelDecorativeLeaves method bakeModel.

@Override
protected IBakedModel bakeModel(IBlockState state, TreeDefinition key, BlockDecorativeLeaves block) {
    IModelBaker baker = new ModelBaker();
    bakeBlock(block, key, baker, false);
    blockModel = baker.bakeModel(false);
    onCreateModel(blockModel);
    return blockModel;
}
Also used : IModelBaker(forestry.api.core.IModelBaker) IModelBaker(forestry.api.core.IModelBaker) ModelBaker(forestry.core.models.baker.ModelBaker)

Example 5 with IModelBaker

use of forestry.api.core.IModelBaker in project ForestryMC by ForestryMC.

the class ModelDefaultLeaves method bakeModel.

@Override
protected IBakedModel bakeModel(IBlockState state, TreeDefinition key, BlockDefaultLeaves block) {
    IModelBaker baker = new ModelBaker();
    bakeBlock(block, key, baker, false);
    blockModel = baker.bakeModel(false);
    onCreateModel(blockModel);
    return blockModel;
}
Also used : IModelBaker(forestry.api.core.IModelBaker) IModelBaker(forestry.api.core.IModelBaker) ModelBaker(forestry.core.models.baker.ModelBaker)

Aggregations

IModelBaker (forestry.api.core.IModelBaker)8 ModelBaker (forestry.core.models.baker.ModelBaker)6 Block (net.minecraft.block.Block)3 IMultipassBlock (binnie.core.block.IMultipassBlock)1 AABBModelBaker (binnie.core.models.AABBModelBaker)1 BlockETDecorativeLeaves (binnie.extratrees.blocks.BlockETDecorativeLeaves)1 BlockETDefaultLeaves (binnie.extratrees.blocks.BlockETDefaultLeaves)1 BlockMultiFence (binnie.extratrees.blocks.decor.BlockMultiFence)1 UnlistedBlockPos (forestry.core.blocks.properties.UnlistedBlockPos)1 BlockPos (net.minecraft.util.math.BlockPos)1 IBlockAccess (net.minecraft.world.IBlockAccess)1 IExtendedBlockState (net.minecraftforge.common.property.IExtendedBlockState)1