Remove hardcoded "Default" message format

Created new default format in the config as an example
This commit is contained in:
Aust1n46 2020-08-07 23:33:15 -05:00
parent 1ffdd26027
commit e23480805c
4 changed files with 18 additions and 52 deletions

View File

@ -103,13 +103,12 @@ vanishsupport: true
# {playerto} : player receivings name
# {playerfrom} : player sendings name
# use Default for the basic formatting
tellformatto: Default
tellformatfrom: Default
tellformatspy: Default
replyformatto: Default
replyformatfrom: Default
replyformatspy: Default
tellformatto: 'You message {playerto}:&7'
tellformatfrom: '{playerfrom} messages you:&7'
tellformatspy: '{playerfrom} messages {playerto}:&7'
replyformatto: 'You reply to {playerto}:&7'
replyformatfrom: '{playerfrom} replies to you:&7'
replyformatspy: '{playerfrom} replied to {playerto}:&7'
# {host} : party hosts name
# {player} : player name

View File

@ -103,13 +103,12 @@ vanishsupport: true
# {playerto} : player receivings name
# {playerfrom} : player sendings name
# use Default for the basic formatting
tellformatto: Default
tellformatfrom: Default
tellformatspy: Default
replyformatto: Default
replyformatfrom: Default
replyformatspy: Default
tellformatto: 'You message {playerto}:&7'
tellformatfrom: '{playerfrom} messages you:&7'
tellformatspy: '{playerfrom} messages {playerto}:&7'
replyformatto: 'You reply to {playerto}:&7'
replyformatfrom: '{playerfrom} replies to you:&7'
replyformatspy: '{playerfrom} replied to {playerto}:&7'
# {host} : party hosts name
# {player} : player name

View File

@ -49,7 +49,6 @@ public class Message extends MineverseCommand {
String send = "";
String echo = "";
String spy = "";
String tellColor = plugin.getConfig().getString("tellcolor", "gray");
for(int r = 1; r < args.length; r++) {
msg += " " + args[r];
}
@ -62,24 +61,9 @@ public class Message extends MineverseCommand {
if(mcp.getPlayer().hasPermission("venturechat.format")) {
msg = Format.FormatString(msg);
}
if(plugin.getConfig().getString("tellformatfrom").equalsIgnoreCase("Default")) {
send = "{playerfrom} messages you:" + ChatColor.valueOf(tellColor.toUpperCase()) + msg;
}
else {
send = Format.FormatStringAll(plugin.getConfig().getString("tellformatfrom")) + msg;
}
if(plugin.getConfig().getString("tellformatto").equalsIgnoreCase("Default")) {
echo = "You message {playerto}:" + ChatColor.valueOf(tellColor.toUpperCase()) + msg;
}
else {
echo = Format.FormatStringAll(plugin.getConfig().getString("tellformatto")) + msg;
}
if(plugin.getConfig().getString("tellformatspy").equalsIgnoreCase("Default")) {
spy = "{playerfrom} messages {playerto}:" + ChatColor.valueOf(tellColor.toUpperCase()) + msg;
}
else {
spy = Format.FormatStringAll(plugin.getConfig().getString("tellformatspy")) + msg;
}
send = Format.FormatStringAll(plugin.getConfig().getString("tellformatfrom")) + msg;
echo = Format.FormatStringAll(plugin.getConfig().getString("tellformatto")) + msg;
spy = Format.FormatStringAll(plugin.getConfig().getString("tellformatspy")) + msg;
try {
out.writeUTF("Message");
out.writeUTF("Send");

View File

@ -40,28 +40,12 @@ public class Reply extends MineverseCommand {
String send = "";
String echo = "";
String spy = "";
String tellColor = plugin.getConfig().getString("tellcolor", "gray");
for(int r = 0; r < args.length; r++) {
msg += " " + args[r];
}
if(plugin.getConfig().getString("tellformatfrom").equalsIgnoreCase("Default")) {
send = "{playerfrom} replies to you:" + ChatColor.valueOf(tellColor.toUpperCase()) + msg;
}
else {
send = Format.FormatStringAll(plugin.getConfig().getString("tellformatfrom")) + msg;
}
if(plugin.getConfig().getString("tellformatto").equalsIgnoreCase("Default")) {
echo = "You reply to {playerto}:" + ChatColor.valueOf(tellColor.toUpperCase()) + msg;
}
else {
echo = Format.FormatStringAll(plugin.getConfig().getString("tellformatto")) + msg;
}
if(plugin.getConfig().getString("tellformatspy").equalsIgnoreCase("Default")) {
spy = "{playerfrom} replied to {playerto}:" + ChatColor.valueOf(tellColor.toUpperCase()) + msg;
}
else {
spy = Format.FormatStringAll(plugin.getConfig().getString("tellformatspy")) + msg;
}
send = Format.FormatStringAll(plugin.getConfig().getString("replyformatfrom")) + msg;
echo = Format.FormatStringAll(plugin.getConfig().getString("replyformatto")) + msg;
spy = Format.FormatStringAll(plugin.getConfig().getString("replyformatspy")) + msg;
try {
out.writeUTF("Message");
out.writeUTF("Send");