From b397ae52f9fceb143d24a0a054c0b0b45206538b Mon Sep 17 00:00:00 2001 From: LoJoSho Date: Wed, 22 Mar 2023 19:51:56 -0500 Subject: [PATCH] fix: check valid balloon entity before teleport --- .../hmccosmetics/cosmetic/types/CosmeticBalloonType.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/cosmetic/types/CosmeticBalloonType.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/cosmetic/types/CosmeticBalloonType.java index 3487f45a..59589194 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/cosmetic/types/CosmeticBalloonType.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/cosmetic/types/CosmeticBalloonType.java @@ -45,6 +45,11 @@ public class CosmeticBalloonType extends Cosmetic { if (player == null || userBalloonManager == null) return; if (user.isInWardrobe()) return; + if (!userBalloonManager.getModelEntity().isValid()) { + user.respawnBalloon(); + return; + } + Location newLocation = player.getLocation(); Location currentLocation = user.getBalloonManager().getLocation(); newLocation = newLocation.clone().add(Settings.getBalloonOffset());