2023-05-14 00:47:28 -04:00
|
|
|
--- a/com/mojang/math/OctahedralGroup.java
|
|
|
|
+++ b/com/mojang/math/OctahedralGroup.java
|
2025-04-12 17:26:44 +02:00
|
|
|
@@ -123,6 +_,12 @@
|
|
|
|
}
|
|
|
|
);
|
2023-05-14 00:47:28 -04:00
|
|
|
|
2025-04-12 17:26:44 +02:00
|
|
|
+ static {
|
|
|
|
+ for (OctahedralGroup octahedralGroup : values()) {
|
|
|
|
+ octahedralGroup.initializeRotationDirections(); // Paper - Avoid Lazy Initialization for Enum Fields
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
private OctahedralGroup(final String name, final SymmetricGroup3 permutation, final boolean invertX, final boolean invertY, final boolean invertZ) {
|
|
|
|
this.name = name;
|
|
|
|
this.invertX = invertX;
|
|
|
|
@@ -160,7 +_,7 @@
|
2023-05-14 00:47:28 -04:00
|
|
|
return this.name;
|
|
|
|
}
|
|
|
|
|
|
|
|
- public Direction rotate(Direction direction) {
|
|
|
|
+ public void initializeRotationDirections() { // Paper - Avoid Lazy Initialization for Enum Fields
|
|
|
|
if (this.rotatedDirections == null) {
|
2025-04-12 17:26:44 +02:00
|
|
|
this.rotatedDirections = Util.makeEnumMap(Direction.class, direction1 -> {
|
|
|
|
Direction.Axis axis = direction1.getAxis();
|
|
|
|
@@ -171,6 +_,11 @@
|
|
|
|
});
|
2023-05-14 00:47:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start - Avoid Lazy Initialization for Enum Fields
|
|
|
|
+ }
|
2025-04-12 17:26:44 +02:00
|
|
|
+
|
2023-05-14 00:47:28 -04:00
|
|
|
+ public Direction rotate(Direction direction) {
|
|
|
|
+ // Paper end - Avoid Lazy Initialization for Enum Fields
|
|
|
|
return this.rotatedDirections.get(direction);
|
|
|
|
}
|
|
|
|
|