From 98fd0409fd58ee9f955cb5e1a88b1b0ccb588519 Mon Sep 17 00:00:00 2001 From: JaTiTV Date: Tue, 28 Feb 2023 00:15:48 +0100 Subject: [PATCH] load bugfix Fixed an error that occurred when loading the plugin, because since paper build 404 the T2CodeLib was loaded only after OPSecurity --- .../java/net/t2code/opsecurity/system/Main.java | 14 ++++++++++++++ OpSecurity V3/src/main/resources/plugin.yml | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/OpSecurity V3/src/main/java/net/t2code/opsecurity/system/Main.java b/OpSecurity V3/src/main/java/net/t2code/opsecurity/system/Main.java index ea221aa..1fff834 100644 --- a/OpSecurity V3/src/main/java/net/t2code/opsecurity/system/Main.java +++ b/OpSecurity V3/src/main/java/net/t2code/opsecurity/system/Main.java @@ -32,6 +32,20 @@ public final class Main extends JavaPlugin { autor = this.getDescription().getAuthors(); version = this.getDescription().getVersion(); if (pluginNotFound("T2CodeLib", 96388, Util.getRequiredT2CodeLibVersion())) return; + load(); + + + } + private static void load(){ + if (!Bukkit.getPluginManager().getPlugin("T2CodeLib").isEnabled()){ + Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() { + @Override + public void run() { + load(); + } + },5L); + return; + } t2codeLib = true; Load.onLoad(plugin,autor,version); } diff --git a/OpSecurity V3/src/main/resources/plugin.yml b/OpSecurity V3/src/main/resources/plugin.yml index 936db6c..b37b12c 100644 --- a/OpSecurity V3/src/main/resources/plugin.yml +++ b/OpSecurity V3/src/main/resources/plugin.yml @@ -6,9 +6,10 @@ api-version: 1.13 load: STARTUP prefix: T2C-OPSecurity authors: [ JaTiTV ] + softdepend: - T2CodeLib - - OPSecurity + commands: t2c-opsecurity: aliases: [opsec, opsecurity] \ No newline at end of file