diff --git a/pom.xml b/pom.xml index 52aaf1a..40be8e3 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.minimum.minecraft SuperbVote - 0.5.5 + 0.5.6-CORP-2 UTF-8 diff --git a/src/main/java/io/minimum/minecraft/superbvote/SuperbVote.java b/src/main/java/io/minimum/minecraft/superbvote/SuperbVote.java index 047df05..22b86ec 100644 --- a/src/main/java/io/minimum/minecraft/superbvote/SuperbVote.java +++ b/src/main/java/io/minimum/minecraft/superbvote/SuperbVote.java @@ -75,8 +75,7 @@ public void onEnable() { } getCommand("superbvote").setExecutor(new SuperbVoteCommand()); - getCommand("vote").setExecutor(configuration.getVoteCommand()); - getCommand("votestreak").setExecutor(configuration.getVoteStreakCommand()); + registerCommands(); getServer().getPluginManager().registerEvents(new SuperbVoteListener(), this); getServer().getPluginManager().registerEvents(new TopPlayerSignListener(), this); @@ -124,8 +123,7 @@ public void reloadPlugin() { scoreboardHandler.reload(); voteServiceCooldown = new VoteServiceCooldown(getConfig().getInt("votes.cooldown-per-service", 3600)); getServer().getScheduler().runTaskAsynchronously(this, getScoreboardHandler()::doPopulate); - getCommand("vote").setExecutor(configuration.getVoteCommand()); - getCommand("votestreak").setExecutor(configuration.getVoteStreakCommand()); + registerCommands(); if (voteReminderTask != null) { voteReminderTask.cancel(); @@ -141,4 +139,13 @@ public void reloadPlugin() { public ClassLoader _exposeClassLoader() { return getClassLoader(); } + + private void registerCommands() { + if (configuration.getVoteCommand() != null) { + getCommand("vote").setExecutor(configuration.getVoteCommand()); + } + if (configuration.getVoteStreakCommand() != null) { + getCommand("votestreak").setExecutor(configuration.getVoteStreakCommand()); + } + } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index cd4302b..083c3f7 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -9,11 +9,6 @@ commands: superbvote: description: SuperbVote main command. aliases: [sv] - vote: - description: SuperbVote vote command. - votestreak: - description: SuperbVote vote streak command. - aliases: [vstreak] permissions: superbvote.notify: default: true