mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-12-25 17:08:32 +01:00
Include world in plot chat & spy template
This commit is contained in:
parent
87d134215f
commit
b224a8d1b8
@ -701,8 +701,10 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
String message = event.getMessage();
|
||||
String sender = event.getPlayer().getDisplayName();
|
||||
PlotId id = plot.getId();
|
||||
String worldName = plot.getWorldName();
|
||||
Caption msg = TranslatableCaption.of("chat.plot_chat_format");
|
||||
Template msgTemplate;
|
||||
Template worldNameTemplate = Template.of("world", worldName);
|
||||
Template plotTemplate = Template.of("plot_id", id.toString());
|
||||
Template senderTemplate = Template.of("sender", sender);
|
||||
// If we do/don't want colour, we need to be careful about how to go about it, as players could attempt either <gold></gold> or &6 etc.
|
||||
@ -723,7 +725,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
ChatColor.stripColor(BukkitUtil.LEGACY_COMPONENT_SERIALIZER.serialize(Component.text(message)))));
|
||||
}
|
||||
for (PlotPlayer<?> receiver : plotRecipients) {
|
||||
receiver.sendMessage(msg, msgTemplate, plotTemplate, senderTemplate);
|
||||
receiver.sendMessage(msg, worldNameTemplate, msgTemplate, plotTemplate, senderTemplate);
|
||||
}
|
||||
if (!spies.isEmpty()) {
|
||||
Caption spymsg = TranslatableCaption.of("chat.plot_chat_spy_format");
|
||||
@ -731,7 +733,7 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
Template spysenderTemplate = Template.of("sender", sender);
|
||||
Template spymessageTemplate = Template.of("msg", Component.text(message));
|
||||
for (PlotPlayer<?> player : spies) {
|
||||
player.sendMessage(spymsg, plotidTemplate, spysenderTemplate, spymessageTemplate);
|
||||
player.sendMessage(spymsg, worldNameTemplate, plotidTemplate, spysenderTemplate, spymessageTemplate);
|
||||
}
|
||||
}
|
||||
if (Settings.Chat.LOG_PLOTCHAT_TO_CONSOLE) {
|
||||
@ -739,7 +741,9 @@ public class PlayerEventListener extends PlotListener implements Listener {
|
||||
Template plotidTemplate = Template.of("plot_id", id.getX() + ";" + id.getY());
|
||||
Template spysenderTemplate = Template.of("sender", sender);
|
||||
Template spymessageTemplate = Template.of("msg", Component.text(message));
|
||||
ConsolePlayer.getConsole().sendMessage(spymsg, plotidTemplate, spysenderTemplate, spymessageTemplate);
|
||||
ConsolePlayer.getConsole().sendMessage(spymsg, worldNameTemplate, plotidTemplate, spysenderTemplate,
|
||||
spymessageTemplate
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -397,8 +397,8 @@
|
||||
"list.plot_list_header_paged": "<gray>(Page </gray><gold><cur></gold><gray>/</gray><gold><max></gold><gray>) </gray><gold>List of <amount> plots</gold>",
|
||||
"list.plot_list_header": "<prefix><gold>List of <word> plots.</gold>",
|
||||
"list.page_turn": "<gold><click:run_command:<command1>>Back</gold><dark_gray> | </dark_gray><gold><click:run_command:<command2>>Next</click></gold><gray><clickable></gray>",
|
||||
"chat.plot_chat_spy_format": "<gray>[<gold>Plot Spy</gold>] [<gold><plot_id></gold>] <gold><sender></gold>: <gold><msg></gold></gray>",
|
||||
"chat.plot_chat_format": "<gray>[<gold>Plot Chat</gold>] [<gold><plot_id></gold>] <gold><sender></gold>: <gold><msg></gold></gray>",
|
||||
"chat.plot_chat_spy_format": "<gray>[<gold>Plot Spy</gold>] [<gold><world>;<plot_id></gold>] <gold><sender></gold>: <gold><msg></gold></gray>",
|
||||
"chat.plot_chat_format": "<gray>[<gold>Plot Chat</gold>] [<gold><world>;<plot_id></gold>] <gold><sender></gold>: <gold><msg></gold></gray>",
|
||||
"chat.plot_chat_forced": "<prefix><gray>This world forces everyone to use plot chat.</gray>",
|
||||
"deny.denied_added": "<prefix><dark_aqua>You successfully denied the player from this plot.</dark_aqua>",
|
||||
"deny.no_enter": "<prefix><red>You are denied from the plot <red><gold><plot></gold><red> and therefore not allowed to enter.</red>",
|
||||
|
Loading…
Reference in New Issue
Block a user