Add Entity Body Yaw API

This commit is contained in:
TheTuso 2023-02-02 16:40:41 +01:00
parent db1df52d4c
commit d1abd737aa
2 changed files with 39 additions and 0 deletions

View File

@ -1179,6 +1179,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
// Paper end - entity powdered snow API
// Paper start - entity body yaw API
@Override
public double getX() {
return this.entity.getX();
}
@Override
public double getY() {
return this.entity.getY();
}
@Override
public double getZ() {
return this.entity.getZ();
}
@Override
public float getPitch() {
return this.entity.getXRot();
}
@Override
public float getYaw() {
return this.entity.getBukkitYaw();
}
// Paper end - entity body yaw API
// Paper start - missing entity api
@Override
public boolean isInvisible() { // Paper - moved up from LivingEntity

View File

@ -1211,4 +1211,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
this.getHandle().frictionState = state;
}
// Paper end - friction API
// Paper start - body yaw API
@Override
public float getBodyYaw() {
return this.getHandle().getVisualRotationYInDegrees();
}
@Override
public void setBodyYaw(final float bodyYaw) {
this.getHandle().setYBodyRot(bodyYaw);
}
// Paper end - body yaw API
}