Config option on silencing ban messages (#1480)

Enabled by default as per previous behavior.
This commit is contained in:
drbot7 2021-07-21 12:12:24 -05:00 committed by GitHub
parent 16036bdc19
commit 6382a9fee4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -206,6 +206,7 @@ public class GriefPrevention extends JavaPlugin
public int config_ipLimit; //how many players can share an IP address
public boolean config_trollFilterEnabled; //whether to auto-mute new players who use banned words right after joining
public boolean config_silenceBans; //whether to remove quit messages on banned players
public HashMap<String, Integer> config_seaLevelOverride; //override for sea level, because bukkit doesn't report the right value for all situations
@ -619,6 +620,7 @@ public class GriefPrevention extends JavaPlugin
this.config_smartBan = config.getBoolean("GriefPrevention.SmartBan", true);
this.config_trollFilterEnabled = config.getBoolean("GriefPrevention.Mute New Players Using Banned Words", true);
this.config_ipLimit = config.getInt("GriefPrevention.MaxPlayersPerIpAddress", 3);
this.config_silenceBans = config.getBoolean("GriefPrevention.SilenceBans", true);
this.config_endermenMoveBlocks = config.getBoolean("GriefPrevention.EndermenMoveBlocks", false);
this.config_silverfishBreakBlocks = config.getBoolean("GriefPrevention.SilverfishBreakBlocks", false);
@ -871,6 +873,7 @@ public class GriefPrevention extends JavaPlugin
outConfig.set("GriefPrevention.SmartBan", this.config_smartBan);
outConfig.set("GriefPrevention.Mute New Players Using Banned Words", this.config_trollFilterEnabled);
outConfig.set("GriefPrevention.MaxPlayersPerIpAddress", this.config_ipLimit);
outConfig.set("GriefPrevention.SilenceBans", this.config_silenceBans);
outConfig.set("GriefPrevention.Siege.Worlds", siegeEnabledWorldNames);
outConfig.set("GriefPrevention.Siege.BreakableBlocks", breakableBlocksList);

View File

@ -952,7 +952,7 @@ class PlayerEventHandler implements Listener
}
//silence notifications when the player is banned
if (isBanned)
if (isBanned && instance.config_silenceBans)
{
event.setQuitMessage(null);
}