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-03-23 22:26:17 +01:00
|
|
|
index ecd7deadbddeb9571b2b8975214e4167c8333ce0..4db254f76bc2fb9867441016b3ac4f45f19d3bea 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
|
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
|
|
|
@@ -419,6 +419,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
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();
|
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
|
|
|
@@ -631,6 +632,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
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-03-23 22:26:17 +01:00
|
|
|
index d91d56175e91fb06138901bad56c1c2544b3d20e..a81c8a9d76c1d9fdee19132a9a40ffc2ab4d107e 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
|