mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-02 19:36:41 +00:00
Added support for axis rotations.
This commit is contained in:
@ -22,6 +22,9 @@ package com.sk89q.worldedit.util;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
@ -150,6 +153,23 @@ public enum Direction {
|
||||
return closest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all directions with the given flags.
|
||||
*
|
||||
* @param flags The flags
|
||||
* @return The directions that fit the flags
|
||||
*/
|
||||
public static List<Direction> valuesOf(int flags) {
|
||||
List<Direction> directions = new ArrayList<>();
|
||||
for (Direction direction : values()) {
|
||||
if ((~flags & direction.flags) == 0) {
|
||||
directions.add(direction);
|
||||
}
|
||||
}
|
||||
|
||||
return directions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flags to use with {@link #findClosest(Vector3, int)}.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user