mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 06:36:45 +01:00
I should just rewrite this, instead I do a band-aid fix.
This commit is contained in:
parent
2165d1448e
commit
1d7bfc615f
@ -27,7 +27,7 @@ public class McMMOCommand implements CommandExecutor {
|
||||
String description = pluginRef.getLocaleManager().getString("mcMMO.Description");
|
||||
String[] mcSplit = description.split(",");
|
||||
sender.sendMessage(mcSplit);
|
||||
sender.sendMessage(LocaleLoader.getString("mcMMO.Description.FormerDevs"));
|
||||
sender.sendMessage(pluginRef.getLocaleManager().getString("mcMMO.Description.FormerDevs"));
|
||||
|
||||
if (pluginRef.getConfigManager().getConfigAds().isShowDonationInfo()) {
|
||||
sender.sendMessage(pluginRef.getLocaleManager().getString("MOTD.Donate"));
|
||||
|
@ -121,7 +121,7 @@ public abstract class ChatCommand implements TabExecutor {
|
||||
}
|
||||
|
||||
mcMMOPlayer.enableChat(chatMode);
|
||||
sender.sendMessage(chatMode.getEnabledMessage());
|
||||
sender.sendMessage(getChatModeEnabledMessage(chatMode, true));
|
||||
}
|
||||
|
||||
private void disableChatMode(McMMOPlayer mcMMOPlayer, CommandSender sender) {
|
||||
@ -131,6 +131,29 @@ public abstract class ChatCommand implements TabExecutor {
|
||||
}
|
||||
|
||||
mcMMOPlayer.disableChat(chatMode);
|
||||
sender.sendMessage(chatMode.getDisabledMessage());
|
||||
sender.sendMessage(getChatModeEnabledMessage(chatMode, false));
|
||||
}
|
||||
|
||||
private String getChatModeEnabledMessage(ChatMode chatMode, boolean enabled) {
|
||||
switch(chatMode) {
|
||||
case ADMIN:
|
||||
return getAdminMessage(enabled);
|
||||
default:
|
||||
return getPartyMessage(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
private String getAdminMessage(boolean enabled) {
|
||||
if(enabled)
|
||||
return pluginRef.getLocaleManager().getString("Commands.AdminChat.On");
|
||||
else
|
||||
return pluginRef.getLocaleManager().getString("Commands.AdminChat.Off");
|
||||
}
|
||||
|
||||
private String getPartyMessage(boolean enabled) {
|
||||
if(enabled)
|
||||
return pluginRef.getLocaleManager().getString("Commands.Party.Chat.On");
|
||||
else
|
||||
return pluginRef.getLocaleManager().getString("Commands.Party.Chat.Off");
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +1,6 @@
|
||||
package com.gmail.nossr50.datatypes.chat;
|
||||
|
||||
public enum ChatMode {
|
||||
ADMIN(pluginRef.getLocaleManager().getString("Commands.AdminChat.On"), pluginRef.getLocaleManager().getString("Commands.AdminChat.Off")),
|
||||
PARTY(pluginRef.getLocaleManager().getString("Commands.Party.Chat.On"), pluginRef.getLocaleManager().getString("Commands.Party.Chat.Off"));
|
||||
|
||||
private String enabledMessage;
|
||||
private String disabledMessage;
|
||||
|
||||
ChatMode(String enabledMessage, String disabledMessage) {
|
||||
this.enabledMessage = enabledMessage;
|
||||
this.disabledMessage = disabledMessage;
|
||||
}
|
||||
|
||||
public String getEnabledMessage() {
|
||||
return enabledMessage;
|
||||
}
|
||||
|
||||
public String getDisabledMessage() {
|
||||
return disabledMessage;
|
||||
}
|
||||
ADMIN,
|
||||
PARTY;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user