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:
@@ -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);
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user