9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2026-01-06 15:51:50 +00:00

user null check in packet

This commit is contained in:
LoJoSho
2022-11-26 09:55:03 -06:00
parent ecc1183b89
commit aab7ba4116

View File

@@ -74,7 +74,7 @@ public class PlayerGameListener implements Listener {
public void onPlayerTeleport(PlayerTeleportEvent event) {
CosmeticUser user = CosmeticUsers.getUser(event.getPlayer().getUniqueId());
user.updateCosmetic();
Bukkit.getScheduler().runTaskLater(HMCCosmeticsPlugin.getInstance(), () -> user.updateCosmetic(), 2);
}
@EventHandler
@@ -127,6 +127,7 @@ public class PlayerGameListener implements Listener {
if (windowID != 0) return;
CosmeticUser user = CosmeticUsers.getUser(player);
if (user == null) return;
for (Cosmetic cosmetic : user.getCosmetic()) {
if (!(cosmetic instanceof CosmeticArmorType)) continue;