Search in sources :

Example 1 with TropicsFlowerBlock

use of net.tropicraft.core.common.block.TropicsFlowerBlock in project Tropicraft by Tropicraft.

the class TropicraftBlockstateProvider method flowerPot.

private void flowerPot(Supplier<? extends FlowerPotBlock> full, Supplier<? extends Block> empty, ResourceLocation particle) {
    Block flower = full.get().getContent();
    boolean isVanilla = flower.getRegistryName().getNamespace().equals("minecraft");
    String parent = flower == Blocks.AIR ? "flower_pot" : !isVanilla ? "flower_pot_cross" : ModelProvider.BLOCK_FOLDER + "/potted_" + name(flower.delegate);
    BlockModelBuilder model = models().withExistingParent(name(full), parent).texture("flowerpot", blockTexture(empty)).texture("dirt", mcLoc("block/dirt")).texture("particle", modBlockLoc("bamboo_side"));
    if (!isVanilla) {
        if (flower instanceof TropicsFlowerBlock) {
            model.texture("plant", modLoc(ModelProvider.BLOCK_FOLDER + "/flower/" + name(flower.delegate)));
        } else if (flower instanceof TallFlowerBlock) {
            model.texture("plant", modLoc(ModelProvider.BLOCK_FOLDER + "/" + name(flower.delegate) + "_top"));
        } else {
            model.texture("plant", blockTexture(flower));
        }
    }
    simpleBlock(full, model);
}
Also used : TallFlowerBlock(net.minecraft.world.level.block.TallFlowerBlock) TropicsFlowerBlock(net.tropicraft.core.common.block.TropicsFlowerBlock) FenceGateBlock(net.minecraft.world.level.block.FenceGateBlock) TrapDoorBlock(net.minecraft.world.level.block.TrapDoorBlock) RedstoneTorchBlock(net.minecraft.world.level.block.RedstoneTorchBlock) LadderBlock(net.minecraft.world.level.block.LadderBlock) WallBlock(net.minecraft.world.level.block.WallBlock) TropicsFlowerBlock(net.tropicraft.core.common.block.TropicsFlowerBlock) BushBlock(net.minecraft.world.level.block.BushBlock) HugePlantBlock(net.tropicraft.core.common.block.huge_plant.HugePlantBlock) DoublePlantBlock(net.minecraft.world.level.block.DoublePlantBlock) StairBlock(net.minecraft.world.level.block.StairBlock) TikiTorchBlock(net.tropicraft.core.common.block.TikiTorchBlock) FlowerPotBlock(net.minecraft.world.level.block.FlowerPotBlock) BongoDrumBlock(net.tropicraft.core.common.block.BongoDrumBlock) SlabBlock(net.minecraft.world.level.block.SlabBlock) FenceBlock(net.minecraft.world.level.block.FenceBlock) RedstoneWallTorchBlock(net.minecraft.world.level.block.RedstoneWallTorchBlock) TallFlowerBlock(net.minecraft.world.level.block.TallFlowerBlock) CoffeeBushBlock(net.tropicraft.core.common.block.CoffeeBushBlock) ReedsBlock(net.tropicraft.core.common.block.ReedsBlock) MangroveRootsBlock(net.tropicraft.core.common.block.MangroveRootsBlock) DoorBlock(net.minecraft.world.level.block.DoorBlock) BoardwalkBlock(net.tropicraft.core.common.block.BoardwalkBlock) PropaguleBlock(net.tropicraft.core.common.block.PropaguleBlock) Block(net.minecraft.world.level.block.Block) RotatedPillarBlock(net.minecraft.world.level.block.RotatedPillarBlock) BlockModelBuilder(net.minecraftforge.client.model.generators.BlockModelBuilder)

Aggregations

Block (net.minecraft.world.level.block.Block)1 BushBlock (net.minecraft.world.level.block.BushBlock)1 DoorBlock (net.minecraft.world.level.block.DoorBlock)1 DoublePlantBlock (net.minecraft.world.level.block.DoublePlantBlock)1 FenceBlock (net.minecraft.world.level.block.FenceBlock)1 FenceGateBlock (net.minecraft.world.level.block.FenceGateBlock)1 FlowerPotBlock (net.minecraft.world.level.block.FlowerPotBlock)1 LadderBlock (net.minecraft.world.level.block.LadderBlock)1 RedstoneTorchBlock (net.minecraft.world.level.block.RedstoneTorchBlock)1 RedstoneWallTorchBlock (net.minecraft.world.level.block.RedstoneWallTorchBlock)1 RotatedPillarBlock (net.minecraft.world.level.block.RotatedPillarBlock)1 SlabBlock (net.minecraft.world.level.block.SlabBlock)1 StairBlock (net.minecraft.world.level.block.StairBlock)1 TallFlowerBlock (net.minecraft.world.level.block.TallFlowerBlock)1 TrapDoorBlock (net.minecraft.world.level.block.TrapDoorBlock)1 WallBlock (net.minecraft.world.level.block.WallBlock)1 BlockModelBuilder (net.minecraftforge.client.model.generators.BlockModelBuilder)1 BoardwalkBlock (net.tropicraft.core.common.block.BoardwalkBlock)1 BongoDrumBlock (net.tropicraft.core.common.block.BongoDrumBlock)1 CoffeeBushBlock (net.tropicraft.core.common.block.CoffeeBushBlock)1