Resolve more merge conflicts due to file system layout change.

This commit is contained in:
Aust1n46 2021-07-29 23:45:17 -04:00
parent 81ffcda38b
commit d20e2c0535
9 changed files with 4246 additions and 4213 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,454 +1,457 @@
package mineverse.Aust1n46.chat.channel; package mineverse.Aust1n46.chat.channel;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import mineverse.Aust1n46.chat.MineverseChat; import mineverse.Aust1n46.chat.MineverseChat;
import mineverse.Aust1n46.chat.utilities.Format; import mineverse.Aust1n46.chat.utilities.Format;
/** /**
* Chat channel object pojo. Class also contains static initialization methods * Chat channel object pojo. Class also contains static initialization methods
* for reading chat channels from the config file. * for reading chat channels from the config file.
* *
* @author Aust1n46 * @author Aust1n46
*/ */
public class ChatChannel { public class ChatChannel {
private static final String PERMISSION_PREFIX = "venturechat."; private static final String PERMISSION_PREFIX = "venturechat.";
private static final String NO_PERMISSIONS = "venturechat.none"; private static final String NO_PERMISSIONS = "venturechat.none";
private static MineverseChat plugin = MineverseChat.getInstance(); private static boolean aliasesRegisteredAsCommands;
private static ChatChannel defaultChatChannel;
private static boolean aliasesRegisteredAsCommands; private static MineverseChat plugin = MineverseChat.getInstance();
private static ChatChannel defaultChatChannel;
@Deprecated private static String defaultColor;
private static ChatChannel[] channels; private static HashMap<String, ChatChannel> chatChannels;
private static String defaultColor; @Deprecated
private static HashMap<String, ChatChannel> chatChannels; private static ChatChannel[] channels;
private String name; private String name;
private String permission; private String permission;
private String speakPermission; private String speakPermission;
private boolean mutable; private boolean mutable;
private String color; private String color;
private String chatColor; private String chatColor;
private boolean defaultChannel; private boolean defaultChannel;
private boolean autojoin; private boolean autojoin;
private String alias; private String alias;
private double distance; private double distance;
private boolean filter; private boolean filter;
private boolean bungee; private boolean bungee;
private String format; private String format;
private int cooldown; private int cooldown;
/** /**
* Read chat channels from config file and initialize channel array. * Read chat channels from config file and initialize channel array.
*/ */
public static void initialize(boolean aliasesRegisteredAsCommands) { public static void initialize(boolean aliasesRegisteredAsCommands) {
chatChannels = new HashMap<String, ChatChannel>(); chatChannels = new HashMap<String, ChatChannel>();
ChatChannel.aliasesRegisteredAsCommands = aliasesRegisteredAsCommands; ChatChannel.aliasesRegisteredAsCommands = aliasesRegisteredAsCommands;
ConfigurationSection cs = plugin.getConfig().getConfigurationSection("channels"); ConfigurationSection cs = plugin.getConfig().getConfigurationSection("channels");
int len = (cs.getKeys(false)).size(); int len = (cs.getKeys(false)).size();
channels = new ChatChannel[len]; channels = new ChatChannel[len];
int counter = 0; int counter = 0;
for (String key : cs.getKeys(false)) { for (String key : cs.getKeys(false)) {
String color = cs.getString(key + ".color", "white"); String color = cs.getString(key + ".color", "white");
String chatColor = cs.getString(key + ".chatcolor", "white"); String chatColor = cs.getString(key + ".chatcolor", "white");
String name = key; String name = key;
String permission = cs.getString(key + ".permissions", "None"); String permission = cs.getString(key + ".permissions", "None");
String speakPermission = cs.getString(key + ".speak_permissions", "None"); String speakPermission = cs.getString(key + ".speak_permissions", "None");
boolean mutable = cs.getBoolean(key + ".mutable", false); boolean mutable = cs.getBoolean(key + ".mutable", false);
boolean filter = cs.getBoolean(key + ".filter", true); boolean filter = cs.getBoolean(key + ".filter", true);
boolean bungee = cs.getBoolean(key + ".bungeecord", false); boolean bungee = cs.getBoolean(key + ".bungeecord", false);
String format = cs.getString(key + ".format", "Default"); String format = cs.getString(key + ".format", "Default");
boolean defaultChannel = cs.getBoolean(key + ".default", false); boolean defaultChannel = cs.getBoolean(key + ".default", false);
String alias = cs.getString(key + ".alias", "None"); String alias = cs.getString(key + ".alias", "None");
double distance = cs.getDouble(key + ".distance", (double) 0); double distance = cs.getDouble(key + ".distance", (double) 0);
int cooldown = cs.getInt(key + ".cooldown", 0); int cooldown = cs.getInt(key + ".cooldown", 0);
boolean autojoin = cs.getBoolean(key + ".autojoin", false); boolean autojoin = cs.getBoolean(key + ".autojoin", false);
ChatChannel chatChannel = new ChatChannel(name, color, chatColor, permission, speakPermission, mutable, ChatChannel chatChannel = new ChatChannel(name, color, chatColor, permission, speakPermission, mutable,
filter, defaultChannel, alias, distance, autojoin, bungee, cooldown, format); filter, defaultChannel, alias, distance, autojoin, bungee, cooldown, format);
channels[counter++] = chatChannel; channels[counter++] = chatChannel;
chatChannels.put(name.toLowerCase(), chatChannel); chatChannels.put(name.toLowerCase(), chatChannel);
chatChannels.put(alias.toLowerCase(), chatChannel); chatChannels.put(alias.toLowerCase(), chatChannel);
if (defaultChannel) { if (defaultChannel) {
defaultChatChannel = chatChannel; defaultChatChannel = chatChannel;
defaultColor = color; defaultColor = color;
} }
} }
} }
public static boolean areAliasesRegisteredAsCommands() { public static boolean areAliasesRegisteredAsCommands() {
return aliasesRegisteredAsCommands; return aliasesRegisteredAsCommands;
} }
/** /**
* Get array of chat channels. * Get array of chat channels.
* *
* @return {@link ChatChannel}[] * @return {@link ChatChannel}[]
*/ */
@Deprecated @Deprecated
public static ChatChannel[] getChannels() { public static ChatChannel[] getChannels() {
return channels; return channels;
} }
/** /**
* Get list of chat channels. * Get list of chat channels.
* *
* @return {@link Collection}&lt{@link ChatChannel}&gt * @return {@link Collection}&lt{@link ChatChannel}&gt
*/ */
public static Collection<ChatChannel> getChatChannels() { public static Collection<ChatChannel> getChatChannels() {
return new HashSet<ChatChannel>(chatChannels.values()); return new HashSet<ChatChannel>(chatChannels.values());
} }
/** /**
* Get a chat channel by name. * Get a chat channel by name.
* *
* @param channelName name of channel to get. * @param channelName
* @return {@link ChatChannel} * name of channel to get.
*/ * @return {@link ChatChannel}
public static ChatChannel getChannel(String channelName) { */
return chatChannels.get(channelName.toLowerCase()); public static ChatChannel getChannel(String channelName) {
} return chatChannels.get(channelName.toLowerCase());
}
/**
* Checks if the chat channel exists. /**
* * Checks if the chat channel exists.
* @param channelName name of channel to check. *
* @return true if channel exists, false otherwise. * @param channelName
*/ * name of channel to check.
public static boolean isChannel(String channelName) { * @return true if channel exists, false otherwise.
return getChannel(channelName) != null; */
} public static boolean isChannel(String channelName) {
return getChannel(channelName) != null;
/** }
* Get default chat channel color.
* /**
* @return {@link String} * Get default chat channel color.
*/ *
public static String getDefaultColor() { * @return {@link String}
return defaultColor; */
} public static String getDefaultColor() {
return defaultColor;
/** }
* Get default chat channel.
* /**
* @return {@link ChatChannel} * Get default chat channel.
*/ *
public static ChatChannel getDefaultChannel() { * @return {@link ChatChannel}
return defaultChatChannel; */
} public static ChatChannel getDefaultChannel() {
return defaultChatChannel;
/** }
* Get list of chat channels with autojoin set to true.
* /**
* @return {@link List}&lt{@link ChatChannel}&gt * Get list of chat channels with autojoin set to true.
*/ *
public static List<ChatChannel> getAutojoinList() { * @return {@link List}&lt{@link ChatChannel}&gt
List<ChatChannel> joinlist = new ArrayList<ChatChannel>(); */
for (ChatChannel c : channels) { public static List<ChatChannel> getAutojoinList() {
if (c.getAutojoin()) { List<ChatChannel> joinlist = new ArrayList<ChatChannel>();
joinlist.add(c); for (ChatChannel c : channels) {
} if (c.getAutojoin()) {
} joinlist.add(c);
return joinlist; }
} }
return joinlist;
/** }
* Parameterized constructor a {@link ChatChannel}.
* /**
* @param name * Parameterized constructor a {@link ChatChannel}.
* @param color *
* @param chatColor * @param name
* @param permission * @param color
* @param speakPermission * @param chatColor
* @param mutable * @param permission
* @param filter * @param speakPermission
* @param defaultChannel * @param mutable
* @param alias * @param filter
* @param distance * @param defaultChannel
* @param autojoin * @param alias
* @param bungee * @param distance
* @param cooldown * @param autojoin
* @param format * @param bungee
*/ * @param cooldown
public ChatChannel(String name, String color, String chatColor, String permission, String speakPermission, * @param format
boolean mutable, boolean filter, boolean defaultChannel, String alias, double distance, boolean autojoin, */
boolean bungee, int cooldown, String format) { public ChatChannel(String name, String color, String chatColor, String permission, String speakPermission,
this.name = name; boolean mutable, boolean filter, boolean defaultChannel, String alias, double distance, boolean autojoin,
this.color = color; boolean bungee, int cooldown, String format) {
this.chatColor = chatColor; this.name = name;
this.permission = PERMISSION_PREFIX + permission; this.color = color;
this.speakPermission = PERMISSION_PREFIX + speakPermission; this.chatColor = chatColor;
this.mutable = mutable; this.permission = PERMISSION_PREFIX + permission;
this.filter = filter; this.speakPermission = PERMISSION_PREFIX + speakPermission;
this.defaultChannel = defaultChannel; this.mutable = mutable;
this.alias = alias; this.filter = filter;
this.distance = distance; this.defaultChannel = defaultChannel;
this.autojoin = autojoin; this.alias = alias;
this.bungee = bungee; this.distance = distance;
this.cooldown = cooldown; this.autojoin = autojoin;
this.format = format; this.bungee = bungee;
} this.cooldown = cooldown;
this.format = format;
/** }
* Deprecated parameterized constructor a {@link ChatChannel}.
* /**
* @param name * Deprecated parameterized constructor a {@link ChatChannel}.
* @param color *
* @param chatColor * @param name
* @param permission * @param color
* @param speakPermission * @param chatColor
* @param mutable * @param permission
* @param filter * @param speakPermission
* @param defaultChannel * @param mutable
* @param alias * @param filter
* @param distance * @param defaultChannel
* @param autojoin * @param alias
* @param bungee * @param distance
* @param cooldown * @param autojoin
* @param format * @param bungee
*/ * @param cooldown
@Deprecated * @param format
public ChatChannel(String name, String color, String chatColor, String permission, String speakPermission, */
Boolean mutable, Boolean filter, Boolean defaultChannel, String alias, Double distance, Boolean autojoin, @Deprecated
Boolean bungee, int cooldown, String format) { public ChatChannel(String name, String color, String chatColor, String permission, String speakPermission,
this.name = name; Boolean mutable, Boolean filter, Boolean defaultChannel, String alias, Double distance, Boolean autojoin,
this.color = color; Boolean bungee, int cooldown, String format) {
this.chatColor = chatColor; this.name = name;
this.permission = PERMISSION_PREFIX + permission; this.color = color;
this.speakPermission = PERMISSION_PREFIX + speakPermission; this.chatColor = chatColor;
this.mutable = mutable; this.permission = PERMISSION_PREFIX + permission;
this.filter = filter; this.speakPermission = PERMISSION_PREFIX + speakPermission;
this.defaultChannel = defaultChannel; this.mutable = mutable;
this.alias = alias; this.filter = filter;
this.distance = distance; this.defaultChannel = defaultChannel;
this.autojoin = autojoin; this.alias = alias;
this.bungee = bungee; this.distance = distance;
this.cooldown = cooldown; this.autojoin = autojoin;
this.format = format; this.bungee = bungee;
} this.cooldown = cooldown;
this.format = format;
/** }
* Get the name of the chat channel.
* /**
* @return {@link String} * Get the name of the chat channel.
*/ *
public String getName() { * @return {@link String}
return name; */
} public String getName() {
return name;
/** }
* Get the format of the chat channel.
* /**
* @return {@link String} * Get the format of the chat channel.
*/ *
public String getFormat() { * @return {@link String}
return format; */
} public String getFormat() {
return format;
/** }
* Get the cooldown of the chat channel in seconds.
* /**
* @return int * Get the cooldown of the chat channel in seconds.
*/ *
public int getCooldown() { * @return int
return cooldown; */
} public int getCooldown() {
return cooldown;
/** }
* Check if the chat channel is BungeeCord enabled.
* /**
* @return {@link Boolean#TRUE} if the chat channel is BungeeCord enabled, * Check if the chat channel is BungeeCord enabled.
* {@link Boolean#FALSE} otherwise. *
*/ * @return {@link Boolean#TRUE} if the chat channel is BungeeCord enabled,
public Boolean getBungee() { * {@link Boolean#FALSE} otherwise.
return Boolean.valueOf(bungee); */
} public Boolean getBungee() {
return Boolean.valueOf(bungee);
/** }
* Get the permissions node for the chat channel.
* /**
* @return {@link String} * Get the permissions node for the chat channel.
*/ *
public String getPermission() { * @return {@link String}
return permission; */
} public String getPermission() {
return permission;
/** }
* Check if autojoin is enabled for the chat channel.
* /**
* @return {@link Boolean#TRUE} if autojoin is enabled, {@link Boolean#FALSE} * Check if autojoin is enabled for the chat channel.
* otherwise. *
*/ * @return {@link Boolean#TRUE} if autojoin is enabled, {@link Boolean#FALSE}
public Boolean getAutojoin() { * otherwise.
return Boolean.valueOf(autojoin); */
} public Boolean getAutojoin() {
return Boolean.valueOf(autojoin);
/** }
* Check if the chat channel allows muting.
* /**
* @return {@link Boolean#TRUE} if muting is allowed, {@link Boolean#FALSE} * Check if the chat channel allows muting.
* otherwise. *
*/ * @return {@link Boolean#TRUE} if muting is allowed, {@link Boolean#FALSE}
public Boolean isMutable() { * otherwise.
return Boolean.valueOf(mutable); */
} public Boolean isMutable() {
return Boolean.valueOf(mutable);
/** }
* Get the formatted color of the chat channel.
* /**
* @return {@link String}. Returns {@link Format#DEFAULT_COLOR_CODE} if the * Get the formatted color of the chat channel.
* color is invalid. *
*/ * @return {@link String}. Returns {@link Format#DEFAULT_COLOR_CODE} if the
public String getColor() { * color is invalid.
if (Format.isValidColor(color)) { */
return String.valueOf(ChatColor.valueOf(color.toUpperCase())); public String getColor() {
} if (Format.isValidColor(color)) {
if (Format.isValidHexColor(color)) { return String.valueOf(ChatColor.valueOf(color.toUpperCase()));
return Format.convertHexColorCodeToBukkitColorCode(color); }
} if (Format.isValidHexColor(color)) {
return Format.DEFAULT_COLOR_CODE; return Format.convertHexColorCodeToBukkitColorCode(color);
} }
return Format.DEFAULT_COLOR_CODE;
/** }
* Get the raw color value of the chat channel.
* /**
* @return {@link String} * Get the raw color value of the chat channel.
*/ *
public String getColorRaw() { * @return {@link String}
return color; */
} public String getColorRaw() {
return color;
/** }
* Get the formatted chat color of the chat channel.
* /**
* @return {@link String}. Returns {@link Format#DEFAULT_COLOR_CODE} if the chat * Get the formatted chat color of the chat channel.
* color is invalid. *
*/ * @return {@link String}. Returns {@link Format#DEFAULT_COLOR_CODE} if the chat
public String getChatColor() { * color is invalid.
if (chatColor.equalsIgnoreCase("None")) { */
return chatColor; public String getChatColor() {
} if (chatColor.equalsIgnoreCase("None")) {
if (Format.isValidColor(chatColor)) { return chatColor;
return String.valueOf(ChatColor.valueOf(chatColor.toUpperCase())); }
} if (Format.isValidColor(chatColor)) {
if (Format.isValidHexColor(chatColor)) { return String.valueOf(ChatColor.valueOf(chatColor.toUpperCase()));
return Format.convertHexColorCodeToBukkitColorCode(chatColor); }
} if (Format.isValidHexColor(chatColor)) {
return Format.DEFAULT_COLOR_CODE; return Format.convertHexColorCodeToBukkitColorCode(chatColor);
} }
return Format.DEFAULT_COLOR_CODE;
/** }
* Get the raw chat color value of the chat channel.
* /**
* @return {@link String} * Get the raw chat color value of the chat channel.
*/ *
public String getChatColorRaw() { * @return {@link String}
return chatColor; */
} public String getChatColorRaw() {
return chatColor;
/** }
* Check if the chat channel is the default chat channel.
* /**
* @return {@link Boolean#TRUE} if the chat channel is the default chat channel, * Check if the chat channel is the default chat channel.
* {@link Boolean#FALSE} otherwise. *
*/ * @return {@link Boolean#TRUE} if the chat channel is the default chat channel,
public Boolean isDefaultchannel() { * {@link Boolean#FALSE} otherwise.
return Boolean.valueOf(defaultChannel); */
} public Boolean isDefaultchannel() {
return Boolean.valueOf(defaultChannel);
/** }
* Get the alias of the chat channel.
* /**
* @return {@link String} * Get the alias of the chat channel.
*/ *
public String getAlias() { * @return {@link String}
return alias; */
} public String getAlias() {
return alias;
/** }
* Get the distance of the chat channel in blocks.
* /**
* @return {@link Double} * Get the distance of the chat channel in blocks.
*/ *
public Double getDistance() { * @return {@link Double}
return Double.valueOf(distance); */
} public Double getDistance() {
return Double.valueOf(distance);
/** }
* Checks if the chat channel has a distance set.
* /**
* @return {@link Boolean#TRUE} if the distance is greater than zero, * Checks if the chat channel has a distance set.
* {@link Boolean#FALSE} otherwise. *
*/ * @return {@link Boolean#TRUE} if the distance is greater than zero,
public Boolean hasDistance() { * {@link Boolean#FALSE} otherwise.
return Boolean.valueOf(distance > 0); */
} public Boolean hasDistance() {
return Boolean.valueOf(distance > 0);
/** }
* Checks if the chat channel has a cooldown set.
* /**
* @return {@link Boolean#TRUE} if the cooldown is greater than zero, * Checks if the chat channel has a cooldown set.
* {@link Boolean#FALSE} otherwise. *
*/ * @return {@link Boolean#TRUE} if the cooldown is greater than zero,
public Boolean hasCooldown() { * {@link Boolean#FALSE} otherwise.
return Boolean.valueOf(cooldown > 0); */
} public Boolean hasCooldown() {
return Boolean.valueOf(cooldown > 0);
/** }
* Checks if the chat channel has a permission set.
* /**
* @return {@link Boolean#TRUE} if the permission does not equal * Checks if the chat channel has a permission set.
* {@link ChatChannel#NO_PERMISSIONS}, {@link Boolean#FALSE} otherwise. *
*/ * @return {@link Boolean#TRUE} if the permission does not equal
public Boolean hasPermission() { * {@link ChatChannel#NO_PERMISSIONS}, {@link Boolean#FALSE} otherwise.
return Boolean.valueOf(!permission.equalsIgnoreCase(NO_PERMISSIONS)); */
} public Boolean hasPermission() {
return Boolean.valueOf(!permission.equalsIgnoreCase(NO_PERMISSIONS));
/** }
* Checks if the chat channel has a speak permission set.
* /**
* @return true if the speak permission does not equal * Checks if the chat channel has a speak permission set.
* {@link ChatChannel#NO_PERMISSIONS}, false otherwise. *
*/ * @return true if the speak permission does not equal
public boolean hasSpeakPermission() { * {@link ChatChannel#NO_PERMISSIONS}, false otherwise.
return !speakPermission.equalsIgnoreCase(NO_PERMISSIONS); */
} public boolean hasSpeakPermission() {
return !speakPermission.equalsIgnoreCase(NO_PERMISSIONS);
/** }
* Get the speak permissions node for the chat channel.
* /**
* @return {@link String} * Get the speak permissions node for the chat channel.
*/ *
public String getSpeakPermission() { * @return {@link String}
return speakPermission; */
} public String getSpeakPermission() {
return speakPermission;
/** }
* Checks if the chat channel has the filter enabled.
* /**
* @return {@link Boolean#TRUE} if the chat channel has the filter enabled, * Checks if the chat channel has the filter enabled.
* {@link Boolean#FALSE} otherwise. *
*/ * @return {@link Boolean#TRUE} if the chat channel has the filter enabled,
public Boolean isFiltered() { * {@link Boolean#FALSE} otherwise.
return Boolean.valueOf(filter); */
} public Boolean isFiltered() {
return Boolean.valueOf(filter);
/** }
* Compares the chat channel by name to determine equality.
* /**
* @param channel Object to compare for equality. * Compares the chat channel by name to determine equality.
* @return true if the objects are equal, false otherwise. *
*/ * @param channel
@Override * Object to compare for equality.
public boolean equals(Object channel) { * @return true if the objects are equal, false otherwise.
return channel instanceof ChatChannel && this.name.equals(((ChatChannel) channel).getName()); */
} @Override
} public boolean equals(Object channel) {
return channel instanceof ChatChannel && this.name.equals(((ChatChannel) channel).getName());
}
}

View File

@ -1,134 +1,142 @@
package mineverse.Aust1n46.chat.command; package mineverse.Aust1n46.chat.command;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.TabExecutor; import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import mineverse.Aust1n46.chat.MineverseChat;
import mineverse.Aust1n46.chat.command.chat.Broadcast; import mineverse.Aust1n46.chat.MineverseChat;
import mineverse.Aust1n46.chat.command.chat.BungeeToggle; import mineverse.Aust1n46.chat.command.chat.Broadcast;
import mineverse.Aust1n46.chat.command.chat.Channel; import mineverse.Aust1n46.chat.command.chat.BungeeToggle;
import mineverse.Aust1n46.chat.command.chat.Channelinfo; import mineverse.Aust1n46.chat.command.chat.Channel;
import mineverse.Aust1n46.chat.command.chat.Chatinfo; import mineverse.Aust1n46.chat.command.chat.Channelinfo;
import mineverse.Aust1n46.chat.command.chat.Chatreload; import mineverse.Aust1n46.chat.command.chat.Chatinfo;
import mineverse.Aust1n46.chat.command.chat.Chlist; import mineverse.Aust1n46.chat.command.chat.Chatreload;
import mineverse.Aust1n46.chat.command.chat.Chwho; import mineverse.Aust1n46.chat.command.chat.Chlist;
import mineverse.Aust1n46.chat.command.chat.Clearchat; import mineverse.Aust1n46.chat.command.chat.Chwho;
import mineverse.Aust1n46.chat.command.chat.Commandblock; import mineverse.Aust1n46.chat.command.chat.Clearchat;
import mineverse.Aust1n46.chat.command.chat.Commandspy; import mineverse.Aust1n46.chat.command.chat.Commandblock;
import mineverse.Aust1n46.chat.command.chat.Config; import mineverse.Aust1n46.chat.command.chat.Commandspy;
import mineverse.Aust1n46.chat.command.chat.Edit; import mineverse.Aust1n46.chat.command.chat.Config;
import mineverse.Aust1n46.chat.command.chat.Filter; import mineverse.Aust1n46.chat.command.chat.Edit;
import mineverse.Aust1n46.chat.command.chat.Force; import mineverse.Aust1n46.chat.command.chat.Filter;
import mineverse.Aust1n46.chat.command.chat.Forceall; import mineverse.Aust1n46.chat.command.chat.Force;
import mineverse.Aust1n46.chat.command.chat.Kickchannel; import mineverse.Aust1n46.chat.command.chat.Forceall;
import mineverse.Aust1n46.chat.command.chat.Kickchannelall; import mineverse.Aust1n46.chat.command.chat.Kickchannel;
import mineverse.Aust1n46.chat.command.chat.Leave; import mineverse.Aust1n46.chat.command.chat.Kickchannelall;
import mineverse.Aust1n46.chat.command.chat.Listen; import mineverse.Aust1n46.chat.command.chat.Leave;
import mineverse.Aust1n46.chat.command.chat.Me; import mineverse.Aust1n46.chat.command.chat.Listen;
import mineverse.Aust1n46.chat.command.chat.Nick; import mineverse.Aust1n46.chat.command.chat.Me;
import mineverse.Aust1n46.chat.command.chat.Party; import mineverse.Aust1n46.chat.command.chat.Nick;
import mineverse.Aust1n46.chat.command.chat.RangedSpy; import mineverse.Aust1n46.chat.command.chat.Party;
import mineverse.Aust1n46.chat.command.chat.Removemessage; import mineverse.Aust1n46.chat.command.chat.RangedSpy;
import mineverse.Aust1n46.chat.command.chat.Setchannel; import mineverse.Aust1n46.chat.command.chat.Removemessage;
import mineverse.Aust1n46.chat.command.chat.Setchannelall; import mineverse.Aust1n46.chat.command.chat.Setchannel;
import mineverse.Aust1n46.chat.command.chat.VentureChatGui; import mineverse.Aust1n46.chat.command.chat.Setchannelall;
import mineverse.Aust1n46.chat.command.chat.Venturechat; import mineverse.Aust1n46.chat.command.chat.VentureChatGui;
import mineverse.Aust1n46.chat.command.message.IgnoreCommandExecutor; import mineverse.Aust1n46.chat.command.chat.Venturechat;
import mineverse.Aust1n46.chat.command.message.MessageCommandExecutor; import mineverse.Aust1n46.chat.command.message.IgnoreCommandExecutor;
import mineverse.Aust1n46.chat.command.message.MessageToggle; import mineverse.Aust1n46.chat.command.message.MessageCommandExecutor;
import mineverse.Aust1n46.chat.command.message.Notifications; import mineverse.Aust1n46.chat.command.message.MessageToggle;
import mineverse.Aust1n46.chat.command.message.Reply; import mineverse.Aust1n46.chat.command.message.Notifications;
import mineverse.Aust1n46.chat.command.message.Spy; import mineverse.Aust1n46.chat.command.message.Reply;
import mineverse.Aust1n46.chat.command.mute.Mute; import mineverse.Aust1n46.chat.command.message.Spy;
import mineverse.Aust1n46.chat.command.mute.Muteall; import mineverse.Aust1n46.chat.command.mute.Mute;
import mineverse.Aust1n46.chat.command.mute.Unmute; import mineverse.Aust1n46.chat.command.mute.Muteall;
import mineverse.Aust1n46.chat.command.mute.Unmuteall; import mineverse.Aust1n46.chat.command.mute.Unmute;
import mineverse.Aust1n46.chat.command.mute.Unmuteall;
/**
* Class that initializes and executes the plugin's commands. /**
*/ * Class that initializes and executes the plugin's commands.
public class VentureCommandExecutor implements TabExecutor { */
private static Map<String, VentureCommand> commands = new HashMap<String, VentureCommand>(); public class VentureCommandExecutor implements TabExecutor {
private static MineverseChat plugin = MineverseChat.getInstance(); private static Map<String, VentureCommand> commands = new HashMap<String, VentureCommand>();
private static VentureCommandExecutor commandExecutor; private static MineverseChat plugin = MineverseChat.getInstance();
private static VentureCommandExecutor commandExecutor;
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] parameters) { @Override
commands.get(command.getName()).execute(sender, command.getName(), parameters); public boolean onCommand(CommandSender sender, Command command, String label, String[] parameters) {
return true; commands.get(command.getName()).execute(sender, command.getName(), parameters);
} return true;
}
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) { @Override
return commands.get(command.getName()).onTabComplete(sender, command, label, args); public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
} return commands.get(command.getName()).onTabComplete(sender, command, label, args);
}
public static void initialize() {
commandExecutor = new VentureCommandExecutor(); public static void initialize() {
commands.put("broadcast", new Broadcast()); commandExecutor = new VentureCommandExecutor();
commands.put("channel", new Channel()); commands.put("broadcast", new Broadcast());
commands.put("join", new Channel()); commands.put("channel", new Channel());
commands.put("channelinfo", new Channelinfo()); commands.put("join", new Channel());
commands.put("chatinfo", new Chatinfo()); commands.put("channelinfo", new Channelinfo());
commands.put("chatreload", new Chatreload()); commands.put("chatinfo", new Chatinfo());
commands.put("chlist", new Chlist()); commands.put("chatreload", new Chatreload());
commands.put("chwho", new Chwho()); commands.put("chlist", new Chlist());
commands.put("clearchat", new Clearchat()); commands.put("chwho", new Chwho());
commands.put("commandblock", new Commandblock()); commands.put("clearchat", new Clearchat());
commands.put("commandspy", new Commandspy()); commands.put("commandblock", new Commandblock());
commands.put("config", new Config()); commands.put("commandspy", new Commandspy());
commands.put("edit", new Edit()); commands.put("config", new Config());
commands.put("filter", new Filter()); commands.put("edit", new Edit());
commands.put("force", new Force()); commands.put("filter", new Filter());
commands.put("forceall", new Forceall()); commands.put("force", new Force());
commands.put("kickchannel", new Kickchannel()); commands.put("forceall", new Forceall());
commands.put("kickchannelall", new Kickchannelall()); commands.put("kickchannel", new Kickchannel());
commands.put("leave", new Leave()); commands.put("kickchannelall", new Kickchannelall());
commands.put("listen", new Listen()); commands.put("leave", new Leave());
commands.put("me", new Me()); commands.put("listen", new Listen());
commands.put("venturechat", new Venturechat()); commands.put("me", new Me());
commands.put("setnickname", new Nick()); commands.put("venturechat", new Venturechat());
commands.put("notifications", new Notifications()); commands.put("setnickname", new Nick());
commands.put("party", new Party()); commands.put("notifications", new Notifications());
commands.put("rangedspy", new RangedSpy()); commands.put("party", new Party());
commands.put("removemessage", new Removemessage()); commands.put("rangedspy", new RangedSpy());
commands.put("setchannel", new Setchannel()); commands.put("removemessage", new Removemessage());
commands.put("setchannelall", new Setchannelall()); commands.put("setchannel", new Setchannel());
commands.put("spy", new Spy()); commands.put("setchannelall", new Setchannelall());
commands.put("venturechatgui", new VentureChatGui()); commands.put("spy", new Spy());
commands.put("messagetoggle", new MessageToggle()); commands.put("venturechatgui", new VentureChatGui());
commands.put("bungeetoggle", new BungeeToggle()); commands.put("messagetoggle", new MessageToggle());
for (String command : commands.keySet()) { commands.put("bungeetoggle", new BungeeToggle());
plugin.getCommand(command).setExecutor(commandExecutor); for(String command : commands.keySet()) {
} registerCommand(command, commandExecutor);
}
plugin.getServer().getScheduler().runTaskLater(plugin, () -> {
VentureCommand reply = new Reply(); plugin.getServer().getScheduler().runTaskLater(plugin, () -> {
commands.put("reply", reply); VentureCommand reply = new Reply();
commands.put("r", reply); commands.put("reply", reply);
plugin.getCommand("reply").setExecutor(commandExecutor); commands.put("r", reply);
plugin.getCommand("r").setExecutor(commandExecutor); registerCommand("reply", commandExecutor);
registerCommand("r", commandExecutor);
commands.put("mute", new Mute());
commands.put("muteall", new Muteall()); commands.put("mute", new Mute());
commands.put("unmute", new Unmute()); commands.put("muteall", new Muteall());
commands.put("unmuteall", new Unmuteall()); commands.put("unmute", new Unmute());
plugin.getCommand("mute").setExecutor(commandExecutor); commands.put("unmuteall", new Unmuteall());
plugin.getCommand("muteall").setExecutor(commandExecutor); registerCommand("mute", commandExecutor);
plugin.getCommand("unmute").setExecutor(commandExecutor); registerCommand("muteall", commandExecutor);
plugin.getCommand("unmuteall").setExecutor(commandExecutor); registerCommand("unmute", commandExecutor);
registerCommand("unmuteall", commandExecutor);
MessageCommandExecutor messageCommandExecutor = new MessageCommandExecutor();
plugin.getCommand("message").setExecutor(messageCommandExecutor); MessageCommandExecutor messageCommandExecutor = new MessageCommandExecutor();
plugin.getCommand("msg").setExecutor(messageCommandExecutor); registerCommand("message", messageCommandExecutor);
plugin.getCommand("tell").setExecutor(messageCommandExecutor); registerCommand("msg", messageCommandExecutor);
plugin.getCommand("whisper").setExecutor(messageCommandExecutor); registerCommand("tell", messageCommandExecutor);
plugin.getCommand("ignore").setExecutor(new IgnoreCommandExecutor()); registerCommand("whisper", messageCommandExecutor);
}, 0);
} registerCommand("ignore", new IgnoreCommandExecutor());
} }, 0);
}
private static void registerCommand(String command, CommandExecutor commandExecutor) {
if(plugin.getCommand(command) != null) {
plugin.getCommand(command).setExecutor(commandExecutor);
}
}
}

View File

@ -1,32 +1,60 @@
package mineverse.Aust1n46.chat.command.chat; package mineverse.Aust1n46.chat.command.chat;
import org.bukkit.Bukkit; import java.util.UUID;
import org.bukkit.command.CommandSender;
import org.bukkit.Bukkit;
import mineverse.Aust1n46.chat.MineverseChat; import org.bukkit.command.CommandSender;
import mineverse.Aust1n46.chat.api.MineverseChatAPI; import org.bukkit.entity.Player;
import mineverse.Aust1n46.chat.api.MineverseChatPlayer;
import mineverse.Aust1n46.chat.command.VentureCommand; import mineverse.Aust1n46.chat.MineverseChat;
import mineverse.Aust1n46.chat.localization.LocalizedMessage; import mineverse.Aust1n46.chat.api.MineverseChatAPI;
import mineverse.Aust1n46.chat.api.MineverseChatPlayer;
public class Chatreload implements VentureCommand { import mineverse.Aust1n46.chat.command.VentureCommand;
private MineverseChat plugin = MineverseChat.getInstance(); import mineverse.Aust1n46.chat.database.PlayerData;
import mineverse.Aust1n46.chat.localization.LocalizedMessage;
@Override import mineverse.Aust1n46.chat.utilities.Format;
public void execute(CommandSender sender, String command, String[] args) {
if (sender.hasPermission("venturechat.reload")) { public class Chatreload implements VentureCommand {
plugin.reloadConfig(); private MineverseChat plugin = MineverseChat.getInstance();
Bukkit.getPluginManager().disablePlugin(plugin);
Bukkit.getPluginManager().enablePlugin(plugin); @Override
plugin.getServer().getLogger().info("[VentureChat] Config reloaded"); public void execute(CommandSender sender, String command, String[] args) {
for (MineverseChatPlayer player : MineverseChatAPI.getOnlineMineverseChatPlayers()) { if(sender.hasPermission("venturechat.reload")) {
if (player.getPlayer().hasPermission("venturechat.reload")) { PlayerData.savePlayerData();
player.getPlayer().sendMessage(LocalizedMessage.CONFIG_RELOADED.toString()); MineverseChatAPI.clearMineverseChatPlayerMap();
} MineverseChatAPI.clearNameMap();
} MineverseChatAPI.clearOnlineMineverseChatPlayerMap();
return;
} plugin.reloadConfig();
sender.sendMessage(LocalizedMessage.COMMAND_NO_PERMISSION.toString()); MineverseChat.initializeConfigReaders();
return;
} PlayerData.loadLegacyPlayerData();
} PlayerData.loadPlayerData();
for(Player p : plugin.getServer().getOnlinePlayers()) {
MineverseChatPlayer mcp = MineverseChatAPI.getMineverseChatPlayer(p);
if(mcp == null) {
Bukkit.getConsoleSender().sendMessage(Format.FormatStringAll("&8[&eVentureChat&8]&c - Could not find player data post reload for currently online player: " + p.getName()));
Bukkit.getConsoleSender().sendMessage(Format.FormatStringAll("&8[&eVentureChat&8]&c - There could be an issue with your player data saving."));
String name = p.getName();
UUID uuid = p.getUniqueId();
mcp = new MineverseChatPlayer(uuid, name);
}
mcp.setOnline(true);
mcp.setHasPlayed(false);
mcp.setJsonFormat();
MineverseChatAPI.addMineverseChatOnlinePlayerToMap(mcp);
MineverseChatAPI.addNameToMap(mcp);
}
Bukkit.getConsoleSender().sendMessage(Format.FormatStringAll("&8[&eVentureChat&8]&e - Config reloaded"));
for(MineverseChatPlayer player : MineverseChatAPI.getOnlineMineverseChatPlayers()) {
if(player.getPlayer().hasPermission("venturechat.reload")) {
player.getPlayer().sendMessage(LocalizedMessage.CONFIG_RELOADED.toString());
}
}
return;
}
sender.sendMessage(LocalizedMessage.COMMAND_NO_PERMISSION.toString());
return;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,423 +1,424 @@
#=============================================================== #===============================================================
# VentureChat Config = # VentureChat Config =
# Author: Aust1n46 = # Author: Aust1n46 =
#=============================================================== #===============================================================
# - regex1,regex2 # - regex1,regex2
# Simple regex tips: Use \b to "cut" a section of the word or phrase. Example: \bass,donuts # Simple regex tips: Use \b to "cut" a section of the word or phrase. Example: \bass,donuts
# Example filtered sentence: You are an ass. Will become: You are an donuts. # Example filtered sentence: You are an ass. Will become: You are an donuts.
# Example filtered sentence: You caught a bass. Will stay: You caught a bass. # Example filtered sentence: You caught a bass. Will stay: You caught a bass.
# Example filtered sentence: You are an asshole. Will become: You are an donutshole. # Example filtered sentence: You are an asshole. Will become: You are an donutshole.
# Default filters by Jabelpeeps # Default filters by Jabelpeeps
filters: filters:
- (\b.?anus),donuts - (\b.?anus),donuts
- (\ba+r*(se+|ss+(?!(ass|um|oc|ign|ist)).*?|s*e*h+[o0]*[l1]+e*[sz]*)\b),donuts - (\ba+r*(se+|ss+(?!(ass|um|oc|ign|ist)).*?|s*e*h+[o0]*[l1]+e*[sz]*)\b),donuts
- (b[i1]a?tch(es)?),puppy - (b[i1]a?tch(es)?),puppy
- Carpet Muncher,cookie monster - Carpet Muncher,cookie monster
- (\bc((?!ook\b)[o0]+c*|aw)k\W?(sucker|s*|he[ea]*d)\b),rooster - (\bc((?!ook\b)[o0]+c*|aw)k\W?(sucker|s*|he[ea]*d)\b),rooster
- (\b[ck]r+a+p+(er|s|z)?\b),poopoo - (\b[ck]r+a+p+(er|s|z)?\b),poopoo
- (\bcu+m+\b),go - (\bcu+m+\b),go
- (\b.?[ck](u*n+|[l1]+[i1]+)t+[sz]*\b),peach - (\b.?[ck](u*n+|[l1]+[i1]+)t+[sz]*\b),peach
- (\b.?d[1i](c?k(head)?|[l1]+d[o0])e?[sz]?\b),rooster - (\b.?d[1i](c?k(head)?|[l1]+d[o0])e?[sz]?\b),rooster
- f u c k( e r)?,nono - f u c k( e r)?,nono
- (\b.?fai*g+[oei1]*t*[sz]*\b),cigar - (\b.?fai*g+[oei1]*t*[sz]*\b),cigar
- Fudge Packer,fine person - Fudge Packer,fine person
- (\b(m[uo]+th[ae]r?)?(f|ph)uc*k*(e[rn]|ah*|ing?|)[sz]?\b),oh dear - (\b(m[uo]+th[ae]r?)?(f|ph)uc*k*(e[rn]|ah*|ing?|)[sz]?\b),oh dear
- (\b(j(ac|er|ur)k\W?(of+))|(ji[sz]+i*m*)\b),bake brownies - (\b(j(ac|er|ur)k\W?(of+))|(ji[sz]+i*m*)\b),bake brownies
- (\b(ma+s+te?rbai?te?[rs]?|wank(er)?[sz]?)\b),bake brownies - (\b(ma+s+te?rbai?te?[rs]?|wank(er)?[sz]?)\b),bake brownies
- orafi(s|ce),rooster - orafi(s|ce),rooster
- (\bp+[e3]+[ai]*n+[i1!ua]+s+),rooster - (\bp+[e3]+[ai]*n+[i1!ua]+s+),rooster
- (\bp[i1]s+(?!(ton))(flap|face|drop)?),peepee - (\bp[i1]s+(?!(ton))(flap|face|drop)?),peepee
- (\b.?sh[i1!y]t+(er?|y|head)?[sz]*),poopoo - (\b.?sh[i1!y]t+(er?|y|head)?[sz]*),poopoo
- (\bva[1i]?[gj]+[i1]+na+\b),peach - (\bva[1i]?[gj]+[i1]+na+\b),peach
- vu[1l]+va,peach - vu[1l]+va,peach
- planet.?minecraft,another dimension - planet.?minecraft,another dimension
- pmc,another dimension - pmc,another dimension
- ((\d+\.){3}\d+),another dimension - ((\d+\.){3}\d+),another dimension
# command without the / # command without the /
blockablecommands: blockablecommands:
- vote - vote
- me - me
# blacklisted nicknames # blacklisted nicknames
nicknames: nicknames:
- Notch - Notch
nickname-in-tablist: true nickname-in-tablist: true
# {player} : player sending command # {player} : player sending command
# {command} : command typed # {command} : command typed
commandspy: commandspy:
format: '&6{player}: {command}' format: '&6{player}: {command}'
worldeditcommands: true worldeditcommands: true
antispam: antispam:
enabled: true enabled: true
# Number of messages to be spam # Number of messages to be spam
spamnumber: 5 spamnumber: 5
# Amount of time in seconds for it to be spam # Amount of time in seconds for it to be spam
spamtime: 10 spamtime: 10
# Amount of time for the mute to last # Amount of time for the mute to last
# Acceptable units are: d,h,m,s # Acceptable units are: d,h,m,s
# Units can be combined, for example: 1d8h30m15s # Units can be combined, for example: 1d8h30m15s
# Use 0 for untimed mute # Use 0 for untimed mute
mutetime: 10m mutetime: 10m
# Logging chat and commands to a mysql database # Logging chat and commands to a mysql database
mysql: mysql:
enabled: false enabled: false
user: User user: User
port: 3306 port: 3306
password: Password password: Password
host: localhost host: localhost
database: Database database: Database
# Loglevel feature is still in the works for adding of debug messages # Loglevel feature is still in the works for adding of debug messages
# Valid loglevels: # Valid loglevels:
# Info: Regular logging # Info: Regular logging
# Debug: Show extra messages and caught errors for debugging # Debug: Show extra messages and caught errors for debugging
# Severe: Only show severe messages # Severe: Only show severe messages
loglevel: info loglevel: info
# saveinterval is in minutes # saveinterval is in minutes
saveinterval: 30 saveinterval: 30
# If you're running a "cracked" server, player data might not be stored properly, and thus, you are on your own. # If you're running a "cracked" server, player data might not be stored properly, and thus, you are on your own.
# If you run your server in offline mode, you might have to reset your player data when switching to online mode! # If you run your server in offline mode, you might have to reset your player data when switching to online mode!
# If you see this warning by accident and you are using BungeeCord, make sure you have properly setup IP Forwarding. # If you see this warning by accident and you are using BungeeCord, make sure you have properly setup IP Forwarding.
# https://www.spigotmc.org/wiki/bungeecord-ip-forwarding/ # https://www.spigotmc.org/wiki/bungeecord-ip-forwarding/
# No player data will be saved in offline mode unless you set this acknowledgement to 'true' # No player data will be saved in offline mode unless you set this acknowledgement to 'true'
offline_server_acknowledgement: false offline_server_acknowledgement: false
# The time in seconds between each check to remove timed mutes # The time in seconds between each check to remove timed mutes
unmuteinterval: 60 unmuteinterval: 60
# Enables or disabled BungeeCord messaging # Enables or disabled BungeeCord messaging
bungeecordmessaging: false bungeecordmessaging: false
# Sound for message notification # Sound for message notification
message_sound: ENTITY_PLAYER_LEVELUP # Enter 'None' to disable the sound
message_sound: ENTITY_PLAYER_LEVELUP
# This will allow vanished players to be exempt from being sent private messages, and will act as if they aren't online
vanishsupport: true # This will allow vanished players to be exempt from being sent private messages, and will act as if they aren't online
vanishsupport: true
# Use PlaceholderAPI placeholders
# Start the placeholder with 'sender_' for the sending players placeholder # Use PlaceholderAPI placeholders
# Start the placeholder with 'receiver_' for the receiving players placeholder # Start the placeholder with 'sender_' for the sending players placeholder
# The defaults shown below provide an example of each # Start the placeholder with 'receiver_' for the receiving players placeholder
tellformatto: '&7You message {receiver_vault_prefix}{receiver_player_displayname}&7:' # The defaults shown below provide an example of each
tellformatfrom: '{sender_vault_prefix}{sender_player_displayname} &7messages you:' tellformatto: '&7You message {receiver_vault_prefix}{receiver_player_displayname}&7:'
tellformatspy: '{sender_player_name} messages {receiver_player_name}:&7' tellformatfrom: '{sender_vault_prefix}{sender_player_displayname} &7messages you:'
replyformatto: '&7You reply to {receiver_vault_prefix}{receiver_player_displayname}&7:' tellformatspy: '{sender_player_name} messages {receiver_player_name}:&7'
replyformatfrom: '{sender_vault_prefix}{sender_player_displayname} &7replies to you:' replyformatto: '&7You reply to {receiver_vault_prefix}{receiver_player_displayname}&7:'
replyformatspy: '{sender_player_name} replies to {receiver_player_name}:&7' replyformatfrom: '{sender_vault_prefix}{sender_player_displayname} &7replies to you:'
replyformatspy: '{sender_player_name} replies to {receiver_player_name}:&7'
# {host} : party hosts name
# {player} : player name # {host} : party hosts name
# use Default for the basic formatting # {player} : player name
partyformat: Default # use Default for the basic formatting
partyformat: Default
formatcleaner: true
formatcleaner: true
# If true, /ignore will block chat from the ignored player as well as PM's
ignorechat: false # If true, /ignore will block chat from the ignored player as well as PM's
ignorechat: false
# The message shown to players alerting them no one is in the channel to hear them
emptychannelalert: "&6No one is listening to you." # The message shown to players alerting them no one is in the channel to hear them
emptychannelalert: "&6No one is listening to you."
messageremoverpermissions: '&cYou need additional permissions to view this message!'
messageremovertext: '&c&o<message removed>' messageremoverpermissions: '&cYou need additional permissions to view this message!'
messageremovertext: '&c&o<message removed>'
# The name of the group is the permissions node for the format
# Example: venturechat.json.Owner is the node for the group Owner # The name of the group is the permissions node for the format
# A lower priority overrides a higher priority if a player has more than 1 group # Example: venturechat.json.Owner is the node for the group Owner
# Possible options for click_name and click_prefix are suggest_command, run_command, and open_url # A lower priority overrides a higher priority if a player has more than 1 group
jsonformatting: # Possible options for click_name and click_prefix are suggest_command, run_command, and open_url
Default: # This default format is required! Do not delete or rename it! jsonformatting:
priority: 2147483647 # Integer.MAX_VALUE Default: # This default format is required! Do not delete or rename it!
hover_name: priority: 2147483647 # Integer.MAX_VALUE
- '&6I have no rank!' hover_name:
click_name: 'suggest_command' - '&6I have no rank!'
click_name_text: '/msg {player_name}' click_name: 'suggest_command'
hover_prefix: click_name_text: '/msg {player_name}'
- '&dI am default!' hover_prefix:
click_prefix: 'run_command' - '&dI am default!'
click_prefix_text: '/help' click_prefix: 'run_command'
hover_suffix: click_prefix_text: '/help'
- '&dI am default suffix!' hover_suffix:
click_suffix: 'suggest_command' - '&dI am default suffix!'
click_suffix_text: '/msg {player_name}' click_suffix: 'suggest_command'
Owner: click_suffix_text: '/msg {player_name}'
priority: 1 # Lowest Priority Owner:
hover_name: priority: 1 # Lowest Priority
- '&cOwner of the server!' hover_name:
- '&bMessage me for help!' - '&cOwner of the server!'
click_name: 'suggest_command' - '&bMessage me for help!'
click_name_text: '/msg {player_name}' click_name: 'suggest_command'
hover_prefix: click_name_text: '/msg {player_name}'
- '&dServer Owner' hover_prefix:
click_prefix: 'run_command' - '&dServer Owner'
click_prefix_text: '/help' click_prefix: 'run_command'
hover_suffix: click_prefix_text: '/help'
- '&dI am Owner suffix!' hover_suffix:
click_suffix: 'suggest_command' - '&dI am Owner suffix!'
click_suffix_text: '/msg {player_name}' click_suffix: 'suggest_command'
click_suffix_text: '/msg {player_name}'
# The icon is the block shown in the GUI
# The text is the display name of the block icon # The icon is the block shown in the GUI
# Include a slash (/) before the command # The text is the display name of the block icon
# Permissions are the name of the button and automatically include "venturechat." # Include a slash (/) before the command
# Example: mute equals venturechat.mute # Permissions are the name of the button and automatically include "venturechat."
venturegui: # Example: mute equals venturechat.mute
mute: venturegui:
icon: 'REDSTONE_BLOCK' mute:
durability: 0 icon: 'REDSTONE_BLOCK'
text: '&cMute {player_name} &410m' durability: 0
permission: 'mute' text: '&cMute {player_name} &410m'
command: '/mute {channel} {player_name} 10m' permission: 'mute'
slot: 1 command: '/mute {channel} {player_name} 10m'
unmute: slot: 1
icon: 'DIAMOND_BLOCK' unmute:
durability: 0 icon: 'DIAMOND_BLOCK'
text: '&bUnmute {player_name}' durability: 0
permission: 'mute' text: '&bUnmute {player_name}'
command: '/unmute {channel} {player_name} ' permission: 'mute'
slot: 2 command: '/unmute {channel} {player_name} '
removemessage: slot: 2
icon: 'DIAMOND_AXE' removemessage:
durability: 0 icon: 'DIAMOND_AXE'
text: '&cRemove Message' durability: 0
permission: 'removemessage' text: '&cRemove Message'
command: '/removemessage {hash} {channel}' permission: 'removemessage'
slot: 7 command: '/removemessage {hash} {channel}'
slot: 7
guiicon: '&c [✓]'
guitext: '&cOpen Moderation GUI' guiicon: '&c [✓]'
guirows: 1 guitext: '&cOpen Moderation GUI'
guirows: 1
# All clickable URL's will be underlined if set to true
underlineurls: true # All clickable URL's will be underlined if set to true
underlineurls: true
# broadcast information
broadcast: # broadcast information
color: red broadcast:
permissions: venturechat.adminchannel color: red
displaytag: '[Broadcast]' permissions: venturechat.adminchannel
displaytag: '[Broadcast]'
# Use $ to include arguments into the message
# Valid component types are: # Use $ to include arguments into the message
# Command: Sends a message or command in chat # Valid component types are:
# Message: Sends a message to the player # Command: Sends a message or command in chat
# Broadcast: Sends a broadcast to all players on the server # Message: Sends a message to the player
# Permissions automatically include "venturechat." # Broadcast: Sends a broadcast to all players on the server
# Example: permissions: alert equals venturechat.alert # Permissions automatically include "venturechat."
# Use None for no permissions # Example: permissions: alert equals venturechat.alert
# The number of arguments is the minimum number of required arguments, use 0 for no required arguments # Use None for no permissions
alias: # The number of arguments is the minimum number of required arguments, use 0 for no required arguments
vote: alias:
arguments: 0 vote:
permissions: None arguments: 0
components: permissions: None
- 'Message: &6Vote here: www.votelinkhere.com' components:
bane: - 'Message: &6Vote here: www.votelinkhere.com'
arguments: 2 bane:
permissions: bane arguments: 2
components: permissions: bane
- 'Command: /ban $ appeal at www.site.com' components:
- 'Command: /st banned $' - 'Command: /ban $ appeal at www.site.com'
alert: - 'Command: /st banned $'
arguments: 1 alert:
permissions: alert arguments: 1
components: permissions: alert
- 'Broadcast: &c<Alert> $' components:
donate: - 'Broadcast: &c<Alert> $'
arguments: 0 donate:
permissions: None arguments: 0
components: permissions: None
- 'Message: &bDonate here: www.mywebsite.com' components:
website: - 'Message: &bDonate here: www.mywebsite.com'
arguments: 0 website:
permissions: None arguments: 0
components: permissions: None
- 'Message: &aThis is our website: www.site.net' components:
- 'Message: &aThis is our website: www.site.net'
# Enables the creation of special Towny channels: Town and Nation
# To create these channels, simply name two channels below "Town" and "Nation" # Enables the creation of special Towny channels: Town and Nation
# Bungeecord must be set to false for these channels! # To create these channels, simply name two channels below "Town" and "Nation"
enable_towny_channel: false # Bungeecord must be set to false for these channels!
enable_towny_channel: false
# Enables the creation of a special faction only channel using the Factions plugin
# To create this channel, simply name a channel below "Faction" # Enables the creation of a special faction only channel using the Factions plugin
# Bungeecord must be set to false for this channel! # To create this channel, simply name a channel below "Faction"
# WARNING: May not work for all versions of Factions! # Bungeecord must be set to false for this channel!
enable_factions_channel: false # WARNING: May not work for all versions of Factions!
enable_factions_channel: false
# color = [channel] color
# chatcolor = text color # color = [channel] color
# cooldown is in seconds # chatcolor = text color
# bungeecord overrides distance # cooldown is in seconds
# channel permissions are configurable # bungeecord overrides distance
# channels can be changed, and new channels can be created # channel permissions are configurable
# Permissions automatically include "venturechat." # channels can be changed, and new channels can be created
# Example: permissions: staff equals venturechat.staff # Permissions automatically include "venturechat."
# Use None for no permissions # Example: permissions: staff equals venturechat.staff
# Use None for no permissions
# Use PlaceholderAPI placeholders are required!!!
# Use PlaceholderAPI placeholders are required!!! # Use PlaceholderAPI placeholders are required!!!
# Use PlaceholderAPI placeholders are required!!! # Use PlaceholderAPI placeholders are required!!!
# /papi ecloud download [plugin] # Use PlaceholderAPI placeholders are required!!!
# /papi reload # /papi ecloud download [plugin]
# Use '' or "" around format, example: '[&2global&f] {vault_prefix} {player_displayname}&2:' # /papi reload
# You must have prefixes and suffixes set in a Vault compatible permissions plugin to avoid errors # Use '' or "" around format, example: '[&2global&f] {vault_prefix} {player_displayname}&2:'
# Use "" as the prefix or suffix to have none # You must have prefixes and suffixes set in a Vault compatible permissions plugin to avoid errors
# Use "" as the prefix or suffix to have none
# Set chatcolor to 'None' to have a group based chat color! Don't forget to put a suffix or other placeholder at the end of the format!
# Set chatcolor to 'None' to have a group based chat color! Don't forget to put a suffix or other placeholder at the end of the format!
# Important!!!
# Important!!! # Important!!!
# If you delete a channel, restart the server! Do not use /chatreload!!! # Important!!!
channels: # If you delete a channel, restart the server! Do not use /chatreload!!!
GroupChatColorExample: channels:
color: '#706C1E' GroupChatColorExample:
chatcolor: 'None' color: '#706C1E'
mutable: true chatcolor: 'None'
filter: true mutable: true
autojoin: true filter: true
default: false autojoin: true
distance: 0 default: false
cooldown: 0 distance: 0
bungeecord: false cooldown: 0
alias: ge bungeecord: false
permissions: None alias: ge
speak_permissions: None permissions: None
format: '&f[#706C1EGroupColorChat&f] {vault_prefix} {player_displayname}#706C1E:{vault_suffix}' speak_permissions: None
HexExample: format: '&f[#706C1EGroupColorChat&f] {vault_prefix} {player_displayname}#706C1E:{vault_suffix}'
color: '#ff0000' HexExample:
chatcolor: '#ff0000' color: '#ff0000'
mutable: true chatcolor: '#ff0000'
filter: true mutable: true
autojoin: true filter: true
default: false autojoin: true
distance: 0 default: false
cooldown: 0 distance: 0
bungeecord: false cooldown: 0
alias: he bungeecord: false
permissions: None alias: he
speak_permissions: None permissions: None
format: '&f[#ff0000Hex&f] {vault_prefix} {player_displayname}#ff0000:' speak_permissions: None
BungeeExample: format: '&f[#ff0000Hex&f] {vault_prefix} {player_displayname}#ff0000:'
color: gold BungeeExample:
chatcolor: gold color: gold
mutable: true chatcolor: gold
filter: true mutable: true
autojoin: true filter: true
default: false autojoin: true
distance: 0 default: false
cooldown: 3 distance: 0
bungeecord: true cooldown: 3
alias: be bungeecord: true
permissions: None alias: be
speak_permissions: None permissions: None
format: '&f[&6Network&f] {vault_prefix} {player_displayname}&6:' speak_permissions: None
AnnouncementExample: format: '&f[&6Network&f] {vault_prefix} {player_displayname}&6:'
color: red AnnouncementExample:
chatcolor: red color: red
mutable: false chatcolor: red
filter: false mutable: false
autojoin: true filter: false
default: false autojoin: true
distance: 0 default: false
cooldown: 0 distance: 0
bungeecord: true cooldown: 0
alias: announce bungeecord: true
permissions: None alias: announce
speak_permissions: announcement permissions: None
format: '&f[&aServer Announcement&f] {vault_prefix} {player_displayname}&c:' speak_permissions: announcement
Global: format: '&f[&aServer Announcement&f] {vault_prefix} {player_displayname}&c:'
color: dark_green Global:
chatcolor: dark_green color: dark_green
mutable: true chatcolor: dark_green
filter: true mutable: true
autojoin: true filter: true
default: true autojoin: true
distance: 0 default: true
cooldown: 0 distance: 0
bungeecord: false cooldown: 0
alias: g bungeecord: false
permissions: None alias: g
speak_permissions: None permissions: None
format: '&f[&2Global&f] {vault_prefix} {player_displayname}&2:' speak_permissions: None
Staff: format: '&f[&2Global&f] {vault_prefix} {player_displayname}&2:'
color: green Staff:
chatcolor: green color: green
mutable: false chatcolor: green
filter: false mutable: false
autojoin: true filter: false
default: false autojoin: true
distance: 0 default: false
cooldown: 0 distance: 0
bungeecord: false cooldown: 0
alias: st bungeecord: false
permissions: staffchannel alias: st
speak_permissions: None permissions: staffchannel
format: '&f[&aStaff&f] {vault_prefix} {player_displayname}&a:' speak_permissions: None
Donator: format: '&f[&aStaff&f] {vault_prefix} {player_displayname}&a:'
color: light_purple Donator:
chatcolor: light_purple color: light_purple
mutable: true chatcolor: light_purple
filter: true mutable: true
autojoin: true filter: true
default: false autojoin: true
distance: 0 default: false
cooldown: 0 distance: 0
bungeecord: false cooldown: 0
alias: d bungeecord: false
permissions: donatorchannel alias: d
speak_permissions: None permissions: donatorchannel
format: '&f[&dDonator&f] {vault_prefix} {player_displayname}&d:' speak_permissions: None
Help: format: '&f[&dDonator&f] {vault_prefix} {player_displayname}&d:'
color: aqua Help:
chatcolor: aqua color: aqua
mutable: true chatcolor: aqua
filter: true mutable: true
autojoin: true filter: true
default: false autojoin: true
distance: 0 default: false
cooldown: 0 distance: 0
bungeecord: false cooldown: 0
alias: h bungeecord: false
permissions: None alias: h
speak_permissions: None permissions: None
format: '&f[&bHelp&f] {vault_prefix} {player_displayname}&b:' speak_permissions: None
Trade: format: '&f[&bHelp&f] {vault_prefix} {player_displayname}&b:'
color: dark_aqua Trade:
chatcolor: dark_aqua color: dark_aqua
mutable: true chatcolor: dark_aqua
filter: true mutable: true
autojoin: true filter: true
default: false autojoin: true
distance: 0 default: false
cooldown: 0 distance: 0
bungeecord: false cooldown: 0
alias: t bungeecord: false
permissions: None alias: t
speak_permissions: None permissions: None
format: '&f[&3Trade&f] {vault_prefix} {player_displayname}&3:' speak_permissions: None
Local: format: '&f[&3Trade&f] {vault_prefix} {player_displayname}&3:'
color: yellow Local:
chatcolor: yellow color: yellow
mutable: true chatcolor: yellow
filter: true mutable: true
autojoin: true filter: true
default: false autojoin: true
distance: 230 default: false
cooldown: 0 distance: 230
bungeecord: false cooldown: 0
alias: l bungeecord: false
permissions: None alias: l
speak_permissions: None permissions: None
speak_permissions: None
format: '&f[&eLocal&f] {vault_prefix} {player_displayname}&e:' format: '&f[&eLocal&f] {vault_prefix} {player_displayname}&e:'

View File

@ -1,423 +1,424 @@
#=============================================================== #===============================================================
# VentureChat Config = # VentureChat Config =
# Author: Aust1n46 = # Author: Aust1n46 =
#=============================================================== #===============================================================
# - regex1,regex2 # - regex1,regex2
# Simple regex tips: Use \b to "cut" a section of the word or phrase. Example: \bass,donuts # Simple regex tips: Use \b to "cut" a section of the word or phrase. Example: \bass,donuts
# Example filtered sentence: You are an ass. Will become: You are an donuts. # Example filtered sentence: You are an ass. Will become: You are an donuts.
# Example filtered sentence: You caught a bass. Will stay: You caught a bass. # Example filtered sentence: You caught a bass. Will stay: You caught a bass.
# Example filtered sentence: You are an asshole. Will become: You are an donutshole. # Example filtered sentence: You are an asshole. Will become: You are an donutshole.
# Default filters by Jabelpeeps # Default filters by Jabelpeeps
filters: filters:
- (\b.?anus),donuts - (\b.?anus),donuts
- (\ba+r*(se+|ss+(?!(ass|um|oc|ign|ist)).*?|s*e*h+[o0]*[l1]+e*[sz]*)\b),donuts - (\ba+r*(se+|ss+(?!(ass|um|oc|ign|ist)).*?|s*e*h+[o0]*[l1]+e*[sz]*)\b),donuts
- (b[i1]a?tch(es)?),puppy - (b[i1]a?tch(es)?),puppy
- Carpet Muncher,cookie monster - Carpet Muncher,cookie monster
- (\bc((?!ook\b)[o0]+c*|aw)k\W?(sucker|s*|he[ea]*d)\b),rooster - (\bc((?!ook\b)[o0]+c*|aw)k\W?(sucker|s*|he[ea]*d)\b),rooster
- (\b[ck]r+a+p+(er|s|z)?\b),poopoo - (\b[ck]r+a+p+(er|s|z)?\b),poopoo
- (\bcu+m+\b),go - (\bcu+m+\b),go
- (\b.?[ck](u*n+|[l1]+[i1]+)t+[sz]*\b),peach - (\b.?[ck](u*n+|[l1]+[i1]+)t+[sz]*\b),peach
- (\b.?d[1i](c?k(head)?|[l1]+d[o0])e?[sz]?\b),rooster - (\b.?d[1i](c?k(head)?|[l1]+d[o0])e?[sz]?\b),rooster
- f u c k( e r)?,nono - f u c k( e r)?,nono
- (\b.?fai*g+[oei1]*t*[sz]*\b),cigar - (\b.?fai*g+[oei1]*t*[sz]*\b),cigar
- Fudge Packer,fine person - Fudge Packer,fine person
- (\b(m[uo]+th[ae]r?)?(f|ph)uc*k*(e[rn]|ah*|ing?|)[sz]?\b),oh dear - (\b(m[uo]+th[ae]r?)?(f|ph)uc*k*(e[rn]|ah*|ing?|)[sz]?\b),oh dear
- (\b(j(ac|er|ur)k\W?(of+))|(ji[sz]+i*m*)\b),bake brownies - (\b(j(ac|er|ur)k\W?(of+))|(ji[sz]+i*m*)\b),bake brownies
- (\b(ma+s+te?rbai?te?[rs]?|wank(er)?[sz]?)\b),bake brownies - (\b(ma+s+te?rbai?te?[rs]?|wank(er)?[sz]?)\b),bake brownies
- orafi(s|ce),rooster - orafi(s|ce),rooster
- (\bp+[e3]+[ai]*n+[i1!ua]+s+),rooster - (\bp+[e3]+[ai]*n+[i1!ua]+s+),rooster
- (\bp[i1]s+(?!(ton))(flap|face|drop)?),peepee - (\bp[i1]s+(?!(ton))(flap|face|drop)?),peepee
- (\b.?sh[i1!y]t+(er?|y|head)?[sz]*),poopoo - (\b.?sh[i1!y]t+(er?|y|head)?[sz]*),poopoo
- (\bva[1i]?[gj]+[i1]+na+\b),peach - (\bva[1i]?[gj]+[i1]+na+\b),peach
- vu[1l]+va,peach - vu[1l]+va,peach
- planet.?minecraft,another dimension - planet.?minecraft,another dimension
- pmc,another dimension - pmc,another dimension
- ((\d+\.){3}\d+),another dimension - ((\d+\.){3}\d+),another dimension
# command without the / # command without the /
blockablecommands: blockablecommands:
- vote - vote
- me - me
# blacklisted nicknames # blacklisted nicknames
nicknames: nicknames:
- Notch - Notch
nickname-in-tablist: true nickname-in-tablist: true
# {player} : player sending command # {player} : player sending command
# {command} : command typed # {command} : command typed
commandspy: commandspy:
format: '&6{player}: {command}' format: '&6{player}: {command}'
worldeditcommands: true worldeditcommands: true
antispam: antispam:
enabled: true enabled: true
# Number of messages to be spam # Number of messages to be spam
spamnumber: 5 spamnumber: 5
# Amount of time in seconds for it to be spam # Amount of time in seconds for it to be spam
spamtime: 10 spamtime: 10
# Amount of time for the mute to last # Amount of time for the mute to last
# Acceptable units are: d,h,m,s # Acceptable units are: d,h,m,s
# Units can be combined, for example: 1d8h30m15s # Units can be combined, for example: 1d8h30m15s
# Use 0 for untimed mute # Use 0 for untimed mute
mutetime: 10m mutetime: 10m
# Logging chat and commands to a mysql database # Logging chat and commands to a mysql database
mysql: mysql:
enabled: false enabled: false
user: User user: User
port: 3306 port: 3306
password: Password password: Password
host: localhost host: localhost
database: Database database: Database
# Loglevel feature is still in the works for adding of debug messages # Loglevel feature is still in the works for adding of debug messages
# Valid loglevels: # Valid loglevels:
# Info: Regular logging # Info: Regular logging
# Debug: Show extra messages and caught errors for debugging # Debug: Show extra messages and caught errors for debugging
# Severe: Only show severe messages # Severe: Only show severe messages
loglevel: info loglevel: info
# saveinterval is in minutes # saveinterval is in minutes
saveinterval: 30 saveinterval: 30
# If you're running a "cracked" server, player data might not be stored properly, and thus, you are on your own. # If you're running a "cracked" server, player data might not be stored properly, and thus, you are on your own.
# If you run your server in offline mode, you might have to reset your player data when switching to online mode! # If you run your server in offline mode, you might have to reset your player data when switching to online mode!
# If you see this warning by accident and you are using BungeeCord, make sure you have properly setup IP Forwarding. # If you see this warning by accident and you are using BungeeCord, make sure you have properly setup IP Forwarding.
# https://www.spigotmc.org/wiki/bungeecord-ip-forwarding/ # https://www.spigotmc.org/wiki/bungeecord-ip-forwarding/
# No player data will be saved in offline mode unless you set this acknowledgement to 'true' # No player data will be saved in offline mode unless you set this acknowledgement to 'true'
offline_server_acknowledgement: false offline_server_acknowledgement: false
# The time in seconds between each check to remove timed mutes # The time in seconds between each check to remove timed mutes
unmuteinterval: 60 unmuteinterval: 60
# Enables or disabled BungeeCord messaging # Enables or disabled BungeeCord messaging
bungeecordmessaging: false bungeecordmessaging: false
# Sound for message notification # Sound for message notification
message_sound: ENTITY_PLAYER_LEVELUP # Enter 'None' to disable the sound
message_sound: ENTITY_PLAYER_LEVELUP
# This will allow vanished players to be exempt from being sent private messages, and will act as if they aren't online
vanishsupport: true # This will allow vanished players to be exempt from being sent private messages, and will act as if they aren't online
vanishsupport: true
# Use PlaceholderAPI placeholders
# Start the placeholder with 'sender_' for the sending players placeholder # Use PlaceholderAPI placeholders
# Start the placeholder with 'receiver_' for the receiving players placeholder # Start the placeholder with 'sender_' for the sending players placeholder
# The defaults shown below provide an example of each # Start the placeholder with 'receiver_' for the receiving players placeholder
tellformatto: '&7You message {receiver_vault_prefix}{receiver_player_displayname}&7:' # The defaults shown below provide an example of each
tellformatfrom: '{sender_vault_prefix}{sender_player_displayname} &7messages you:' tellformatto: '&7You message {receiver_vault_prefix}{receiver_player_displayname}&7:'
tellformatspy: '{sender_player_name} messages {receiver_player_name}:&7' tellformatfrom: '{sender_vault_prefix}{sender_player_displayname} &7messages you:'
replyformatto: '&7You reply to {receiver_vault_prefix}{receiver_player_displayname}&7:' tellformatspy: '{sender_player_name} messages {receiver_player_name}:&7'
replyformatfrom: '{sender_vault_prefix}{sender_player_displayname} &7replies to you:' replyformatto: '&7You reply to {receiver_vault_prefix}{receiver_player_displayname}&7:'
replyformatspy: '{sender_player_name} replies to {receiver_player_name}:&7' replyformatfrom: '{sender_vault_prefix}{sender_player_displayname} &7replies to you:'
replyformatspy: '{sender_player_name} replies to {receiver_player_name}:&7'
# {host} : party hosts name
# {player} : player name # {host} : party hosts name
# use Default for the basic formatting # {player} : player name
partyformat: Default # use Default for the basic formatting
partyformat: Default
formatcleaner: true
formatcleaner: true
# If true, /ignore will block chat from the ignored player as well as PM's
ignorechat: false # If true, /ignore will block chat from the ignored player as well as PM's
ignorechat: false
# The message shown to players alerting them no one is in the channel to hear them
emptychannelalert: "&6No one is listening to you." # The message shown to players alerting them no one is in the channel to hear them
emptychannelalert: "&6No one is listening to you."
messageremoverpermissions: '&cYou need additional permissions to view this message!'
messageremovertext: '&c&o<message removed>' messageremoverpermissions: '&cYou need additional permissions to view this message!'
messageremovertext: '&c&o<message removed>'
# The name of the group is the permissions node for the format
# Example: venturechat.json.Owner is the node for the group Owner # The name of the group is the permissions node for the format
# A lower priority overrides a higher priority if a player has more than 1 group # Example: venturechat.json.Owner is the node for the group Owner
# Possible options for click_name and click_prefix are suggest_command, run_command, and open_url # A lower priority overrides a higher priority if a player has more than 1 group
jsonformatting: # Possible options for click_name and click_prefix are suggest_command, run_command, and open_url
Default: # This default format is required! Do not delete or rename it! jsonformatting:
priority: 2147483647 # Integer.MAX_VALUE Default: # This default format is required! Do not delete or rename it!
hover_name: priority: 2147483647 # Integer.MAX_VALUE
- '&6I have no rank!' hover_name:
click_name: 'suggest_command' - '&6I have no rank!'
click_name_text: '/msg {player_name}' click_name: 'suggest_command'
hover_prefix: click_name_text: '/msg {player_name}'
- '&dI am default!' hover_prefix:
click_prefix: 'run_command' - '&dI am default!'
click_prefix_text: '/help' click_prefix: 'run_command'
hover_suffix: click_prefix_text: '/help'
- '&dI am default suffix!' hover_suffix:
click_suffix: 'suggest_command' - '&dI am default suffix!'
click_suffix_text: '/msg {player_name}' click_suffix: 'suggest_command'
Owner: click_suffix_text: '/msg {player_name}'
priority: 1 # Lowest Priority Owner:
hover_name: priority: 1 # Lowest Priority
- '&cOwner of the server!' hover_name:
- '&bMessage me for help!' - '&cOwner of the server!'
click_name: 'suggest_command' - '&bMessage me for help!'
click_name_text: '/msg {player_name}' click_name: 'suggest_command'
hover_prefix: click_name_text: '/msg {player_name}'
- '&dServer Owner' hover_prefix:
click_prefix: 'run_command' - '&dServer Owner'
click_prefix_text: '/help' click_prefix: 'run_command'
hover_suffix: click_prefix_text: '/help'
- '&dI am Owner suffix!' hover_suffix:
click_suffix: 'suggest_command' - '&dI am Owner suffix!'
click_suffix_text: '/msg {player_name}' click_suffix: 'suggest_command'
click_suffix_text: '/msg {player_name}'
# The icon is the block shown in the GUI
# The text is the display name of the block icon # The icon is the block shown in the GUI
# Include a slash (/) before the command # The text is the display name of the block icon
# Permissions are the name of the button and automatically include "venturechat." # Include a slash (/) before the command
# Example: mute equals venturechat.mute # Permissions are the name of the button and automatically include "venturechat."
venturegui: # Example: mute equals venturechat.mute
mute: venturegui:
icon: 'REDSTONE_BLOCK' mute:
durability: 0 icon: 'REDSTONE_BLOCK'
text: '&cMute {player_name} &410m' durability: 0
permission: 'mute' text: '&cMute {player_name} &410m'
command: '/mute {channel} {player_name} 10m' permission: 'mute'
slot: 1 command: '/mute {channel} {player_name} 10m'
unmute: slot: 1
icon: 'DIAMOND_BLOCK' unmute:
durability: 0 icon: 'DIAMOND_BLOCK'
text: '&bUnmute {player_name}' durability: 0
permission: 'mute' text: '&bUnmute {player_name}'
command: '/unmute {channel} {player_name} ' permission: 'mute'
slot: 2 command: '/unmute {channel} {player_name} '
removemessage: slot: 2
icon: 'DIAMOND_AXE' removemessage:
durability: 0 icon: 'DIAMOND_AXE'
text: '&cRemove Message' durability: 0
permission: 'removemessage' text: '&cRemove Message'
command: '/removemessage {hash} {channel}' permission: 'removemessage'
slot: 7 command: '/removemessage {hash} {channel}'
slot: 7
guiicon: '&c [✓]'
guitext: '&cOpen Moderation GUI' guiicon: '&c [✓]'
guirows: 1 guitext: '&cOpen Moderation GUI'
guirows: 1
# All clickable URL's will be underlined if set to true
underlineurls: true # All clickable URL's will be underlined if set to true
underlineurls: true
# broadcast information
broadcast: # broadcast information
color: red broadcast:
permissions: venturechat.adminchannel color: red
displaytag: '[Broadcast]' permissions: venturechat.adminchannel
displaytag: '[Broadcast]'
# Use $ to include arguments into the message
# Valid component types are: # Use $ to include arguments into the message
# Command: Sends a message or command in chat # Valid component types are:
# Message: Sends a message to the player # Command: Sends a message or command in chat
# Broadcast: Sends a broadcast to all players on the server # Message: Sends a message to the player
# Permissions automatically include "venturechat." # Broadcast: Sends a broadcast to all players on the server
# Example: permissions: alert equals venturechat.alert # Permissions automatically include "venturechat."
# Use None for no permissions # Example: permissions: alert equals venturechat.alert
# The number of arguments is the minimum number of required arguments, use 0 for no required arguments # Use None for no permissions
alias: # The number of arguments is the minimum number of required arguments, use 0 for no required arguments
vote: alias:
arguments: 0 vote:
permissions: None arguments: 0
components: permissions: None
- 'Message: &6Vote here: www.votelinkhere.com' components:
bane: - 'Message: &6Vote here: www.votelinkhere.com'
arguments: 2 bane:
permissions: bane arguments: 2
components: permissions: bane
- 'Command: /ban $ appeal at www.site.com' components:
- 'Command: /st banned $' - 'Command: /ban $ appeal at www.site.com'
alert: - 'Command: /st banned $'
arguments: 1 alert:
permissions: alert arguments: 1
components: permissions: alert
- 'Broadcast: &c<Alert> $' components:
donate: - 'Broadcast: &c<Alert> $'
arguments: 0 donate:
permissions: None arguments: 0
components: permissions: None
- 'Message: &bDonate here: www.mywebsite.com' components:
website: - 'Message: &bDonate here: www.mywebsite.com'
arguments: 0 website:
permissions: None arguments: 0
components: permissions: None
- 'Message: &aThis is our website: www.site.net' components:
- 'Message: &aThis is our website: www.site.net'
# Enables the creation of special Towny channels: Town and Nation
# To create these channels, simply name two channels below "Town" and "Nation" # Enables the creation of special Towny channels: Town and Nation
# Bungeecord must be set to false for these channels! # To create these channels, simply name two channels below "Town" and "Nation"
enable_towny_channel: false # Bungeecord must be set to false for these channels!
enable_towny_channel: false
# Enables the creation of a special faction only channel using the Factions plugin
# To create this channel, simply name a channel below "Faction" # Enables the creation of a special faction only channel using the Factions plugin
# Bungeecord must be set to false for this channel! # To create this channel, simply name a channel below "Faction"
# WARNING: May not work for all versions of Factions! # Bungeecord must be set to false for this channel!
enable_factions_channel: false # WARNING: May not work for all versions of Factions!
enable_factions_channel: false
# color = [channel] color
# chatcolor = text color # color = [channel] color
# cooldown is in seconds # chatcolor = text color
# bungeecord overrides distance # cooldown is in seconds
# channel permissions are configurable # bungeecord overrides distance
# channels can be changed, and new channels can be created # channel permissions are configurable
# Permissions automatically include "venturechat." # channels can be changed, and new channels can be created
# Example: permissions: staff equals venturechat.staff # Permissions automatically include "venturechat."
# Use None for no permissions # Example: permissions: staff equals venturechat.staff
# Use None for no permissions
# Use PlaceholderAPI placeholders are required!!!
# Use PlaceholderAPI placeholders are required!!! # Use PlaceholderAPI placeholders are required!!!
# Use PlaceholderAPI placeholders are required!!! # Use PlaceholderAPI placeholders are required!!!
# /papi ecloud download [plugin] # Use PlaceholderAPI placeholders are required!!!
# /papi reload # /papi ecloud download [plugin]
# Use '' or "" around format, example: '[&2global&f] {vault_prefix} {player_displayname}&2:' # /papi reload
# You must have prefixes and suffixes set in a Vault compatible permissions plugin to avoid errors # Use '' or "" around format, example: '[&2global&f] {vault_prefix} {player_displayname}&2:'
# Use "" as the prefix or suffix to have none # You must have prefixes and suffixes set in a Vault compatible permissions plugin to avoid errors
# Use "" as the prefix or suffix to have none
# Set chatcolor to 'None' to have a group based chat color! Don't forget to put a suffix or other placeholder at the end of the format!
# Set chatcolor to 'None' to have a group based chat color! Don't forget to put a suffix or other placeholder at the end of the format!
# Important!!!
# Important!!! # Important!!!
# If you delete a channel, restart the server! Do not use /chatreload!!! # Important!!!
channels: # If you delete a channel, restart the server! Do not use /chatreload!!!
GroupChatColorExample: channels:
color: '#706C1E' GroupChatColorExample:
chatcolor: 'None' color: '#706C1E'
mutable: true chatcolor: 'None'
filter: true mutable: true
autojoin: true filter: true
default: false autojoin: true
distance: 0 default: false
cooldown: 0 distance: 0
bungeecord: false cooldown: 0
alias: ge bungeecord: false
permissions: None alias: ge
speak_permissions: None permissions: None
format: '&f[#706C1EGroupColorChat&f] {vault_prefix} {player_displayname}#706C1E:{vault_suffix}' speak_permissions: None
HexExample: format: '&f[#706C1EGroupColorChat&f] {vault_prefix} {player_displayname}#706C1E:{vault_suffix}'
color: '#ff0000' HexExample:
chatcolor: '#ff0000' color: '#ff0000'
mutable: true chatcolor: '#ff0000'
filter: true mutable: true
autojoin: true filter: true
default: false autojoin: true
distance: 0 default: false
cooldown: 0 distance: 0
bungeecord: false cooldown: 0
alias: he bungeecord: false
permissions: None alias: he
speak_permissions: None permissions: None
format: '&f[#ff0000Hex&f] {vault_prefix} {player_displayname}#ff0000:' speak_permissions: None
BungeeExample: format: '&f[#ff0000Hex&f] {vault_prefix} {player_displayname}#ff0000:'
color: gold BungeeExample:
chatcolor: gold color: gold
mutable: true chatcolor: gold
filter: true mutable: true
autojoin: true filter: true
default: false autojoin: true
distance: 0 default: false
cooldown: 3 distance: 0
bungeecord: true cooldown: 3
alias: be bungeecord: true
permissions: None alias: be
speak_permissions: None permissions: None
format: '&f[&6Network&f] {vault_prefix} {player_displayname}&6:' speak_permissions: None
AnnouncementExample: format: '&f[&6Network&f] {vault_prefix} {player_displayname}&6:'
color: red AnnouncementExample:
chatcolor: red color: red
mutable: false chatcolor: red
filter: false mutable: false
autojoin: true filter: false
default: false autojoin: true
distance: 0 default: false
cooldown: 0 distance: 0
bungeecord: true cooldown: 0
alias: announce bungeecord: true
permissions: None alias: announce
speak_permissions: announcement permissions: None
format: '&f[&aServer Announcement&f] {vault_prefix} {player_displayname}&c:' speak_permissions: announcement
Global: format: '&f[&aServer Announcement&f] {vault_prefix} {player_displayname}&c:'
color: dark_green Global:
chatcolor: dark_green color: dark_green
mutable: true chatcolor: dark_green
filter: true mutable: true
autojoin: true filter: true
default: true autojoin: true
distance: 0 default: true
cooldown: 0 distance: 0
bungeecord: false cooldown: 0
alias: g bungeecord: false
permissions: None alias: g
speak_permissions: None permissions: None
format: '&f[&2Global&f] {vault_prefix} {player_displayname}&2:' speak_permissions: None
Staff: format: '&f[&2Global&f] {vault_prefix} {player_displayname}&2:'
color: green Staff:
chatcolor: green color: green
mutable: false chatcolor: green
filter: false mutable: false
autojoin: true filter: false
default: false autojoin: true
distance: 0 default: false
cooldown: 0 distance: 0
bungeecord: false cooldown: 0
alias: st bungeecord: false
permissions: staffchannel alias: st
speak_permissions: None permissions: staffchannel
format: '&f[&aStaff&f] {vault_prefix} {player_displayname}&a:' speak_permissions: None
Donator: format: '&f[&aStaff&f] {vault_prefix} {player_displayname}&a:'
color: light_purple Donator:
chatcolor: light_purple color: light_purple
mutable: true chatcolor: light_purple
filter: true mutable: true
autojoin: true filter: true
default: false autojoin: true
distance: 0 default: false
cooldown: 0 distance: 0
bungeecord: false cooldown: 0
alias: d bungeecord: false
permissions: donatorchannel alias: d
speak_permissions: None permissions: donatorchannel
format: '&f[&dDonator&f] {vault_prefix} {player_displayname}&d:' speak_permissions: None
Help: format: '&f[&dDonator&f] {vault_prefix} {player_displayname}&d:'
color: aqua Help:
chatcolor: aqua color: aqua
mutable: true chatcolor: aqua
filter: true mutable: true
autojoin: true filter: true
default: false autojoin: true
distance: 0 default: false
cooldown: 0 distance: 0
bungeecord: false cooldown: 0
alias: h bungeecord: false
permissions: None alias: h
speak_permissions: None permissions: None
format: '&f[&bHelp&f] {vault_prefix} {player_displayname}&b:' speak_permissions: None
Trade: format: '&f[&bHelp&f] {vault_prefix} {player_displayname}&b:'
color: dark_aqua Trade:
chatcolor: dark_aqua color: dark_aqua
mutable: true chatcolor: dark_aqua
filter: true mutable: true
autojoin: true filter: true
default: false autojoin: true
distance: 0 default: false
cooldown: 0 distance: 0
bungeecord: false cooldown: 0
alias: t bungeecord: false
permissions: None alias: t
speak_permissions: None permissions: None
format: '&f[&3Trade&f] {vault_prefix} {player_displayname}&3:' speak_permissions: None
Local: format: '&f[&3Trade&f] {vault_prefix} {player_displayname}&3:'
color: yellow Local:
chatcolor: yellow color: yellow
mutable: true chatcolor: yellow
filter: true mutable: true
autojoin: true filter: true
default: false autojoin: true
distance: 230 default: false
cooldown: 0 distance: 230
bungeecord: false cooldown: 0
alias: l bungeecord: false
permissions: None alias: l
speak_permissions: None permissions: None
speak_permissions: None
format: '&f[&eLocal&f] {vault_prefix} {player_displayname}&e:' format: '&f[&eLocal&f] {vault_prefix} {player_displayname}&e:'

View File

@ -1,187 +1,187 @@
package mineverse.Aust1n46.chat.utilities; package mineverse.Aust1n46.chat.utilities;
import static mineverse.Aust1n46.chat.utilities.Format.BUKKIT_COLOR_CODE_PREFIX; import static mineverse.Aust1n46.chat.utilities.Format.BUKKIT_COLOR_CODE_PREFIX;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
import org.junit.After; import org.junit.After;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.mockito.Mockito; import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito; import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner; import org.powermock.modules.junit4.PowerMockRunner;
import mineverse.Aust1n46.chat.MineverseChat; import mineverse.Aust1n46.chat.MineverseChat;
/** /**
* Tests {@link Format}. * Tests {@link Format}.
*/ */
@RunWith(PowerMockRunner.class) @RunWith(PowerMockRunner.class)
@PrepareForTest({ MineverseChat.class }) @PrepareForTest({ MineverseChat.class })
public class FormatTest { public class FormatTest {
private MineverseChat mockPlugin; private MineverseChat mockPlugin;
private FileConfiguration mockConfig; private FileConfiguration mockConfig;
private List<String> filters; private List<String> filters;
@Before @Before
public void setUp() { public void setUp() {
filters = new ArrayList<String>(); filters = new ArrayList<String>();
filters.add("ass,donut"); filters.add("ass,donut");
mockPlugin = Mockito.mock(MineverseChat.class); mockPlugin = Mockito.mock(MineverseChat.class);
mockConfig = Mockito.mock(FileConfiguration.class); mockConfig = Mockito.mock(FileConfiguration.class);
PowerMockito.mockStatic(MineverseChat.class); PowerMockito.mockStatic(MineverseChat.class);
PowerMockito.when(MineverseChat.getInstance()).thenReturn(mockPlugin); PowerMockito.when(MineverseChat.getInstance()).thenReturn(mockPlugin);
Mockito.when(mockPlugin.getConfig()).thenReturn(mockConfig); Mockito.when(mockPlugin.getConfig()).thenReturn(mockConfig);
Mockito.when(mockConfig.getStringList("filters")).thenReturn(filters); Mockito.when(mockConfig.getStringList("filters")).thenReturn(filters);
} }
@After @After
public void tearDown() { public void tearDown() {
mockPlugin = null; mockPlugin = null;
mockConfig = null; mockConfig = null;
filters = new ArrayList<String>(); filters = new ArrayList<String>();
} }
@Test @Test
public void testGetLastCodeSingleColor() { public void testGetLastCodeSingleColor() {
String input = BUKKIT_COLOR_CODE_PREFIX + "cHello"; String input = BUKKIT_COLOR_CODE_PREFIX + "cHello";
String expectedResult = BUKKIT_COLOR_CODE_PREFIX + "c"; String expectedResult = BUKKIT_COLOR_CODE_PREFIX + "c";
String result = Format.getLastCode(input); String result = Format.getLastCode(input);
assertEquals(expectedResult, result); assertEquals(expectedResult, result);
} }
@Test @Test
public void testGetLastCodeColorAfterFormat() { public void testGetLastCodeColorAfterFormat() {
String input = BUKKIT_COLOR_CODE_PREFIX + "o" + BUKKIT_COLOR_CODE_PREFIX + "cHello"; String input = BUKKIT_COLOR_CODE_PREFIX + "o" + BUKKIT_COLOR_CODE_PREFIX + "cHello";
String expectedResult = BUKKIT_COLOR_CODE_PREFIX + "c"; String expectedResult = BUKKIT_COLOR_CODE_PREFIX + "c";
String result = Format.getLastCode(input); String result = Format.getLastCode(input);
assertEquals(expectedResult, result); assertEquals(expectedResult, result);
} }
@Test @Test
public void testGetLastCodeColorBeforeFormat() { public void testGetLastCodeColorBeforeFormat() {
String input = BUKKIT_COLOR_CODE_PREFIX + "c" + BUKKIT_COLOR_CODE_PREFIX + "oHello"; String input = BUKKIT_COLOR_CODE_PREFIX + "c" + BUKKIT_COLOR_CODE_PREFIX + "oHello";
String expectedResult = BUKKIT_COLOR_CODE_PREFIX + "c" + BUKKIT_COLOR_CODE_PREFIX + "o"; String expectedResult = BUKKIT_COLOR_CODE_PREFIX + "c" + BUKKIT_COLOR_CODE_PREFIX + "o";
String result = Format.getLastCode(input); String result = Format.getLastCode(input);
assertEquals(expectedResult, result); assertEquals(expectedResult, result);
} }
@Test @Test
public void testFilterChat() { public void testFilterChat() {
String test = "I am an ass"; String test = "I am an ass";
String expectedResult = "I am an donut"; String expectedResult = "I am an donut";
String result = Format.FilterChat(test); String result = Format.FilterChat(test);
assertEquals(expectedResult, result); assertEquals(expectedResult, result);
} }
@Test @Test
public void testIsValidColor() { public void testIsValidColor() {
String color = "red"; String color = "red";
boolean result = Format.isValidColor(color); boolean result = Format.isValidColor(color);
assertTrue(result); assertTrue(result);
} }
@Test @Test
public void testIsInvalidColor() { public void testIsInvalidColor() {
String color = "randomString"; String color = "randomString";
boolean result = Format.isValidColor(color); boolean result = Format.isValidColor(color);
assertFalse(result); assertFalse(result);
} }
@Test @Test
public void testIsValidHexColor() { public void testIsValidHexColor() {
String hexColor = "#ff00ff"; String hexColor = "#ff00ff";
boolean result = Format.isValidHexColor(hexColor); boolean result = Format.isValidHexColor(hexColor);
assertTrue(result); assertTrue(result);
} }
@Test @Test
public void testIsInvalidHexColor() { public void testIsInvalidHexColor() {
String hexColor = "#random"; String hexColor = "#random";
boolean result = Format.isValidHexColor(hexColor); boolean result = Format.isValidHexColor(hexColor);
assertFalse(result); assertFalse(result);
} }
@Test @Test
public void testConvertHexColorCodeToBukkitColorCode() { public void testConvertHexColorCodeToBukkitColorCode() {
String hexColor = "#ff00ff"; String hexColor = "#ff00ff";
String expectedResult = BUKKIT_COLOR_CODE_PREFIX + "x" + BUKKIT_COLOR_CODE_PREFIX + "f" String expectedResult = BUKKIT_COLOR_CODE_PREFIX + "x" + BUKKIT_COLOR_CODE_PREFIX + "f"
+ BUKKIT_COLOR_CODE_PREFIX + "f" + BUKKIT_COLOR_CODE_PREFIX + "0" + BUKKIT_COLOR_CODE_PREFIX + "0" + BUKKIT_COLOR_CODE_PREFIX + "f" + BUKKIT_COLOR_CODE_PREFIX + "0" + BUKKIT_COLOR_CODE_PREFIX + "0"
+ BUKKIT_COLOR_CODE_PREFIX + "f" + BUKKIT_COLOR_CODE_PREFIX + "f"; + BUKKIT_COLOR_CODE_PREFIX + "f" + BUKKIT_COLOR_CODE_PREFIX + "f";
String result = Format.convertHexColorCodeToBukkitColorCode(hexColor); String result = Format.convertHexColorCodeToBukkitColorCode(hexColor);
assertEquals(expectedResult, result); assertEquals(expectedResult, result);
} }
@Test @Test
public void testConvertHexColorCodeStringToBukkitColorCodeString() { public void testConvertHexColorCodeStringToBukkitColorCodeString() {
String input = "#ff00ffHello" + BUKKIT_COLOR_CODE_PREFIX + "cThere#00ff00Austin"; String input = "#ff00ffHello" + BUKKIT_COLOR_CODE_PREFIX + "cThere#00ff00Austin";
String expectedResult = BUKKIT_COLOR_CODE_PREFIX + "x" + BUKKIT_COLOR_CODE_PREFIX + "f" String expectedResult = BUKKIT_COLOR_CODE_PREFIX + "x" + BUKKIT_COLOR_CODE_PREFIX + "f"
+ BUKKIT_COLOR_CODE_PREFIX + "f" + BUKKIT_COLOR_CODE_PREFIX + "0" + BUKKIT_COLOR_CODE_PREFIX + "0" + BUKKIT_COLOR_CODE_PREFIX + "f" + BUKKIT_COLOR_CODE_PREFIX + "0" + BUKKIT_COLOR_CODE_PREFIX + "0"
+ BUKKIT_COLOR_CODE_PREFIX + "f" + BUKKIT_COLOR_CODE_PREFIX + "fHello" + BUKKIT_COLOR_CODE_PREFIX + BUKKIT_COLOR_CODE_PREFIX + "f" + BUKKIT_COLOR_CODE_PREFIX + "fHello" + BUKKIT_COLOR_CODE_PREFIX
+ "cThere" + BUKKIT_COLOR_CODE_PREFIX + "x" + BUKKIT_COLOR_CODE_PREFIX + "0" + BUKKIT_COLOR_CODE_PREFIX + "cThere" + BUKKIT_COLOR_CODE_PREFIX + "x" + BUKKIT_COLOR_CODE_PREFIX + "0" + BUKKIT_COLOR_CODE_PREFIX
+ "0" + BUKKIT_COLOR_CODE_PREFIX + "f" + BUKKIT_COLOR_CODE_PREFIX + "f" + BUKKIT_COLOR_CODE_PREFIX + "0" + "0" + BUKKIT_COLOR_CODE_PREFIX + "f" + BUKKIT_COLOR_CODE_PREFIX + "f" + BUKKIT_COLOR_CODE_PREFIX + "0"
+ BUKKIT_COLOR_CODE_PREFIX + "0Austin"; + BUKKIT_COLOR_CODE_PREFIX + "0Austin";
String result = Format.convertHexColorCodeStringToBukkitColorCodeString(input); String result = Format.convertHexColorCodeStringToBukkitColorCodeString(input);
assertEquals(expectedResult, result); assertEquals(expectedResult, result);
} }
@Test @Test
public void testFormatStringLegacyColor_NoColorCode() { public void testFormatStringLegacyColor_NoColorCode() {
String input = "Hello There Austin"; String input = "Hello There Austin";
String expectedResult = "Hello There Austin"; String expectedResult = "Hello There Austin";
String result = Format.FormatStringLegacyColor(input); String result = Format.FormatStringLegacyColor(input);
assertEquals(expectedResult, result); assertEquals(expectedResult, result);
} }
@Test @Test
public void testFormatStringLegacyColor_LegacyCodeOnly() { public void testFormatStringLegacyColor_LegacyCodeOnly() {
String input = "Hello &cThere Austin"; String input = "Hello &cThere Austin";
String expectedResult = "Hello " + BUKKIT_COLOR_CODE_PREFIX + "cThere Austin"; String expectedResult = "Hello " + BUKKIT_COLOR_CODE_PREFIX + "cThere Austin";
String result = Format.FormatStringLegacyColor(input); String result = Format.FormatStringLegacyColor(input);
assertEquals(expectedResult, result); assertEquals(expectedResult, result);
} }
@Test @Test
public void testFormatStringLegacyColor_SpigotHexCodeOnly() { public void testFormatStringLegacyColor_SpigotHexCodeOnly() {
String input = "&x&f&f&f&f&f&fHello There Austin"; String input = "&x&f&f&f&f&f&fHello There Austin";
String expectedResult = "&x&f&f&f&f&f&fHello There Austin"; String expectedResult = "&x&f&f&f&f&f&fHello There Austin";
String result = Format.FormatStringLegacyColor(input); String result = Format.FormatStringLegacyColor(input);
assertEquals(expectedResult, result); assertEquals(expectedResult, result);
} }
@Test @Test
public void testFormatStringLegacyColor_BothColorCodes() { public void testFormatStringLegacyColor_BothColorCodes() {
String input = "&x&f&f&f&f&f&f&cHello There Austin"; String input = "&x&f&f&f&f&f&f&cHello There Austin";
String expectedResult = "&x&f&f&f&f&f&f" + BUKKIT_COLOR_CODE_PREFIX + "cHello There Austin"; String expectedResult = "&x&f&f&f&f&f&f" + BUKKIT_COLOR_CODE_PREFIX + "cHello There Austin";
String result = Format.FormatStringLegacyColor(input); String result = Format.FormatStringLegacyColor(input);
assertEquals(expectedResult, result); assertEquals(expectedResult, result);
} }
} }