Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommandReloader - fix reload issue on paper #6619

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/main/java/ch/njol/skript/bukkitutil/CommandReloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,10 @@ public class CommandReloader {

static {
try {
Class<?> craftServer;
String revision = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
craftServer = Class.forName("org.bukkit.craftbukkit." + revision + ".CraftServer");

syncCommandsMethod = craftServer.getDeclaredMethod("syncCommands");
syncCommandsMethod = Bukkit.getServer().getClass().getDeclaredMethod("syncCommands");
if (syncCommandsMethod != null)
syncCommandsMethod.setAccessible(true);
} catch (ClassNotFoundException | NoSuchMethodException e) {
} catch (NoSuchMethodException e) {
// Ignore except for debugging. This is not necessary or in any way supported functionality
if (Skript.debug())
e.printStackTrace();
Expand Down