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

Fixed teleporting error with player leaving wardrobe

This commit is contained in:
MasterOfTheFish
2022-02-26 00:50:15 -05:00
parent 607d2ea7bd
commit b3aa0b942f

View File

@@ -136,7 +136,10 @@ public class Wardrobe extends User {
this.cameraLocked = false;
this.currentLocation = null;
this.getPlayerArmor().clear();
Bukkit.getScheduler().runTask(this.plugin, () -> viewer.teleport(settings.getLeaveLocation()));
Bukkit.getScheduler().runTask(this.plugin, () -> {
if (viewer == null || !viewer.isOnline()) return;
viewer.teleport(settings.getLeaveLocation());
});
if (settings.isAlwaysDisplay()) {
this.currentLocation = settings.getWardrobeLocation();