From 5bec1fd1a14da46cca5edd0b67e2f84bb3e5e31b Mon Sep 17 00:00:00 2001 From: Tofaa <82680183+Tofaa2@users.noreply.github.com> Date: Sat, 10 Aug 2024 18:57:41 +0400 Subject: [PATCH] some isspawned checks --- .../main/java/me/tofaa/entitylib/wrapper/WrapperEntity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/main/java/me/tofaa/entitylib/wrapper/WrapperEntity.java b/api/src/main/java/me/tofaa/entitylib/wrapper/WrapperEntity.java index 28ee724..e40db7b 100644 --- a/api/src/main/java/me/tofaa/entitylib/wrapper/WrapperEntity.java +++ b/api/src/main/java/me/tofaa/entitylib/wrapper/WrapperEntity.java @@ -45,6 +45,7 @@ public WrapperEntity(int entityId, UUID uuid, EntityType entityType, EntityMeta this.ticking = true; this.viewers = ConcurrentHashMap.newKeySet(); this.passengers = ConcurrentHashMap.newKeySet(); + this.location = new Location(0, 0, 0, 0, 0); } public WrapperEntity(int entityId, EntityType entityType) { @@ -383,7 +384,7 @@ public boolean hasVelocity() { } public void rotateHead(float yaw, float pitch) { - sendPacketsToViewers( + sendPacketsToViewersIfSpawned( new WrapperPlayServerEntityRotation(entityId, yaw, pitch, onGround), new WrapperPlayServerEntityHeadLook(entityId, yaw) );