Added entity eye height

This commit is contained in:
jglrxavpok 2020-05-21 00:33:56 +02:00
parent 18a9f2485d
commit da416866f6
1 changed files with 9 additions and 0 deletions

View File

@ -58,6 +58,7 @@ public abstract class Entity implements Viewable, EventHandler, DataContainer {
// Velocity
protected Vector velocity = new Vector(); // Movement in block per second
protected float gravityDragPerTick;
protected float eyeHeight;
private Set<Player> viewers = new CopyOnWriteArraySet<>();
private Data data;
@ -653,6 +654,14 @@ public abstract class Entity implements Viewable, EventHandler, DataContainer {
return position;
}
public float getEyeHeight() {
return eyeHeight;
}
public void setEyeHeight(float eyeHeight) {
this.eyeHeight = eyeHeight;
}
/**
* @param position the checked position chunk
* @return true if the entity is in the same chunk as {@code position}