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

fix: check valid balloon entity before teleport

This commit is contained in:
LoJoSho
2023-03-22 19:51:56 -05:00
parent 1d303dee71
commit b397ae52f9

View File

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