From c22e95af3e1b3dae627d1c5f440ab1c4c29e2047 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Fri, 13 Dec 2024 16:51:20 +0100 Subject: [PATCH] Add a polite notice if you don't have ProtocolLib --- src/main/java/eu/m724/tweaks/TweaksPlugin.java | 7 +++++++ src/main/resources/plugin.yml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/m724/tweaks/TweaksPlugin.java b/src/main/java/eu/m724/tweaks/TweaksPlugin.java index b829fcd..eff2bf2 100644 --- a/src/main/java/eu/m724/tweaks/TweaksPlugin.java +++ b/src/main/java/eu/m724/tweaks/TweaksPlugin.java @@ -34,6 +34,13 @@ public class TweaksPlugin extends MStatsPlugin { public void onEnable() { long start = System.nanoTime(); + if (getServer().getPluginManager().getPlugin("ProtocolLib") == null) { + getLogger().severe("ProtocolLib is required for this plugin."); + getLogger().severe("https://www.spigotmc.org/resources/protocollib.1997/"); + getServer().getPluginManager().disablePlugin(this); + return; + } + TweaksConfig config = TweaksConfig.load(this); new Language(Locale.US); // TODO diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index a5bbdfc..c8b67c3 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -5,7 +5,7 @@ website: https://www.spigotmc.org/resources/tweaks724.121057/ main: eu.m724.tweaks.TweaksPlugin api-version: 1.21.1 -depend: [ProtocolLib] +softdepend: [ProtocolLib] libraries: - eu.m724:mstats-spigot:0.1.0