2020-07-17 18:05:50 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2020-08-03 18:48:42 +02:00
|
|
|
From: JellySquid <jellysquid+atwork@protonmail.com>
|
2020-06-27 19:00:18 +02:00
|
|
|
Date: Mon, 11 May 2020 21:02:57 +0200
|
|
|
|
Subject: [PATCH] lithium MixinBox
|
|
|
|
|
2020-08-03 21:25:54 +02:00
|
|
|
Original code by JellySquid, licensed under GNU Lesser General Public License v3.0
|
2020-08-06 23:02:30 +02:00
|
|
|
you can find the original code on https://github.com/jellysquid3/lithium-fabric/tree/1.16.x/fabric (Yarn mappings)
|
2020-06-27 19:00:18 +02:00
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java
|
2021-01-21 11:58:52 +01:00
|
|
|
index 5c3d5b22b833d9f835e17803295b87893fd05e62..e1d2e5f61b01f812d53a41cd8ba5d45b5f8c7f19 100644
|
2020-06-27 19:00:18 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/AxisAlignedBB.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/AxisAlignedBB.java
|
2021-01-21 11:58:52 +01:00
|
|
|
@@ -193,12 +193,38 @@ public class AxisAlignedBB {
|
2020-06-27 19:00:18 +02:00
|
|
|
return new AxisAlignedBB(vec3d.x, vec3d.y, vec3d.z, vec3d.x + 1.0D, vec3d.y + 1.0D, vec3d.z + 1.0D);
|
|
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @reason Simplify the code to better help the JVM optimize it
|
|
|
|
+ * @author JellySquid
|
|
|
|
+ */
|
|
|
|
public double a(EnumDirection.EnumAxis enumdirection_enumaxis) {
|
|
|
|
- return enumdirection_enumaxis.a(this.minX, this.minY, this.minZ);
|
|
|
|
+ switch (enumdirection_enumaxis) {
|
|
|
|
+ case X:
|
|
|
|
+ return this.minX;
|
|
|
|
+ case Y:
|
|
|
|
+ return this.minY;
|
|
|
|
+ case Z:
|
|
|
|
+ return this.minZ;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ throw new IllegalArgumentException();
|
2020-08-31 11:24:45 +02:00
|
|
|
}
|
|
|
|
|
2020-06-27 19:00:18 +02:00
|
|
|
+ /**
|
|
|
|
+ * @reason Simplify the code to better help the JVM optimize it
|
|
|
|
+ * @author JellySquid
|
|
|
|
+ */
|
|
|
|
public double b(EnumDirection.EnumAxis enumdirection_enumaxis) {
|
|
|
|
- return enumdirection_enumaxis.a(this.maxX, this.maxY, this.maxZ);
|
|
|
|
+ switch (enumdirection_enumaxis) {
|
|
|
|
+ case X:
|
|
|
|
+ return this.maxX;
|
|
|
|
+ case Y:
|
|
|
|
+ return this.maxY;
|
|
|
|
+ case Z:
|
|
|
|
+ return this.maxZ;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ throw new IllegalArgumentException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object object) {
|