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 9846996d..ddf26058 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 @@ -48,17 +48,16 @@ public class CosmeticBalloonType extends Cosmetic { @Override public void update(CosmeticUser user) { Player player = Bukkit.getPlayer(user.getUniqueId()); - Location currentLocation = user.getBalloonEntity().getLocation(); + UserBalloonManager userBalloonManager = user.getBalloonEntity(); Location newLocation = player.getLocation(); - if (player == null || currentLocation == null || newLocation == null) return; + if (player == null || userBalloonManager == null || newLocation == null) return; if (user.isInWardrobe()) return; + Location currentLocation = user.getBalloonEntity().getLocation(); newLocation = newLocation.clone().add(Settings.getBalloonOffset()); List viewer = PacketManager.getViewers(player.getLocation()); viewer.add(player); - UserBalloonManager userBalloonManager = user.getBalloonEntity(); - if (player.getLocation().getWorld() != userBalloonManager.getLocation().getWorld()) { userBalloonManager.getModelEntity().teleport(newLocation); PacketManager.sendTeleportPacket(userBalloonManager.getPufferfishBalloonId(), newLocation, false, viewer); diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/Wardrobe.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/Wardrobe.java index 49437c92..755f05f1 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/user/Wardrobe.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/user/Wardrobe.java @@ -122,7 +122,7 @@ public class Wardrobe { //PacketManager.sendLeashPacket(VIEWER.getBalloonEntity().getModelId(), NPC_ID, viewer); PacketManager.sendTeleportPacket(VIEWER.getBalloonEntity().getPufferfishBalloonId(), npcLocation.clone().add(Settings.getBalloonOffset()), false, viewer); - PacketManager.sendTeleportPacket(VIEWER.getBalloonEntity().getModelId(), npcLocation.clone().add(Settings.getBalloonOffset()), false, viewer); + VIEWER.getBalloonEntity().getModelEntity().teleport(npcLocation.clone().add(Settings.getBalloonOffset())); } if (WardrobeSettings.getEnabledBossbar()) {