From ea23811d3337f46b7a859b77915dc45e210177ec Mon Sep 17 00:00:00 2001 From: Angelillo15 Date: Sun, 28 Apr 2024 02:14:14 +0200 Subject: [PATCH] Add MAStaff check --- .../staff/paper/bootstrap/StaffBootstrapper.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NookureStaff-Paper/src/main/java/com/nookure/staff/paper/bootstrap/StaffBootstrapper.java b/NookureStaff-Paper/src/main/java/com/nookure/staff/paper/bootstrap/StaffBootstrapper.java index 8ac7cd7c..97306441 100644 --- a/NookureStaff-Paper/src/main/java/com/nookure/staff/paper/bootstrap/StaffBootstrapper.java +++ b/NookureStaff-Paper/src/main/java/com/nookure/staff/paper/bootstrap/StaffBootstrapper.java @@ -27,6 +27,8 @@ public class StaffBootstrapper extends JavaPlugin implements NookureStaffPlatfor @Override public void onEnable() { + checkMAStaff(); + Bukkit.getConsoleSender().sendMessage(Component.text(""" ▐ ▄ ▄ •▄ ▄• ▄▌▄▄▄ ▄▄▄ . .▄▄ · ▄▄▄▄▄ ▄▄▄· ·▄▄▄·▄▄▄ @@ -50,6 +52,15 @@ public void onEnable() { plugin.onEnable(); } + public void checkMAStaff() { + if (Bukkit.getPluginManager().getPlugin("MAStaff") != null) { + Bukkit.getConsoleSender().sendMessage(Component.text("MAStaff detected!").color(NamedTextColor.RED)); + Bukkit.getConsoleSender().sendMessage(Component.text("Please remove it to avoid conflicts.").color(NamedTextColor.RED)); + Bukkit.getConsoleSender().sendMessage(Component.text("Disabling NookureStaff...").color(NamedTextColor.RED)); + Bukkit.getPluginManager().disablePlugin(this); + } + } + private void loadDependencies() { LibraryManager manager;