9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-29 20:09:13 +00:00

fix: check if user is still in wardrobe before spawning npc

This commit is contained in:
LoJoSho
2023-12-20 15:38:02 -06:00
parent ca5cb25331
commit ebf09d8e0f

View File

@@ -120,6 +120,7 @@ public class UserWardrobeManager {
// NPC 2
Bukkit.getScheduler().runTaskLater(HMCCosmeticsPlugin.getInstance(), () -> {
if (!user.isInWardrobe()) return; // If a player exits the wardrobe right away, no need to spawn the NPC
PacketManager.sendFakePlayerSpawnPacket(npcLocation, WARDROBE_UUID, NPC_ID, viewer);
PacketManager.sendPlayerOverlayPacket(NPC_ID, viewer);
MessagesUtil.sendDebugMessages("Spawned Fake Player on " + npcLocation);