mirror of
https://github.com/FalsePattern/FalsePatternLib.git
synced 2026-11-15 16:04:45 +00:00
code cleanup
This commit is contained in:
76 files changed
+691
-622
No files matched your search
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/*
|
||||
* Copyright (C) 2022 FalsePattern
|
||||
* All Rights Reserved
|
||||
*
|
||||
@@ -22,6 +22,8 @@ package com.falsepattern.lib.compat;
|
||||
|
||||
import com.falsepattern.lib.StableAPI;
|
||||
import lombok.NonNull;
|
||||
import lombok.val;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
@StableAPI(since = "0.6.0")
|
||||
@@ -32,43 +34,8 @@ public enum Rotation {
|
||||
COUNTERCLOCKWISE_90;
|
||||
|
||||
public Rotation add(@NonNull Rotation rotation) {
|
||||
switch (rotation) {
|
||||
case CLOCKWISE_180:
|
||||
switch (this) {
|
||||
case NONE:
|
||||
return CLOCKWISE_180;
|
||||
case CLOCKWISE_90:
|
||||
return COUNTERCLOCKWISE_90;
|
||||
case CLOCKWISE_180:
|
||||
return NONE;
|
||||
case COUNTERCLOCKWISE_90:
|
||||
return CLOCKWISE_90;
|
||||
}
|
||||
case COUNTERCLOCKWISE_90:
|
||||
switch (this) {
|
||||
case NONE:
|
||||
return COUNTERCLOCKWISE_90;
|
||||
case CLOCKWISE_90:
|
||||
return NONE;
|
||||
case CLOCKWISE_180:
|
||||
return CLOCKWISE_90;
|
||||
case COUNTERCLOCKWISE_90:
|
||||
return CLOCKWISE_180;
|
||||
}
|
||||
case CLOCKWISE_90:
|
||||
switch (this) {
|
||||
case NONE:
|
||||
return CLOCKWISE_90;
|
||||
case CLOCKWISE_90:
|
||||
return CLOCKWISE_180;
|
||||
case CLOCKWISE_180:
|
||||
return COUNTERCLOCKWISE_90;
|
||||
case COUNTERCLOCKWISE_90:
|
||||
return NONE;
|
||||
}
|
||||
default:
|
||||
return this;
|
||||
}
|
||||
val values = Rotation.values();
|
||||
return values[(ordinal() + rotation.ordinal()) % values.length];
|
||||
}
|
||||
|
||||
public EnumFacing rotate(@NonNull EnumFacing facing) {
|
||||
|
||||
Reference in new issue
Block a user