Expose LivingEntity hurt direction
This commit is contained in:
@@ -125,6 +125,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
}
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@Override
|
||||
public void setHurtDirection(float hurtDirection) {
|
||||
this.getHandle().hurtDir = hurtDirection;
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@Override
|
||||
public int getSleepTicks() {
|
||||
return this.getHandle().sleepCounter;
|
||||
|
||||
@@ -1024,4 +1024,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
this.getHandle().take(((CraftItem) item).getHandle(), quantity);
|
||||
}
|
||||
// Paper end - pickup animation API
|
||||
|
||||
// Paper start - hurt direction API
|
||||
@Override
|
||||
public float getHurtDirection() {
|
||||
return this.getHandle().getHurtDir();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHurtDirection(final float hurtDirection) {
|
||||
throw new UnsupportedOperationException("Cannot set the hurt direction on a non player");
|
||||
}
|
||||
// Paper end - hurt direction API
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user