mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-22 04:33:28 +01:00
Add Entity Body Yaw API
This commit is contained in:
parent
db1df52d4c
commit
d1abd737aa
2 changed files with 39 additions and 0 deletions
paper-server/src/main/java/org/bukkit/craftbukkit/entity
|
@ -1179,6 +1179,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||||
}
|
}
|
||||||
// Paper end - entity powdered snow API
|
// 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
|
// Paper start - missing entity api
|
||||||
@Override
|
@Override
|
||||||
public boolean isInvisible() { // Paper - moved up from LivingEntity
|
public boolean isInvisible() { // Paper - moved up from LivingEntity
|
||||||
|
|
|
@ -1211,4 +1211,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||||
this.getHandle().frictionState = state;
|
this.getHandle().frictionState = state;
|
||||||
}
|
}
|
||||||
// Paper end - friction API
|
// 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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue