Search in sources :

Example 1 with BlockBranchThick

use of com.ferreusveritas.dynamictrees.blocks.BlockBranchThick in project DynamicTrees by DynamicTreesTeam.

the class ModelHelper method regModel.

public static void regModel(Block block) {
    if (block != Blocks.AIR) {
        regModel(Item.getItemFromBlock(block));
    }
    if (block instanceof BlockBranchThick) {
        Item item = Item.getItemFromBlock(((BlockBranchThick) block).otherBlock);
        regModel(item, 0, block.getRegistryName());
    }
}
Also used : Item(net.minecraft.item.Item) BlockBranchThick(com.ferreusveritas.dynamictrees.blocks.BlockBranchThick)

Example 2 with BlockBranchThick

use of com.ferreusveritas.dynamictrees.blocks.BlockBranchThick in project DynamicTrees by DynamicTreesTeam.

the class ModelHelper method regModel.

/**
 * Registers models associated with the tree. At the moment this only deals with {@link BlockBranch} blocks
 *
 * @param tree
 */
public static void regModel(TreeFamily tree) {
    BlockBranch blockBranch = tree.getDynamicBranch();
    ModelResourceLocation modelLocation = getBranchModelResourceLocation(blockBranch);
    setGenericStateMapper(blockBranch, modelLocation);
    if (blockBranch instanceof BlockBranchThick) {
        setGenericStateMapper(((BlockBranchThick) blockBranch).otherBlock, modelLocation);
    }
    BlockSurfaceRoot surfaceRoot = tree.getSurfaceRoots();
    if (surfaceRoot != null) {
        ModelLoader.setCustomStateMapper(surfaceRoot, new StateMap.Builder().ignore(surfaceRoot.getIgnorableProperties()).build());
    }
}
Also used : BlockBranchThick(com.ferreusveritas.dynamictrees.blocks.BlockBranchThick) StateMap(net.minecraft.client.renderer.block.statemap.StateMap) ModelResourceLocation(net.minecraft.client.renderer.block.model.ModelResourceLocation) BlockBranch(com.ferreusveritas.dynamictrees.blocks.BlockBranch) BlockSurfaceRoot(com.ferreusveritas.dynamictrees.blocks.BlockSurfaceRoot)

Aggregations

BlockBranchThick (com.ferreusveritas.dynamictrees.blocks.BlockBranchThick)2 BlockBranch (com.ferreusveritas.dynamictrees.blocks.BlockBranch)1 BlockSurfaceRoot (com.ferreusveritas.dynamictrees.blocks.BlockSurfaceRoot)1 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)1 StateMap (net.minecraft.client.renderer.block.statemap.StateMap)1 Item (net.minecraft.item.Item)1