mirror of
https://github.com/Aust1n46/VentureChat.git
synced 2025-05-22 18:09:06 +00:00
Add error handling for missing default chat channel.
This commit is contained in:
parent
408fe7c90d
commit
dba9ab7d12
4
TODO.txt
4
TODO.txt
@ -42,6 +42,8 @@ Done###Add hex color support to message remover configuration
|
||||
|
||||
Done###Fix /chatreload
|
||||
|
||||
Done###Add check for missing default channel
|
||||
|
||||
|
||||
|
||||
|
||||
@ -105,4 +107,4 @@ Add custom JSON hovers to any placeholder
|
||||
|
||||
Add clans channel from SimpleClans
|
||||
|
||||
Add check for missing default channel
|
||||
Look into changing Bukkit chat event to not be cancelled.
|
||||
|
@ -6,6 +6,7 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
@ -82,6 +83,15 @@ public class ChatChannel {
|
||||
defaultColor = color;
|
||||
}
|
||||
}
|
||||
// Error handling for missing default channel in the config.
|
||||
if(defaultChatChannel == null) {
|
||||
Bukkit.getConsoleSender().sendMessage(Format.FormatStringAll("&8[&eVentureChat&8]&e - &cNo default channel found!"));
|
||||
defaultChatChannel = new ChatChannel("MissingDefault", "red", "red", "None", "None", false,
|
||||
true, true, "md", 0, true, false, 0, "&f[&cMissingDefault&f] {vault_prefix} {player_displayname}&c:");
|
||||
defaultColor = defaultChatChannel.getColor();
|
||||
chatChannels.put("missingdefault", defaultChatChannel);
|
||||
chatChannels.put("md", defaultChatChannel);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean areAliasesRegisteredAsCommands() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user