Log plot chat to console

- Fix plot music removal template
- Fix debug args
This commit is contained in:
NotMyFault 2021-05-17 10:35:09 +02:00
parent 73936bb10d
commit e97bc25fb8
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
4 changed files with 15 additions and 5 deletions

View File

@ -40,6 +40,7 @@ import com.plotsquared.core.listener.PlayerBlockEventType;
import com.plotsquared.core.listener.PlotListener;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.permissions.Permission;
import com.plotsquared.core.player.ConsolePlayer;
import com.plotsquared.core.player.MetaDataAccess;
import com.plotsquared.core.player.PlayerMetaDataKeys;
import com.plotsquared.core.player.PlotPlayer;
@ -725,8 +726,13 @@ public class PlayerEventListener extends PlotListener implements Listener {
player.sendMessage(spymsg, plotidTemplate, spysenderTemplate, spymessageTemplate);
}
}
// TODO: Re-implement
// PlotSquared.debug(full);
if (Settings.Chat.LOG_PLOTCHAT_TO_CONSOLE) {
Caption spymsg = TranslatableCaption.of("chat.plot_chat_spy_format");
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);
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)

View File

@ -79,7 +79,7 @@ public class Debug extends SubCommand {
if (args.length == 0) {
player.sendMessage(
TranslatableCaption.of("commandconfig.command_syntax"),
Template.of("value", "/plot debug <loadedchunks | debug-players | entitytypes | msg>")
Template.of("value", "/plot debug <loadedchunks | player | debug-players | entitytypes | msg>")
);
}
if (args.length > 0) {

View File

@ -104,8 +104,9 @@ public class Music extends SubCommand {
return true;
}
plot.removeFlag(event.getFlag());
getPlayer().sendMessage(TranslatableCaption.of("flag.flag_removed"), Template.of("flag",
String.valueOf(event.getFlag())
getPlayer().sendMessage(TranslatableCaption.of("flag.flag_removed"),
Template.of("flag", String.valueOf(event.getFlag())),
Template.of("value", String.valueOf(event.getFlag().getValue())
));
} else if (item.getName().toLowerCase(Locale.ENGLISH).contains("disc")) {
PlotFlag<?, ?> plotFlag = plot.getFlagContainer().getFlag(MusicFlag.class)

View File

@ -509,6 +509,9 @@ public class Settings extends Config {
@Comment("Should the chat be interactive?")
public static boolean INTERACTIVE = true;
@Comment("Should the plot chat be logged to console?")
public static boolean LOG_PLOTCHAT_TO_CONSOLE = true;
}