mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-31 21:06:38 +00:00
Fixed ModelEngine being used when not present
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user