use of com.viaversion.viaversion.api.minecraft.BlockFace in project ViaVersion by ViaVersion.
the class StairConnectionHandler method getShape.
private int getShape(UserConnection user, Position position, StairData stair) {
BlockFace facing = stair.getFacing();
StairData relativeStair = stairDataMap.get(getBlockData(user, position.getRelative(facing)));
if (relativeStair != null && relativeStair.isBottom() == stair.isBottom()) {
BlockFace facing2 = relativeStair.getFacing();
if (facing.axis() != facing2.axis() && checkOpposite(user, stair, position, facing2.opposite())) {
// outer_left : outer_right
return facing2 == rotateAntiClockwise(facing) ? 3 : 4;
}
}
relativeStair = stairDataMap.get(getBlockData(user, position.getRelative(facing.opposite())));
if (relativeStair != null && relativeStair.isBottom() == stair.isBottom()) {
BlockFace facing2 = relativeStair.getFacing();
if (facing.axis() != facing2.axis() && checkOpposite(user, stair, position, facing2)) {
// inner_left : inner_right
return facing2 == rotateAntiClockwise(facing) ? 1 : 2;
}
}
// straight
return 0;
}
Aggregations