Skip to content

Commit

Permalink
pick develop/492cbda8d1e144ebc19ada095c46199cc497d703
Browse files Browse the repository at this point in the history
isBuyCommandEnabled was ignored
  • Loading branch information
WildBamaBoy committed Jul 5, 2024
1 parent 5d1992c commit 147172a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion bukkit/src/main/java/io/tebex/plugin/TebexPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ public void onEnable() {
bukkitCommandMap.setAccessible(true);
CommandMap commandMap = (CommandMap) bukkitCommandMap.get(Bukkit.getServer());

commandMap.register(getPlatformConfig().getBuyCommandName(), new BuyCommand(getPlatformConfig().getBuyCommandName(), this));
if (config.isBuyCommandEnabled()) {
commandMap.register(getPlatformConfig().getBuyCommandName(), new BuyCommand(getPlatformConfig().getBuyCommandName(), this));
}
} catch (NoSuchFieldException | IllegalAccessException e) {
throw new RuntimeException("Failed to get the CommandMap", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ public void register(CommandDispatcher<ServerCommandSource> dispatcher) {
return 1;
});

BuyCommand buyCommand = new BuyCommand(platform);
dispatcher.register(literal(platform.getPlatformConfig().getBuyCommandName()).executes(buyCommand::execute));
if (platform.getPlatformConfig().isBuyCommandEnabled()) {
BuyCommand buyCommand = new BuyCommand(platform);
dispatcher.register(literal(platform.getPlatformConfig().getBuyCommandName()).executes(buyCommand::execute));
}

commands.forEach(command -> {
LiteralArgumentBuilder<ServerCommandSource> subCommand = literal(command.getName());
Expand Down

0 comments on commit 147172a

Please sign in to comment.