From 5ae38b6d3e91ddb2dc28b915f0734f3669ba7429 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Fri, 25 Mar 2022 22:48:30 +0100 Subject: [PATCH] Fix NPC.hide --- src/de/steamwar/lobby/display/NPC.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/lobby/display/NPC.java b/src/de/steamwar/lobby/display/NPC.java index e24c3f2..8e0e6e5 100644 --- a/src/de/steamwar/lobby/display/NPC.java +++ b/src/de/steamwar/lobby/display/NPC.java @@ -22,6 +22,8 @@ package de.steamwar.lobby.display; import com.comphenix.tinyprotocol.Reflection; import com.comphenix.tinyprotocol.TinyProtocol; import com.mojang.authlib.GameProfile; +import de.steamwar.lobby.LobbySystem; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -143,7 +145,9 @@ public class NPC { } private void hide(Player player) { - TinyProtocol.instance.sendPacket(player, removePlayerInfo); + if (Bukkit.getOnlinePlayers().stream().noneMatch(p -> p.getUniqueId().equals(uuid))) { + TinyProtocol.instance.sendPacket(player, removePlayerInfo); + } TinyProtocol.instance.sendPacket(player, destroy); }