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

clean: move nms spawn balloon method to CosmeticUser

This commit is contained in:
LoJoSho
2023-12-19 19:55:57 -06:00
parent 4a75c7b333
commit 65877bff5b
9 changed files with 11 additions and 104 deletions

View File

@@ -23,8 +23,6 @@ public interface NMSHandler {
Entity spawnDisplayEntity(Location location, String text);
UserBalloonManager spawnBalloon(CosmeticUser user, CosmeticBalloonType cosmeticBalloonType);
void slotUpdate(
Player player,
int slot

View File

@@ -385,8 +385,17 @@ public class CosmeticUser {
public void spawnBalloon(CosmeticBalloonType cosmeticBalloonType) {
if (this.userBalloonManager != null) return;
this.userBalloonManager = NMSHandlers.getHandler().spawnBalloon(this, cosmeticBalloonType);
//updateCosmetic(cosmeticBalloonType);
org.bukkit.entity.Entity entity = getEntity();
UserBalloonManager userBalloonManager1 = new UserBalloonManager(this, entity.getLocation());
userBalloonManager1.getModelEntity().teleport(entity.getLocation().add(cosmeticBalloonType.getBalloonOffset()));
userBalloonManager1.spawnModel(cosmeticBalloonType, getCosmeticColor(cosmeticBalloonType.getSlot()));
userBalloonManager1.addPlayerToModel(this, cosmeticBalloonType, getCosmeticColor(cosmeticBalloonType.getSlot()));
this.userBalloonManager = userBalloonManager1;
//this.userBalloonManager = NMSHandlers.getHandler().spawnBalloon(this, cosmeticBalloonType);
}
public void despawnBalloon() {