mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 15:17:17 +01:00
c6aa61ee18
Updated Upstream (Bukkit/CraftBukkit/Spigot) 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: b9df8e9f SPIGOT-7933: Improve custom Minecart max speed fc496179 Fix InstrumentTest 7c0ec598 PR-1075: Make Art an interface c389f5a4 PR-1074: Make Sound an interface CraftBukkit Changes: df1efc0bb SPIGOT-7945: `Bukkit#dispatchCommand` throws `UnsupportedOperationException` 285df6e85 SPIGOT-7933: Improve custom Minecart max speed a0f3d4e50 SPIGOT-7940: Recipe book errors after reload 9e0618ec2 SPIGOT-7937: Cannot spawn minecart during world generation with minecart_improvements enabled 1eb4d28da SPIGOT-7941: Fix resistance over 4 amplify causing issues in damage 52b99158a PR-1504: Make Art an interface e18ae35f1 PR-1502: Make Sound an interface Spigot Changes: e65d67a7 SPIGOT-7934: Item entities start "bouncing" under certain conditions
51 lines
2.3 KiB
Diff
51 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 638b202519b0cca5ca7ba406e6f92c51a0ef990e..8a0b26533e6bbabe829efbf5afcef1a79cdf0adb 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -428,6 +428,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();
|
|
@@ -626,6 +627,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
|
public void onRemoval(Entity.RemovalReason reason) {}
|
|
|
|
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 dd84f7d6874a799aa09349fe0a1bd6ebb4cea2dd..11a08ff211a9a32a825519ddb1736e02cf7f685e 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
|
@@ -900,6 +900,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
|