mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Add fast alternative constructor for Vector3f (#5339)
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
This commit is contained in:
parent
1649b53e54
commit
b2e6c8941b
1 changed files with 30 additions and 0 deletions
|
@ -0,0 +1,30 @@
|
||||||
|
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>
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/Vector3f.java b/src/main/java/net/minecraft/server/Vector3f.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/Vector3f.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/Vector3f.java
|
||||||
|
@@ -0,0 +0,0 @@ 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();
|
||||||
|
|
Loading…
Reference in a new issue