Search in sources :

Example 1 with BlockType

use of forestry.core.worldgen.BlockType in project ForestryMC by ForestryMC.

the class WorldGenTree method getWood.

@Override
public BlockType getWood() {
    ItemStack woodStack = tree.getGenome().getPrimary().getLogStacks()[0];
    Block block = StackUtils.getBlock(woodStack);
    int meta = woodStack.getItemDamage();
    // if we have a fireproof tree, return the fireproof log
    if (block instanceof BlockLog) {
        IAlleleBoolean fireproof = (IAlleleBoolean) tree.getGenome().getActiveAllele(EnumTreeChromosome.FIREPROOF);
        if (fireproof.getValue()) {
            BlockLog blockLog = (BlockLog) block;
            ForestryBlock fireproofLogBlock = BlockFireproofLog.getFireproofLog(blockLog);
            return new BlockType(fireproofLogBlock.block(), meta);
        }
    }
    return new BlockType(block, meta);
}
Also used : IAlleleBoolean(forestry.api.genetics.IAlleleBoolean) BlockType(forestry.core.worldgen.BlockType) Block(net.minecraft.block.Block) ForestryBlock(forestry.core.config.ForestryBlock) BlockLog(forestry.arboriculture.gadgets.BlockLog) ItemStack(net.minecraft.item.ItemStack) ForestryBlock(forestry.core.config.ForestryBlock)

Example 2 with BlockType

use of forestry.core.worldgen.BlockType in project ForestryMC by ForestryMC.

the class WorldGenArboriculture method addZWood.

protected final void addZWood(int x, int y, int z, EnumReplaceMode replace) {
    BlockType woodZ = new BlockType(wood.getBlock(), wood.getMeta() + 8);
    addBlock(x, y, z, woodZ, replace);
}
Also used : BlockType(forestry.core.worldgen.BlockType)

Example 3 with BlockType

use of forestry.core.worldgen.BlockType in project ForestryMC by ForestryMC.

the class WorldGenArboriculture method addXWood.

protected final void addXWood(int x, int y, int z, EnumReplaceMode replace) {
    BlockType woodX = new BlockType(wood.getBlock(), wood.getMeta() + 4);
    addBlock(x, y, z, woodX, replace);
}
Also used : BlockType(forestry.core.worldgen.BlockType)

Aggregations

BlockType (forestry.core.worldgen.BlockType)3 IAlleleBoolean (forestry.api.genetics.IAlleleBoolean)1 BlockLog (forestry.arboriculture.gadgets.BlockLog)1 ForestryBlock (forestry.core.config.ForestryBlock)1 Block (net.minecraft.block.Block)1 ItemStack (net.minecraft.item.ItemStack)1