mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-11-28 12:55:34 +01:00
Added hidden "log-cancelled-chat" option (default: true) (#154)
This commit is contained in:
parent
b1c2795289
commit
21eefff53f
@ -43,6 +43,7 @@ public class Config extends Language {
|
||||
public String LANGUAGE;
|
||||
public boolean HOVER_EVENTS;
|
||||
public boolean DATABASE_LOCK;
|
||||
public boolean LOG_CANCELLED_CHAT;
|
||||
public boolean HOPPER_FILTER_META;
|
||||
public boolean MYSQL;
|
||||
public boolean CHECK_UPDATES;
|
||||
@ -180,6 +181,7 @@ public class Config extends Language {
|
||||
private void readValues() {
|
||||
this.HOVER_EVENTS = this.getBoolean("hover-events", true);
|
||||
this.DATABASE_LOCK = this.getBoolean("database-lock", true);
|
||||
this.LOG_CANCELLED_CHAT = this.getBoolean("log-cancelled-chat", true);
|
||||
this.HOPPER_FILTER_META = this.getBoolean("hopper-filter-meta", false);
|
||||
this.DONATION_KEY = this.getString("donation-key");
|
||||
this.MYSQL = this.getBoolean("use-mysql");
|
||||
|
@ -19,6 +19,10 @@ public final class PlayerChatListener extends Queue implements Listener {
|
||||
}
|
||||
|
||||
Player player = event.getPlayer();
|
||||
if (event.isCancelled() && !Config.getConfig(player.getWorld()).LOG_CANCELLED_CHAT) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!message.startsWith("/") && Config.getConfig(player.getWorld()).PLAYER_MESSAGES) {
|
||||
long timestamp = System.currentTimeMillis() / 1000L;
|
||||
Queue.queuePlayerChat(player, message, timestamp);
|
||||
|
@ -20,6 +20,10 @@ public final class PaperChatListener extends Queue implements Listener {
|
||||
}
|
||||
|
||||
Player player = event.getPlayer();
|
||||
if (event.isCancelled() && !Config.getConfig(player.getWorld()).LOG_CANCELLED_CHAT) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!message.startsWith("/") && Config.getConfig(player.getWorld()).PLAYER_MESSAGES) {
|
||||
long timestamp = System.currentTimeMillis() / 1000L;
|
||||
Queue.queuePlayerChat(player, message, timestamp);
|
||||
|
Loading…
Reference in New Issue
Block a user