NaturesAura/src/main/java/de/ellpeck/naturesaura/blocks/BlockFlowerPot.java

32 lines
1.2 KiB
Java
Raw Normal View History

2020-02-25 15:14:56 +01:00
package de.ellpeck.naturesaura.blocks;
import de.ellpeck.naturesaura.data.BlockStateGenerator;
import de.ellpeck.naturesaura.reg.ICustomBlockState;
import de.ellpeck.naturesaura.reg.IModItem;
import de.ellpeck.naturesaura.reg.INoItemBlock;
import de.ellpeck.naturesaura.reg.ModRegistry;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.FlowerPotBlock;
2024-02-03 14:56:07 +01:00
import net.neoforged.neoforge.registries.ForgeRegistries;
2020-02-25 15:14:56 +01:00
import java.util.function.Supplier;
public class BlockFlowerPot extends FlowerPotBlock implements ICustomBlockState, IModItem, INoItemBlock {
2020-02-25 15:14:56 +01:00
public BlockFlowerPot(Supplier<FlowerPotBlock> emptyPot, Supplier<? extends Block> block, Properties props) {
super(emptyPot, block, props);
2022-06-27 15:24:04 +02:00
ModRegistry.ALL_ITEMS.add(this);
2020-02-25 15:14:56 +01:00
}
@Override
public void generateCustomBlockState(BlockStateGenerator generator) {
generator.simpleBlock(this, generator.models().withExistingParent(this.getBaseName(), "block/flower_pot_cross").texture("plant", "block/" + ForgeRegistries.BLOCKS.getKey(this.getContent()).getPath()).renderType("cutout"));
2020-02-25 15:14:56 +01:00
}
@Override
public String getBaseName() {
2022-06-27 15:24:04 +02:00
return "potted_" + ForgeRegistries.BLOCKS.getKey(this.getContent()).getPath();
2020-02-25 15:14:56 +01:00
}
}