simplify code
This commit is contained in:
parent
2328cd75b6
commit
71e83874c0
@ -35,19 +35,7 @@ public abstract class BlockMatteryRotatable extends BlockMattery {
|
||||
@Nullable
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext context) {
|
||||
Direction find_first = null;
|
||||
|
||||
for (Direction direction : context.getNearestLookingDirections()) {
|
||||
if (FACING.getPossibleValues().contains(direction)) {
|
||||
find_first = direction;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (find_first == null)
|
||||
return this.defaultBlockState();
|
||||
|
||||
return this.defaultBlockState().setValue(FACING, faceToPlayer(context) ? find_first.getOpposite() : find_first);
|
||||
return this.defaultBlockState().setValue(FACING, faceToPlayer(context) ? context.getHorizontalDirection().getOpposite() : context.getHorizontalDirection());
|
||||
}
|
||||
|
||||
public boolean faceToPlayer(BlockPlaceContext context) {
|
||||
|
Loading…
Reference in New Issue
Block a user