2023-08-22 05:05:47 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: SoSeDiK <mrsosedik@gmail.com>
|
|
|
|
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
|
2023-11-04 22:11:55 +01:00
|
|
|
index 80882abd35199f95610af16698aeb0fe61f8f455..1e05fca2a2ba6e2c0b641b6e27585520889cd8a6 100644
|
2023-08-22 05:05:47 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
2023-11-03 15:05:57 +01:00
|
|
|
@@ -417,6 +417,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
2023-08-22 05:05:47 +02:00
|
|
|
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();
|
2023-11-03 15:05:57 +01:00
|
|
|
@@ -701,6 +702,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
2023-08-22 05:05:47 +02:00
|
|
|
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
|
2023-11-04 20:20:01 +01:00
|
|
|
index d57856bee23cd0fd22d0c2141c77c978dae7f8c6..90b04377088fcaf128cb35843702d2f5ead4b7f6 100644
|
2023-08-22 05:05:47 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
2023-10-03 13:55:12 +02:00
|
|
|
@@ -1243,6 +1243,20 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
2023-08-22 05:05:47 +02:00
|
|
|
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
|