From 808bd9198664938af58e98e622c41902343587e0 Mon Sep 17 00:00:00 2001 From: Irmo van den Berge Date: Wed, 10 Mar 2021 22:14:52 +0100 Subject: [PATCH] Add fast alternative constructor for Vector3f (#5339) Signed-off-by: Irmo van den Berge --- ...alternative-constructor-for-Vector3f.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Spigot-Server-Patches/0694-Add-fast-alternative-constructor-for-Vector3f.patch diff --git a/Spigot-Server-Patches/0694-Add-fast-alternative-constructor-for-Vector3f.patch b/Spigot-Server-Patches/0694-Add-fast-alternative-constructor-for-Vector3f.patch new file mode 100644 index 000000000..e8ff8b39a --- /dev/null +++ b/Spigot-Server-Patches/0694-Add-fast-alternative-constructor-for-Vector3f.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Irmo van den Berge +Date: Wed, 10 Mar 2021 21:26:31 +0100 +Subject: [PATCH] Add fast alternative constructor for Vector3f + +Signed-off-by: Irmo van den Berge + +diff --git a/src/main/java/net/minecraft/server/Vector3f.java b/src/main/java/net/minecraft/server/Vector3f.java +index fa25e5d1530e099f73355c2779e0d57a51ad4b6e..c8de8056e60c159d85d14e80bdbf12f1dac9a621 100644 +--- a/src/main/java/net/minecraft/server/Vector3f.java ++++ b/src/main/java/net/minecraft/server/Vector3f.java +@@ -16,6 +16,18 @@ public class Vector3f { + this(nbttaglist.i(0), nbttaglist.i(1), nbttaglist.i(2)); + } + ++ // Paper start - faster alternative constructor ++ private Vector3f(float x, float y, float z, Void dummy_var) { ++ this.x = x; ++ this.y = y; ++ this.z = z; ++ } ++ ++ public static Vector3f createWithoutValidityChecks(float x, float y, float z) { ++ return new Vector3f(x, y, z, null); ++ } ++ // Paper end ++ + public NBTTagList a() { + NBTTagList nbttaglist = new NBTTagList(); +