Remove unnecessary check for logging signs

Since we're also checking if location is the same, this really doesn't make much sense to store in the first place, unless of course we do some more string manipulation to store just the message and not the location.
This commit is contained in:
RoboMWM 2016-09-15 17:10:18 -07:00 committed by GitHub
parent 9ec0837038
commit 70ece72332

View File

@ -129,13 +129,15 @@ public class BlockEventHandler implements Listener
return; return;
} }
//if not empty and wasn't the same as the last sign, log it and remember it for later
PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId()); PlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId());
if(notEmpty && (playerData.lastSignMessage == null || !playerData.lastSignMessage.equals(signMessage))) //if not empty and wasn't the same as the last sign, log it and remember it for later
//This has been temporarily removed since `signMessage` includes location, not just the message. Waste of memory IMO
//if(notEmpty && (playerData.lastSignMessage == null || !playerData.lastSignMessage.equals(signMessage)))
if (notEmpty)
{ {
GriefPrevention.AddLogEntry(player.getName() + lines.toString().replace("\n ", ";"), null); GriefPrevention.AddLogEntry(player.getName() + lines.toString().replace("\n ", ";"), null);
PlayerEventHandler.makeSocialLogEntry(player.getName(), signMessage); PlayerEventHandler.makeSocialLogEntry(player.getName(), signMessage);
playerData.lastSignMessage = signMessage; //playerData.lastSignMessage = signMessage;
if(!player.hasPermission("griefprevention.eavesdropsigns")) if(!player.hasPermission("griefprevention.eavesdropsigns"))
{ {