Minor improvements

This commit is contained in:
SvenjaReißaus 2019-03-19 00:09:49 -05:00
parent 92e9ceb5de
commit 63d3a0af76
No known key found for this signature in database
GPG Key ID: E5494A03FA36D54B
3 changed files with 7 additions and 8 deletions

@ -95,7 +95,6 @@ public class FactionsBlockListener implements Listener {
} }
// Something failed prevent build // Something failed prevent build
SavageFactions.plugin.getLogger().info("Unable to determine fallback action for build permissions, defaulting to false");
return false; return false;
} }
@ -499,10 +498,10 @@ public class FactionsBlockListener implements Listener {
player.damage(Conf.actionDeniedPainAmount); player.damage(Conf.actionDeniedPainAmount);
me.msg("<b>It is painful to try to " + action + " in the territory of " + Board.getInstance().getFactionAt(loc).getTag(myFaction)); me.msg("<b>It is painful to try to " + action + " in the territory of " + Board.getInstance().getFactionAt(loc).getTag(myFaction));
} }
me.msg(TL.GENERIC_NOPERMISSION, action); me.msg("You cannot " + action + " in the territory of " + myFaction.getTag(me.getFaction()));
return false; return false;
} else if (access == Access.ALLOW) return true; } else if (access == Access.ALLOW) return true;
me.msg(TL.GENERIC_NOPERMISSION, action); me.msg("You cannot " + action + " in the territory of " + myFaction.getTag(me.getFaction()));
return false; return false;
} }

@ -751,15 +751,15 @@ public class FactionsPlayerListener implements Listener {
if (Conf.territoryBypasssProtectedMaterials.contains(block.getType())) return; if (Conf.territoryBypasssProtectedMaterials.contains(block.getType())) return;
if (block == null) return; // clicked in air, apparently if (block == null) return; // clicked in air, apparently
SavageFactions.plugin.log("Checking for material permission");
if (GetPermissionFromUsableBlock(event.getMaterial()) == null) return; if (GetPermissionFromUsableBlock(event.getMaterial()) == null) return;
player.sendMessage("Checking if you can use that block"); SavageFactions.plugin.log("Checking for use block permission");
if (!canPlayerUseBlock(player, block, false)) { if (!canPlayerUseBlock(player, block, false)) {
event.setCancelled(true); event.setCancelled(true);
event.setUseInteractedBlock(Event.Result.DENY); event.setUseInteractedBlock(Event.Result.DENY);
return; return;
} }
player.sendMessage("Checking if you can use that item"); SavageFactions.plugin.log("Checking if you can use that item");
if (!playerCanUseItemHere(player, block.getLocation(), event.getMaterial(), false)) { if (!playerCanUseItemHere(player, block.getLocation(), event.getMaterial(), false)) {
event.setCancelled(true); event.setCancelled(true);
event.setUseInteractedBlock(Event.Result.DENY); event.setUseInteractedBlock(Event.Result.DENY);
@ -910,11 +910,11 @@ public class FactionsPlayerListener implements Listener {
return false; return false;
} else if (!landOwned && access == Access.ALLOW) return true; } else if (!landOwned && access == Access.ALLOW) return true;
else { else {
me.msg(TL.GENERIC_NOPERMISSION, action); me.msg("You cannot " + action + " in the territory of " + myFaction.getTag(me.getFaction()));
return false; return false;
} }
} }
me.msg(TL.GENERIC_NOPERMISSION, action); me.msg("You cannot " + action + " in the territory of " + myFaction.getTag(me.getFaction()));
return false; return false;
} }
/// <summary> /// <summary>