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

41 lines
1.6 KiB
Java
Raw Normal View History

2018-11-04 16:38:09 +01:00
package de.ellpeck.naturesaura.blocks;
import de.ellpeck.naturesaura.api.render.IVisualizable;
2021-12-04 15:40:09 +01:00
import de.ellpeck.naturesaura.blocks.tiles.BlockEntityFlowerGenerator;
2020-01-29 01:34:58 +01:00
import de.ellpeck.naturesaura.data.BlockStateGenerator;
import de.ellpeck.naturesaura.reg.ICustomBlockState;
2018-11-04 16:38:09 +01:00
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
2021-12-04 15:40:09 +01:00
import net.minecraft.level.Level;
2019-10-20 22:30:49 +02:00
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
2018-11-04 16:38:09 +01:00
2020-01-29 01:34:58 +01:00
public class BlockFlowerGenerator extends BlockContainerImpl implements IVisualizable, ICustomBlockState {
2018-11-20 19:59:18 +01:00
2018-11-04 16:38:09 +01:00
public BlockFlowerGenerator() {
2021-12-04 15:40:09 +01:00
super("flower_generator", BlockEntityFlowerGenerator::new, Properties.create(Material.WOOD).sound(SoundType.WOOD).hardnessAndResistance(2F));
2018-11-04 16:38:09 +01:00
}
@Override
2019-10-20 22:30:49 +02:00
@OnlyIn(Dist.CLIENT)
2021-12-04 15:40:09 +01:00
public AxisAlignedBB getVisualizationBounds(Level level, BlockPos pos) {
return new AxisAlignedBB(pos).grow(3, 1, 3);
}
@Override
2019-10-20 22:30:49 +02:00
@OnlyIn(Dist.CLIENT)
2021-12-04 15:40:09 +01:00
public int getVisualizationColor(Level level, BlockPos pos) {
return 0xffed2b;
}
2020-01-29 01:34:58 +01:00
@Override
public void generateCustomBlockState(BlockStateGenerator generator) {
generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(),
generator.modLoc("block/" + this.getBaseName()),
generator.modLoc("block/" + this.getBaseName() + "_top"),
generator.modLoc("block/" + this.getBaseName() + "_top")));
}
2018-11-04 16:38:09 +01:00
}