Skip to content

Commit

Permalink
Add showing offground sync status
Browse files Browse the repository at this point in the history
  • Loading branch information
Axionize committed Oct 26, 2024
1 parent 39e8cbd commit f194992
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class StatusCommand implements BuilderCommand {

private String globalStatusEnabledMessage;
private String globalStatusDisabledMessage;
private String globalOffGroundStatusEnabledMessage;
private String globalOffGroundStatusDisabledMessage;
private String playerStatusEnabledMessage;
private String playerStatusDisabledMessage;
private String playerStatusGlobalDisabledMessage;
Expand Down Expand Up @@ -54,8 +56,10 @@ public void register(CommandManager<Sender> manager) {
// Show global status
boolean globalStatus = configManager.isToggled();
sender.sendMessage(ChatUtil.translateAlternateColorCodes('&',
(globalStatus ? globalStatusEnabledMessage : globalStatusDisabledMessage))
);
(globalStatus ? globalStatusEnabledMessage : globalStatusDisabledMessage)
+ "\n"
+ (globalStatus ? globalOffGroundStatusEnabledMessage : globalOffGroundStatusDisabledMessage)
));

if (sender.hasPermission(STATUS_SELF_PERMISSION, true)) {
// Show player status for the sender (no target specified)
Expand Down Expand Up @@ -100,9 +104,13 @@ public void onConfigReload(ConfigReloadEvent event) {
private void updateConfigValues() {
ConfigWrapper config = configManager.getConfigWrapper();
this.globalStatusEnabledMessage = config.getString("messages.status.global.enabled",
"&eGlobal KnockbackSync status: &aEnabled");
"&KnockbackSync global status: &aEnabled");
this.globalStatusDisabledMessage = config.getString("messages.status.global.disabled",
"&eGlobal KnockbackSync status: &cDisabled");
"&KnockbackSync global status: &cDisabled");
this.globalOffGroundStatusEnabledMessage = config.getString("messages.status.offground.enabled",
"&eKnockbackSync off-ground status: &aEnabled");
this.globalOffGroundStatusDisabledMessage = config.getString("messages.status.offground.disabled",
"&eKnockbackSync off-ground status: &cDisabled");
this.playerStatusEnabledMessage = config.getString("messages.status.player.enabled",
"&e%player%'s KnockbackSync status: &aEnabled");
this.playerStatusDisabledMessage = config.getString("messages.status.player.disabled",
Expand Down
7 changes: 5 additions & 2 deletions common/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,11 @@ messages:
success: "&aSuccessfully reloaded KnockbackSync."
status:
global:
enabled: "&eGlobal KnockbackSync status: &aEnabled"
disabled: "&eGlobal KnockbackSync status: &cDisabled"
enabled: "&KnockbackSync global status: &aEnabled"
disabled: "&KnockbackSync global status: &cDisabled"
offground:
enabled: "&eKnockbackSync off-ground status: &aEnabled"
disabled: "&eKnockbackSync off-ground status: &cDisabled"
player:
enabled: "&e%player%'s KnockbackSync status: &aEnabled"
disabled: "&e%player%'s KnockbackSync status: &cDisabled"
Expand Down

0 comments on commit f194992

Please sign in to comment.