Skip to content

Commit 147172a

Browse files
committed
pick develop/492cbda8d1e144ebc19ada095c46199cc497d703
isBuyCommandEnabled was ignored
1 parent 5d1992c commit 147172a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

bukkit/src/main/java/io/tebex/plugin/TebexPlugin.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ public void onEnable() {
130130
bukkitCommandMap.setAccessible(true);
131131
CommandMap commandMap = (CommandMap) bukkitCommandMap.get(Bukkit.getServer());
132132

133-
commandMap.register(getPlatformConfig().getBuyCommandName(), new BuyCommand(getPlatformConfig().getBuyCommandName(), this));
133+
if (config.isBuyCommandEnabled()) {
134+
commandMap.register(getPlatformConfig().getBuyCommandName(), new BuyCommand(getPlatformConfig().getBuyCommandName(), this));
135+
}
134136
} catch (NoSuchFieldException | IllegalAccessException e) {
135137
throw new RuntimeException("Failed to get the CommandMap", e);
136138
}

fabric/src/main/java/io/tebex/plugin/manager/CommandManager.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ public void register(CommandDispatcher<ServerCommandSource> dispatcher) {
4848
return 1;
4949
});
5050

51-
BuyCommand buyCommand = new BuyCommand(platform);
52-
dispatcher.register(literal(platform.getPlatformConfig().getBuyCommandName()).executes(buyCommand::execute));
51+
if (platform.getPlatformConfig().isBuyCommandEnabled()) {
52+
BuyCommand buyCommand = new BuyCommand(platform);
53+
dispatcher.register(literal(platform.getPlatformConfig().getBuyCommandName()).executes(buyCommand::execute));
54+
}
5355

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

0 commit comments

Comments
 (0)