mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-01 00:10:32 +01:00
52 lines
2.3 KiB
Diff
52 lines
2.3 KiB
Diff
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
|
|
index 638aeef75dc5f7ab8b8e050118a7c709246a85f4..acf2cc8afaf4dee193ecf3bfc4a39b8c39ffc376 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -421,6 +421,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();
|
|
@@ -644,6 +645,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 96448895a0a18e6f819d0a2a629c04abd331fa85..d52b7c5739b8ea51cb91c45ddcad6237b9ce5a5e 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
@@ -897,6 +897,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
|