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
|
2024-05-29 22:58:57 +02:00
|
|
|
index 3aeb24963ce0415e97168196cbf53e8f26334013..de841b91b0a0c10c4b9f4dfdd3858c83f81ad183 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
|
2024-05-26 21:51:15 +02:00
|
|
|
@@ -420,6 +420,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
2023-12-19 02:12:55 +01:00
|
|
|
@javax.annotation.Nullable
|
2023-08-22 05:05:47 +02:00
|
|
|
private UUID originWorld;
|
|
|
|
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
|
2024-01-14 16:31:39 +01:00
|
|
|
+ public boolean fixedPose = false; // Paper - Expand Pose API
|
2023-08-22 05:05:47 +02:00
|
|
|
|
|
|
|
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
|
|
|
this.origin = location.toVector();
|
2024-05-26 21:51:15 +02:00
|
|
|
@@ -643,6 +644,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
2023-08-22 05:05:47 +02:00
|
|
|
public void onClientRemoval() {}
|
|
|
|
|
|
|
|
public void setPose(net.minecraft.world.entity.Pose pose) {
|
2024-01-14 16:31:39 +01:00
|
|
|
+ if (this.fixedPose) return; // Paper - Expand Pose API
|
2023-08-22 05:05:47 +02:00
|
|
|
// 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
|
2024-04-25 00:36:49 +02:00
|
|
|
index 96448895a0a18e6f819d0a2a629c04abd331fa85..d52b7c5739b8ea51cb91c45ddcad6237b9ce5a5e 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
|
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#10277)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
9a80d38c SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-722: Add EntityRemoveEvent
258086d9 SPIGOT-7417, PR-967: Add Sign#getTargetSide and Sign#getAllowedEditor
ffaba051 SPIGOT-7584: Add missing Tag.ITEMS_NON_FLAMMABLE_WOOD
CraftBukkit Changes:
98b6c1ac7 SPIGOT-7589 Fix NullPointerException when bans expire
a2736ddb0 SPIGOT-336, SPIGOT-3366, SPIGOT-5768, SPIGOT-6409, SPIGOT-6861, PR-1008: Add EntityRemoveEvent
5bf12cb89 SPIGOT-7565: Throw a more descriptive error message when a developer tries to spawn an entity from a CraftBukkit class
76d95fe7e SPIGOT-7417, PR-1343: Add Sign#getTargetSide and Sign#getAllowedEditor
Spigot Changes:
e9ec5485 Rebuild patches
f1b62e0c Rebuild patches
2024-02-23 14:37:33 +01:00
|
|
|
@@ -897,6 +897,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
|