From c757ecd01d2e1e66e66c0f813334c240eef9d47d Mon Sep 17 00:00:00 2001 From: ryanhamshire Date: Sat, 13 Dec 2014 11:26:31 -0800 Subject: [PATCH] Added config options for eavesdropping. --- .../GriefPrevention/BlockEventHandler.java | 5 ++++- .../GriefPrevention/GriefPrevention.java | 12 ++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/me/ryanhamshire/GriefPrevention/BlockEventHandler.java b/src/me/ryanhamshire/GriefPrevention/BlockEventHandler.java index a82c614..107cb1b 100644 --- a/src/me/ryanhamshire/GriefPrevention/BlockEventHandler.java +++ b/src/me/ryanhamshire/GriefPrevention/BlockEventHandler.java @@ -101,7 +101,10 @@ public class BlockEventHandler implements Listener @EventHandler(ignoreCancelled = true) public void onSignChanged(SignChangeEvent event) { - Player player = event.getPlayer(); + //send sign content to online administrators + if(!GriefPrevention.instance.config_signNotifications) return; + + Player player = event.getPlayer(); if(player == null) return; StringBuilder lines = new StringBuilder(); diff --git a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java index 4ff05b1..592880f 100644 --- a/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java +++ b/src/me/ryanhamshire/GriefPrevention/GriefPrevention.java @@ -137,7 +137,8 @@ public class GriefPrevention extends JavaPlugin public boolean config_fireSpreads; //whether fire spreads outside of claims public boolean config_fireDestroys; //whether fire destroys blocks outside of claims - public boolean config_eavesdrop; //whether whispered messages will be visible to administrators + public boolean config_whisperNotifications; //whether whispered messages will broadcast to administrators in game + public boolean config_signNotifications; //whether sign content will broadcast to administrators in game public ArrayList config_eavesdrop_whisperCommands; //list of whisper commands to eavesdrop on public boolean config_smartBan; //whether to ban accounts which very likely owned by a banned player @@ -545,8 +546,9 @@ public class GriefPrevention extends JavaPlugin this.config_fireSpreads = config.getBoolean("GriefPrevention.FireSpreads", false); this.config_fireDestroys = config.getBoolean("GriefPrevention.FireDestroys", false); - this.config_eavesdrop = config.getBoolean("GriefPrevention.EavesdropEnabled", true); - String whisperCommandsToMonitor = config.getString("GriefPrevention.WhisperCommands", "/tell;/pm;/r;/w;/t;/msg"); + this.config_whisperNotifications = config.getBoolean("GriefPrevention.AdminsGetWhispers", true); + this.config_signNotifications = config.getBoolean("GriefPrevention.AdminsGetSignNotifications", true); + String whisperCommandsToMonitor = config.getString("GriefPrevention.WhisperCommands", "/tell;/pm;/r;/w;/whisper;/t;/msg"); this.config_smartBan = config.getBoolean("GriefPrevention.SmartBan", true); @@ -758,7 +760,9 @@ public class GriefPrevention extends JavaPlugin outConfig.set("GriefPrevention.FireSpreads", this.config_fireSpreads); outConfig.set("GriefPrevention.FireDestroys", this.config_fireDestroys); - outConfig.set("GriefPrevention.EavesdropEnabled", this.config_eavesdrop); + outConfig.set("GriefPrevention.AdminsGetWhispers", this.config_whisperNotifications); + outConfig.set("GriefPrevention.AdminsGetSignNotifications", this.config_signNotifications); + outConfig.set("GriefPrevention.WhisperCommands", whisperCommandsToMonitor); outConfig.set("GriefPrevention.SmartBan", this.config_smartBan);