9
0
mirror of https://github.com/HibiscusMC/HibiscusCommons.git synced 2025-12-19 15:09:26 +00:00

feat: check for Paper before attempting to get NMS classes

This commit is contained in:
LoJoSho
2025-01-17 13:30:57 -06:00
parent 0d4a5d826e
commit 67042106d5

View File

@@ -20,13 +20,6 @@ public final class HibiscusCommonsPlugin extends HibiscusPlugin {
public void onStart() { public void onStart() {
instance = this; instance = this;
try {
NMSHandlers.setup();
} catch (RuntimeException e) {
getServer().getPluginManager().disablePlugin(this);
return;
}
// Detects if a user is running a paper server // Detects if a user is running a paper server
if (ServerUtils.hasClass("com.destroystokyo.paper.PaperConfig") || ServerUtils.hasClass("io.papermc.paper.configuration.Configuration")) { if (ServerUtils.hasClass("com.destroystokyo.paper.PaperConfig") || ServerUtils.hasClass("io.papermc.paper.configuration.Configuration")) {
onPaper = true; onPaper = true;
@@ -38,6 +31,13 @@ public final class HibiscusCommonsPlugin extends HibiscusPlugin {
getLogger().warning("Download Paper at: https://papermc.io/"); getLogger().warning("Download Paper at: https://papermc.io/");
} }
try {
NMSHandlers.setup();
} catch (RuntimeException e) {
getServer().getPluginManager().disablePlugin(this);
return;
}
// Plugin startup logic // Plugin startup logic
Hooks.setup(); Hooks.setup();