2021-03-10 22:14:52 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
|
|
|
|
Date: Wed, 10 Mar 2021 21:26:31 +0100
|
|
|
|
Subject: [PATCH] Add fast alternative constructor for Vector3f
|
|
|
|
|
|
|
|
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
|
|
|
|
|
2021-03-16 08:19:45 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/core/Vector3f.java b/src/main/java/net/minecraft/core/Vector3f.java
|
|
|
|
index 93590ceb0bbe369a1bda987f0c4c21ea6a3b3a1a..da53e294fa5e28406b25614039db49b48c2dcdac 100644
|
|
|
|
--- a/src/main/java/net/minecraft/core/Vector3f.java
|
|
|
|
+++ b/src/main/java/net/minecraft/core/Vector3f.java
|
|
|
|
@@ -19,6 +19,18 @@ public class Vector3f {
|
2021-03-10 22:14:52 +01:00
|
|
|
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();
|
|
|
|
|