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

38 lines
1.4 KiB
Java
Raw Normal View History

2019-02-22 19:06:47 +01:00
package de.ellpeck.naturesaura.blocks;
2021-12-04 15:40:09 +01:00
import de.ellpeck.naturesaura.blocks.tiles.BlockEntityPowderPlacer;
2020-01-29 00:40:28 +01:00
import de.ellpeck.naturesaura.data.BlockStateGenerator;
import de.ellpeck.naturesaura.reg.ICustomBlockState;
2020-01-23 16:05:52 +01:00
import net.minecraft.block.BlockState;
2019-02-22 19:06:47 +01:00
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
2020-01-23 16:05:52 +01:00
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
2021-12-04 15:40:09 +01:00
import net.minecraft.util.math.shapes.Shapes;
import net.minecraft.level.IBlockReader;
2019-02-22 19:06:47 +01:00
2020-01-29 00:40:28 +01:00
public class BlockPowderPlacer extends BlockContainerImpl implements ICustomBlockState {
2020-01-23 16:05:52 +01:00
2021-12-04 15:40:09 +01:00
private static final VoxelShape SHAPE = Shapes.create(0F, 0F, 0F, 1F, 4 / 16F, 1F);
2019-02-22 19:06:47 +01:00
public BlockPowderPlacer() {
2021-12-04 15:40:09 +01:00
super("powder_placer", BlockEntityPowderPlacer::new, Properties.create(Material.ROCK).hardnessAndResistance(2, 5F).sound(SoundType.STONE));
2019-02-22 19:06:47 +01:00
}
@Override
protected boolean hasWaterlogging() {
return true;
}
2019-02-22 19:06:47 +01:00
@Override
2021-12-04 15:40:09 +01:00
public VoxelShape getShape(BlockState state, IBlockReader levelIn, BlockPos pos, ISelectionContext context) {
2020-01-23 16:05:52 +01:00
return SHAPE;
2019-02-22 19:06:47 +01:00
}
2020-01-29 00:40:28 +01:00
@Override
public void generateCustomBlockState(BlockStateGenerator generator) {
generator.simpleBlock(this, generator.models().getExistingFile(generator.modLoc(this.getBaseName())));
}
2019-02-22 19:06:47 +01:00
}