Bug Fixes: Mod Access Trust and Subdivision Stick

Mod Access Trust config setting now also protects from left clicks.
Right-clicking in a subdivision with a stick does not produce an error.
This commit is contained in:
ryanhamshire 2014-10-22 19:23:07 -07:00
parent 3d116d203e
commit d31990d257

View File

@ -1059,7 +1059,7 @@ class PlayerEventHandler implements Listener
//don't care about left-clicking on most blocks, this is probably a break action //don't care about left-clicking on most blocks, this is probably a break action
if(action == Action.LEFT_CLICK_BLOCK) if(action == Action.LEFT_CLICK_BLOCK)
{ {
if(!this.onLeftClickWatchList(clickedBlockType)) return; if(!this.onLeftClickWatchList(clickedBlockType) && !GriefPrevention.instance.config_mods_accessTrustIds.Contains(new MaterialInfo(clickedBlock.getTypeId(), clickedBlock.getData(), null))) return;
} }
//FEATURE: shovel and stick can be used from a distance away //FEATURE: shovel and stick can be used from a distance away
@ -1301,7 +1301,11 @@ class PlayerEventHandler implements Listener
//if deleteclaims permission, tell about the player's offline time //if deleteclaims permission, tell about the player's offline time
if(!claim.isAdminClaim() && player.hasPermission("griefprevention.deleteclaims")) if(!claim.isAdminClaim() && player.hasPermission("griefprevention.deleteclaims"))
{ {
PlayerData otherPlayerData = this.dataStore.getPlayerData(claim.ownerID); if(claim.parent != null)
{
claim = claim.parent;
}
PlayerData otherPlayerData = this.dataStore.getPlayerData(claim.ownerID);
Date lastLogin = otherPlayerData.lastLogin; Date lastLogin = otherPlayerData.lastLogin;
Date now = new Date(); Date now = new Date();
long daysElapsed = (now.getTime() - lastLogin.getTime()) / (1000 * 60 * 60 * 24); long daysElapsed = (now.getTime() - lastLogin.getTime()) / (1000 * 60 * 60 * 24);