diff options
author | TomTom <[email protected]> | 2023-11-03 15:05:57 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2023-11-03 14:05:57 +0000 |
commit | 487109fddc74813b81bf17dfe8ec7be443963d9d (patch) | |
tree | 8fbfe1ec07553dc9149882389257d948b0486e02 /patches/server/1002-Expand-Pose-API.patch | |
parent | 8493340be4fa69fa9369719272e5dff1b7a2f455 (diff) | |
download | Paper-487109fddc74813b81bf17dfe8ec7be443963d9d.tar.gz Paper-487109fddc74813b81bf17dfe8ec7be443963d9d.zip |
Readd 0414 use distance map to optimise entity tracker (#9868)
Diffstat (limited to 'patches/server/1002-Expand-Pose-API.patch')
-rw-r--r-- | patches/server/1002-Expand-Pose-API.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/patches/server/1002-Expand-Pose-API.patch b/patches/server/1002-Expand-Pose-API.patch new file mode 100644 index 0000000000..6916504cfd --- /dev/null +++ b/patches/server/1002-Expand-Pose-API.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: SoSeDiK <[email protected]> +Date: Wed, 11 Jan 2023 20:59:01 +0200 +Subject: [PATCH] Expand Pose API + + +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index b22f9de22359573ca64e0bf7e2a241f5ed31b698..684190fd12d910c5b2b47a409181330d3882bced 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -417,6 +417,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + private UUID originWorld; + public boolean freezeLocked = false; // Paper - Freeze Tick Lock API + public boolean collidingWithWorldBorder; // Paper ++ public boolean fixedPose = false; // Paper + + public void setOrigin(@javax.annotation.Nonnull Location location) { + this.origin = location.toVector(); +@@ -701,6 +702,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + public void onClientRemoval() {} + + public void setPose(net.minecraft.world.entity.Pose pose) { ++ if (this.fixedPose) return; // Paper + // CraftBukkit start + if (pose == this.getPose()) { + return; +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +index 9ae86d1eab7d831d6b7d637c40fb6408950f7e71..f7ebddd35ff5a60a81034fd7de035ebba83e9517 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +@@ -1243,6 +1243,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { + public boolean isSneaking() { + return this.getHandle().isShiftKeyDown(); + } ++ ++ @Override ++ public void setPose(Pose pose, boolean fixed) { ++ Preconditions.checkNotNull(pose, "Pose cannot be null"); ++ final Entity handle = this.getHandle(); ++ handle.fixedPose = false; ++ handle.setPose(net.minecraft.world.entity.Pose.values()[pose.ordinal()]); ++ handle.fixedPose = fixed; ++ } ++ ++ @Override ++ public boolean hasFixedPose() { ++ return this.getHandle().fixedPose; ++ } + // Paper end + + @Override |