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