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

31 lines
1.2 KiB
Java
Raw Normal View History

2019-01-08 01:14:19 +01:00
package de.ellpeck.naturesaura.blocks;
2020-01-21 23:02:39 +01:00
import de.ellpeck.naturesaura.blocks.tiles.ModTileEntities;
2020-01-22 01:32:26 +01:00
import de.ellpeck.naturesaura.blocks.tiles.TileEntityAutoCrafter;
2019-11-04 19:08:49 +01:00
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
2019-01-08 01:14:19 +01:00
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
2019-11-04 19:08:49 +01:00
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.DirectionProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.state.properties.BlockStateProperties;
2019-01-08 01:14:19 +01:00
public class BlockAutoCrafter extends BlockContainerImpl {
2019-11-04 19:08:49 +01:00
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
2019-01-08 01:14:19 +01:00
public BlockAutoCrafter() {
2020-01-22 01:32:26 +01:00
super("auto_crafter", TileEntityAutoCrafter::new, ModBlocks.prop(Material.WOOD).hardnessAndResistance(1.5F).sound(SoundType.WOOD));
2019-01-08 01:14:19 +01:00
}
@Override
2019-11-04 19:08:49 +01:00
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
builder.add(FACING);
2019-01-08 01:14:19 +01:00
}
@Override
2019-11-04 19:08:49 +01:00
public BlockState getStateForPlacement(BlockItemUseContext context) {
return this.getDefaultState().with(FACING, context.getPlayer().getHorizontalFacing());
2019-01-08 01:14:19 +01:00
}
}