2020-01-26 02:20:08 +01:00
|
|
|
package de.ellpeck.naturesaura.blocks;
|
|
|
|
|
2021-12-04 15:40:09 +01:00
|
|
|
import de.ellpeck.naturesaura.blocks.tiles.BlockEntityBlastFurnaceBooster;
|
2020-01-29 00:40:28 +01:00
|
|
|
import de.ellpeck.naturesaura.data.BlockStateGenerator;
|
|
|
|
import de.ellpeck.naturesaura.reg.ICustomBlockState;
|
2020-01-26 02:20:08 +01:00
|
|
|
import net.minecraft.block.Block;
|
2020-01-26 15:52:16 +01:00
|
|
|
import net.minecraft.block.BlockState;
|
2020-01-26 02:20:08 +01:00
|
|
|
import net.minecraft.block.Blocks;
|
2020-01-26 15:52:16 +01:00
|
|
|
import net.minecraft.block.HorizontalBlock;
|
|
|
|
import net.minecraft.item.BlockItemUseContext;
|
|
|
|
import net.minecraft.state.DirectionProperty;
|
|
|
|
import net.minecraft.state.StateContainer;
|
2020-01-26 17:59:58 +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;
|
2020-01-26 02:20:08 +01:00
|
|
|
|
2020-01-29 00:40:28 +01:00
|
|
|
public class BlockBlastFurnaceBooster extends BlockContainerImpl implements ICustomBlockState {
|
2020-01-26 15:52:16 +01:00
|
|
|
public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING;
|
2021-12-04 15:40:09 +01:00
|
|
|
private static final VoxelShape SHAPE = Shapes.create(1 / 16F, 0, 1 / 16F, 15 / 16F, 1, 15 / 16F);
|
2020-01-26 15:52:16 +01:00
|
|
|
|
2020-01-26 02:20:08 +01:00
|
|
|
public BlockBlastFurnaceBooster() {
|
2021-12-04 15:40:09 +01:00
|
|
|
super("blast_furnace_booster", BlockEntityBlastFurnaceBooster::new, Block.Properties.from(Blocks.BLAST_FURNACE).setLightLevel(s -> 0));
|
2020-01-26 02:20:08 +01:00
|
|
|
}
|
2020-01-26 15:52:16 +01:00
|
|
|
|
2020-02-05 14:30:17 +01:00
|
|
|
@Override
|
|
|
|
protected boolean hasWaterlogging() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-01-26 17:59:58 +01:00
|
|
|
@Override
|
2021-12-04 15:40:09 +01:00
|
|
|
public VoxelShape getShape(BlockState state, IBlockReader levelIn, BlockPos pos, ISelectionContext context) {
|
2020-01-26 17:59:58 +01:00
|
|
|
return SHAPE;
|
|
|
|
}
|
|
|
|
|
2020-01-26 15:52:16 +01:00
|
|
|
@Override
|
|
|
|
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
|
2020-02-05 14:30:17 +01:00
|
|
|
super.fillStateContainer(builder);
|
2020-01-26 15:52:16 +01:00
|
|
|
builder.add(FACING);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public BlockState getStateForPlacement(BlockItemUseContext context) {
|
2020-02-05 14:30:17 +01:00
|
|
|
return super.getStateForPlacement(context).with(FACING, context.getPlacementHorizontalFacing().getOpposite());
|
2020-01-26 15:52:16 +01:00
|
|
|
}
|
|
|
|
|
2020-01-29 00:40:28 +01:00
|
|
|
@Override
|
|
|
|
public void generateCustomBlockState(BlockStateGenerator generator) {
|
2020-01-29 01:34:58 +01:00
|
|
|
generator.horizontalBlock(this, generator.models().getExistingFile(generator.modLoc(this.getBaseName())));
|
2020-01-29 00:40:28 +01:00
|
|
|
}
|
2020-01-26 02:20:08 +01:00
|
|
|
}
|