content: package com.github.alexthe666.rats.server.block;
  
  import net.minecraft.core.Direction;
  import net.minecraft.world.item.context.BlockPlaceContext;
  import net.minecraft.world.level.block.Block;
  import net.minecraft.world.level.block.DirectionalBlock;
  import net.minecraft.world.level.block.Mirror;
  import net.minecraft.world.level.block.Rotation;
  import net.minecraft.world.level.block.state.BlockBehaviour;
  import net.minecraft.world.level.block.state.BlockState;
  import net.minecraft.world.level.block.state.StateDefinition;
  import net.minecraft.world.level.block.state.properties.DirectionProperty;
  
  @SuppressWarnings("deprecation")
  public class RatUpgradeBlock extends DirectionalBlock {
  	public static final DirectionProperty FACING = DirectionalBlock.FACING;
  
  	public RatUpgradeBlock(BlockBehaviour.Properties properties) {
  		super(properties);
  		this.registerDefaultState(this.getStateDefinition().any().setValue(FACING, Direction.UP));
  	}
  
  	@Override
  	public BlockState rotate(BlockState state, Rotation rot) {
  		return state.setValue(FACING, rot.rotate(state.getValue(FACING)));
  	}
  
  	@Override
  	public BlockState mirror(BlockState state, Mirror mirrorIn) {
  		return state.setValue(FACING, mirrorIn.mirror(state.getValue(FACING)));
  	}
  
  	@Override
  	public BlockState getStateForPlacement(BlockPlaceContext context) {
  		Direction direction = context.getClickedFace();
  		return this.defaultBlockState().setValue(FACING, direction);
  	}
  
  	@Override
  	protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
  		builder.add(FACING);
  	}
  }
  