public void Tick() { if (Disguise.Level != Parent.Level && Disguise.IsSpawned) { Disguise.DespawnEntity(); Disguise.Level = Parent.Level; Disguise.SpawnEntity(); } // if (Disguise.IsSpawned) { if (Disguise.KnownPosition != Parent.KnownPosition) { Disguise.LastUpdatedTime = Parent.LastUpdatedTime; Disguise.KnownPosition = new PlayerLocation(Parent.KnownPosition.X + PositionOffset.X, Parent.KnownPosition.Y + PositionOffset.Y, Parent.KnownPosition.Z + PositionOffset.Z, Parent.KnownPosition.HeadYaw, Parent.KnownPosition.Yaw, Parent.KnownPosition.Pitch); Disguise.BroadcastMove(true); // if (Parent is OpenPlayer player) // { // player.SendMessage("Disguise pos: " + Disguise.KnownPosition); //} } } }
public void SpawnDisguise() { Disguise.Level = Parent.Level; Disguise.SpawnEntity(); }