Skip to content

Commit

Permalink
Register toggle commands automatically
Browse files Browse the repository at this point in the history
Reduce the number of places I have to remember to edit things
  • Loading branch information
Jikoo committed Jul 28, 2024
1 parent 5d5fb92 commit a43e148
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugin/src/main/java/com/lishid/openinv/OpenInv.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ public void onEnable() {
this.setCommandExecutor(new SearchContainerCommand(this, languageManager), "searchcontainer");
this.setCommandExecutor(new SearchInvCommand(languageManager), "searchinv", "searchender");
this.setCommandExecutor(new SearchEnchantCommand(languageManager), "searchenchant");
this.setCommandExecutor(new ContainerSettingCommand(languageManager), "silentcontainer", "anycontainer");

ContainerSettingCommand settingCommand = new ContainerSettingCommand(languageManager);
for (PlayerToggle toggle : PlayerToggles.get()) {
setCommandExecutor(settingCommand, toggle.getName());
}

} else {
this.sendVersionError(this.getLogger()::warning);
Expand Down

0 comments on commit a43e148

Please sign in to comment.