Fix npe for remove and rotateHead updates yaw and pitch

This commit is contained in:
Tofaa 2024-08-08 14:21:49 +04:00
parent 266e4e6c4e
commit f24fdf6383
2 changed files with 9 additions and 2 deletions

View file

@ -121,8 +121,13 @@ public class WrapperEntity implements Tickable, TrackedEntity {
}
public void remove() {
if (parent != null) {
parent.removeEntity(this, true);
}
else {
despawn();
}
}
public void despawn() {
if (!spawned) return;
@ -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) {

View file

@ -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"