mirror of
https://github.com/FalsePattern/FalsePatternLib.git
synced 2026-11-15 20:44:45 +00:00
Annotate all the things
This commit is contained in:
63 files changed
+623
-369
No files matched your search
@@ -28,16 +28,22 @@ import net.minecraft.util.EnumFacing;
|
||||
|
||||
@StableAPI(since = "0.6.0")
|
||||
public enum Rotation {
|
||||
@StableAPI.Expose
|
||||
NONE,
|
||||
@StableAPI.Expose
|
||||
CLOCKWISE_90,
|
||||
@StableAPI.Expose
|
||||
CLOCKWISE_180,
|
||||
@StableAPI.Expose
|
||||
COUNTERCLOCKWISE_90;
|
||||
|
||||
@StableAPI.Expose
|
||||
public Rotation add(@NonNull Rotation rotation) {
|
||||
val values = Rotation.values();
|
||||
return values[(ordinal() + rotation.ordinal()) % values.length];
|
||||
}
|
||||
|
||||
@StableAPI.Expose
|
||||
public EnumFacing rotate(@NonNull EnumFacing facing) {
|
||||
if (facing == EnumFacing.UP || facing == EnumFacing.DOWN) {
|
||||
return facing;
|
||||
@@ -87,6 +93,7 @@ public enum Rotation {
|
||||
}
|
||||
}
|
||||
|
||||
@StableAPI.Expose
|
||||
public int rotate(int x, int z) {
|
||||
switch (this) {
|
||||
case CLOCKWISE_90:
|
||||
|
||||
Reference in new issue
Block a user