diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java index a3fb06f8..30c658c1 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java @@ -45,6 +45,7 @@ public final class HMCCosmeticsPlugin extends JavaPlugin { private static boolean disable = false; private static YamlConfigurationLoader configLoader; private static final int pluginId = 13873; + private static boolean hasModelEngine = false; @Override public void onEnable() { @@ -92,6 +93,13 @@ public final class HMCCosmeticsPlugin extends JavaPlugin { if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) { new PAPIHook().register(); } + + // ModelEngine + if (Bukkit.getPluginManager().getPlugin("ModelEngine") != null) { + hasModelEngine = true; + } + + // WorldGuard if (Bukkit.getPluginManager().getPlugin("WorldGuard") != null) { getServer().getPluginManager().registerEvents(new WGListener(), this); } @@ -229,4 +237,8 @@ public final class HMCCosmeticsPlugin extends JavaPlugin { throw new RuntimeException(e); } } + + public static boolean hasModelEngine() { + return hasModelEngine; + } } diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/entities/BalloonEntity.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/entities/BalloonEntity.java index 63f0a1b3..56b83b63 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/entities/BalloonEntity.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/entities/BalloonEntity.java @@ -1,5 +1,6 @@ package com.hibiscusmc.hmccosmetics.entities; +import com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin; import com.hibiscusmc.hmccosmetics.config.Settings; import com.hibiscusmc.hmccosmetics.cosmetic.types.CosmeticBalloonType; import com.hibiscusmc.hmccosmetics.nms.NMSHandlers; @@ -33,7 +34,7 @@ public class BalloonEntity { public void spawnModel(CosmeticBalloonType cosmeticBalloonType, Color color) { // redo this - if (cosmeticBalloonType.getModelName() != null) { + if (cosmeticBalloonType.getModelName() != null && HMCCosmeticsPlugin.hasModelEngine()) { balloonType = BalloonType.MODELENGINE; } else { if (cosmeticBalloonType.getItem() != null) { diff --git a/common/src/main/resources/cosmetics/defaultcosmetics.yml b/common/src/main/resources/cosmetics/defaultcosmetics.yml index 9dea3914..9fa705f5 100644 --- a/common/src/main/resources/cosmetics/defaultcosmetics.yml +++ b/common/src/main/resources/cosmetics/defaultcosmetics.yml @@ -87,7 +87,7 @@ boots: kite: slot: BALLOON permission: "hmccosmetics.kite" - model: kite + model: kite # This is the ModelEngine model it will use. If you do not have ModelEngine installed, it will default to the item. item: material: PAPER model-data: 7