diff options
author | Jakub Zacek <[email protected]> | 2024-07-15 23:35:51 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-07-15 17:35:51 -0400 |
commit | 2cd8c461af74f0a524878dcdffba86cd105c48c6 (patch) | |
tree | ac107a76fe3d6cdd2e6ef5804ef3cba152957e4c /patches/server/0873-Expand-Pose-API.patch | |
parent | b57b24d549c65ddc5eb3edcc1ecc6aad2826dbd8 (diff) | |
download | Paper-2cd8c461af74f0a524878dcdffba86cd105c48c6.tar.gz Paper-2cd8c461af74f0a524878dcdffba86cd105c48c6.zip |
Add OMINOUS_ITEM_SPAWNER SpawnReason (#10897)
Diffstat (limited to 'patches/server/0873-Expand-Pose-API.patch')
-rw-r--r-- | patches/server/0873-Expand-Pose-API.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/patches/server/0873-Expand-Pose-API.patch b/patches/server/0873-Expand-Pose-API.patch new file mode 100644 index 0000000000..b1ad16fc18 --- /dev/null +++ b/patches/server/0873-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 aebe9cb97776bb833221a0f11285696c266b752b..80a29f4818cda4255c82fcd47f0da2235a02da23 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -426,6 +426,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + @javax.annotation.Nullable + private UUID originWorld; + public boolean freezeLocked = false; // Paper - Freeze Tick Lock API ++ public boolean fixedPose = false; // Paper - Expand Pose API + + public void setOrigin(@javax.annotation.Nonnull Location location) { + this.origin = location.toVector(); +@@ -619,6 +620,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + public void onClientRemoval() {} + + public void setPose(net.minecraft.world.entity.Pose pose) { ++ if (this.fixedPose) return; // Paper - Expand Pose API + // 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 b5622c5bcc97ff9241d236a35018918db5b2103a..a8b9b50991361160880b9fc0a94cad30c319e62e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +@@ -899,6 +899,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 |