Fix npe for remove and rotateHead updates yaw and pitch
This commit is contained in:
parent
266e4e6c4e
commit
f24fdf6383
2 changed files with 9 additions and 2 deletions
|
@ -121,7 +121,12 @@ public class WrapperEntity implements Tickable, TrackedEntity {
|
|||
}
|
||||
|
||||
public void remove() {
|
||||
parent.removeEntity(this, true);
|
||||
if (parent != null) {
|
||||
parent.removeEntity(this, true);
|
||||
}
|
||||
else {
|
||||
despawn();
|
||||
}
|
||||
}
|
||||
|
||||
public void despawn() {
|
||||
|
@ -382,6 +387,8 @@ public class WrapperEntity implements Tickable, TrackedEntity {
|
|||
new WrapperPlayServerEntityRotation(entityId, yaw, pitch, onGround),
|
||||
new WrapperPlayServerEntityHeadLook(entityId, yaw)
|
||||
);
|
||||
this.location.setYaw(yaw);
|
||||
this.location.setPitch(pitch);
|
||||
}
|
||||
|
||||
public void rotateHead(Location location) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import java.io.ByteArrayOutputStream
|
||||
|
||||
val fullVersion = "2.4.5"
|
||||
val fullVersion = "2.4.7"
|
||||
val snapshot = true
|
||||
|
||||
group = "me.tofaa.entitylib"
|
||||
|
|
Loading…
Reference in a new issue