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

Fix balloon teleport fix not checking if player has balloon

This commit is contained in:
LoJoSho
2023-02-24 09:02:16 -06:00
parent 894e4eef26
commit 8bc84cbdd2

View File

@@ -133,14 +133,14 @@ public class PlayerGameListener implements Listener {
return;
}
final Cosmetic cosmetic = user.getCosmetic(CosmeticSlot.BALLOON);
final Color color = user.getCosmeticColor(CosmeticSlot.BALLOON);
user.removeCosmeticSlot(CosmeticSlot.BALLOON);
if (user.hasCosmeticInSlot(CosmeticSlot.BALLOON)) {
user.despawnBalloon();
Bukkit.getScheduler().runTaskLater(HMCCosmeticsPlugin.getInstance(), () -> {
user.addPlayerCosmetic(cosmetic, color);
user.updateCosmetic();
}, 4);
Bukkit.getScheduler().runTaskLater(HMCCosmeticsPlugin.getInstance(), () -> {
user.spawnBalloon((CosmeticBalloonType) user.getCosmetic(CosmeticSlot.BALLOON));
user.updateCosmetic();
}, 4);
}
}
@EventHandler