Expand Pose API

This commit is contained in:
SoSeDiK
2023-01-11 20:59:01 +02:00
parent e39a789ec6
commit 1cb5b6e838
2 changed files with 107 additions and 92 deletions

View File

@@ -895,6 +895,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