Skip to content

Commit

Permalink
Fixed disabled emojis and /emojichat reload
Browse files Browse the repository at this point in the history
  • Loading branch information
RadBuilder committed Dec 28, 2017
1 parent bd7b377 commit 15f3a2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public boolean onCommand(CommandSender sender, Command command, String s, String
sender.sendMessage(ChatColor.AQUA + "If you still can't see emojis, make sure the settings for this server (on the server list) have the resource pack option set to prompt or enabled.");
}
return true;
case "load":
case "reload":
if (!sender.hasPermission("emojichat.reload")) {
sender.sendMessage(ChatColor.RED + "You need " + ChatColor.GOLD + "emojichat.reload" + ChatColor.RED + " to use this command.");
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ private void loadShortcuts(FileConfiguration config) {
*/
private void loadDisabledEmojis(FileConfiguration config, EmojiChat plugin) {
for (String disabledEmoji : config.getStringList("disabled-emojis")) {
if (disabledEmoji == null) {
plugin.getLogger().warning("Invalid emoji specified in 'disabled-emojis': " + disabledEmoji + ". Skipping...");
if (disabledEmoji == null || !emojis.containsKey(disabledEmoji)) {
plugin.getLogger().warning("Invalid emoji specified in 'disabled-emojis': '" + disabledEmoji + "'. Skipping...");
continue;
}
disabledCharacters.add(emojis.remove(disabledEmoji)); // Remove disabled emojis from the emoji list
Expand Down Expand Up @@ -483,7 +483,7 @@ void load(EmojiChat plugin) {

if (!validateConfig(plugin.getConfig())) { // Make sure the config is valid
plugin.getLogger().warning("Your config is invalid. No configuation data was loaded.");
plugin.getLogger().warning("Fix your config, then use /emojichat load");
plugin.getLogger().warning("Fix your config, then use /emojichat reload");
plugin.getLogger().warning("If you're still running into issues after fixing your config, delete it and restart your server.");
} else { // Config is valid, load config data
loadShortcuts(plugin.getConfig()); // Loads all of the shortcuts specified in the config
Expand Down

0 comments on commit 15f3a2c

Please sign in to comment.