2020-02-25 15:14:56 +01:00
|
|
|
package de.ellpeck.naturesaura.blocks;
|
|
|
|
|
|
|
|
import de.ellpeck.naturesaura.data.BlockStateGenerator;
|
|
|
|
import de.ellpeck.naturesaura.reg.*;
|
|
|
|
import net.minecraft.client.renderer.RenderType;
|
2021-12-15 14:26:42 +01:00
|
|
|
import net.minecraft.world.level.block.Block;
|
|
|
|
import net.minecraft.world.level.block.FlowerPotBlock;
|
2020-02-25 15:14:56 +01:00
|
|
|
|
|
|
|
import java.util.function.Supplier;
|
|
|
|
|
|
|
|
public class BlockFlowerPot extends FlowerPotBlock implements ICustomBlockState, IModItem, INoItemBlock, ICustomRenderType {
|
2021-12-15 14:26:42 +01:00
|
|
|
|
2020-02-25 15:14:56 +01:00
|
|
|
public BlockFlowerPot(Supplier<FlowerPotBlock> emptyPot, Supplier<? extends Block> block, Properties props) {
|
|
|
|
super(emptyPot, block, props);
|
|
|
|
ModRegistry.add(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void generateCustomBlockState(BlockStateGenerator generator) {
|
|
|
|
generator.simpleBlock(this, generator.models()
|
|
|
|
.withExistingParent(this.getBaseName(), "block/flower_pot_cross")
|
2021-12-15 14:26:42 +01:00
|
|
|
.texture("plant", "block/" + this.getContent().getRegistryName().getPath()));
|
2020-02-25 15:14:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getBaseName() {
|
2021-12-15 14:26:42 +01:00
|
|
|
return "potted_" + this.getContent().getRegistryName().getPath();
|
2020-02-25 15:14:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Supplier<RenderType> getRenderType() {
|
2021-12-15 14:26:42 +01:00
|
|
|
return RenderType::cutout;
|
2020-02-25 15:14:56 +01:00
|
|
|
}
|
|
|
|
}
|