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

Exiting wardrobe balloon fixes

This commit is contained in:
LoJoSho
2023-02-06 14:04:17 -06:00
parent c27a9ab2ad
commit 08b28bc254
2 changed files with 4 additions and 5 deletions

View File

@@ -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<Player> 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);

View File

@@ -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()) {