Search in sources :

Example 6 with IModelBaker

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

the class ModelMutlipass method bakeModel.

@Override
protected IBakedModel bakeModel(ItemStack stack, World world, K key) {
    if (key == null) {
        return null;
    }
    Block block = Block.getBlockFromItem(stack.getItem());
    if (!blockClass.isInstance(block)) {
        return null;
    }
    B bBlock = blockClass.cast(block);
    IModelBaker baker = new AABBModelBaker(bBlock.getItemBoundingBox());
    bakeBlock(bBlock, key, baker, true);
    return itemModel = baker.bakeModel(true);
}
Also used : Block(net.minecraft.block.Block) IMultipassBlock(binnie.core.block.IMultipassBlock) IModelBaker(forestry.api.core.IModelBaker)

Example 7 with IModelBaker

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

the class ModelDefaultETLeaves method bakeModel.

@Override
protected IBakedModel bakeModel(IBlockState state, ETTreeDefinition key, BlockETDefaultLeaves block) {
    if (key == null) {
        return null;
    }
    IModelBaker baker = new ModelBaker();
    if (!blockClass.isInstance(block)) {
        return null;
    }
    BlockETDefaultLeaves 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 : IModelBaker(forestry.api.core.IModelBaker) IModelBaker(forestry.api.core.IModelBaker) ModelBaker(forestry.core.models.baker.ModelBaker) BlockETDefaultLeaves(binnie.extratrees.blocks.BlockETDefaultLeaves)

Example 8 with IModelBaker

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

the class ModelMultiFence method bakeModel.

@Override
protected IBakedModel bakeModel(ItemStack stack, World world, Key key) {
    if (key == null) {
        return null;
    }
    Block block = Block.getBlockFromItem(stack.getItem());
    if (!blockClass.isInstance(block)) {
        return null;
    }
    BlockMultiFence bBlock = blockClass.cast(block);
    IModelBaker baker = new AABBModelBaker();
    bakeBlock(bBlock, key, baker, true);
    baker.setModelState(ModelManager.getDefaultFenceState());
    return itemModel = baker.bakeModel(true);
}
Also used : AABBModelBaker(binnie.core.models.AABBModelBaker) BlockMultiFence(binnie.extratrees.blocks.decor.BlockMultiFence) Block(net.minecraft.block.Block) IModelBaker(forestry.api.core.IModelBaker)

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