Let's try something else, to finish it up

This commit is contained in:
SvenjaReißaus 2019-03-18 23:17:29 -05:00
parent f658a6de74
commit 90a5f53e21
No known key found for this signature in database
GPG Key ID: E5494A03FA36D54B
5 changed files with 13 additions and 14 deletions

View File

@ -176,7 +176,7 @@ public interface Faction extends EconomyParticipator {
boolean noMonstersInTerritory();
boolean isNormal();
boolean isSystemFaction();
@Deprecated
boolean isNone();

View File

@ -501,7 +501,9 @@ public class FactionsBlockListener implements Listener {
}
me.msg(TL.GENERIC_NOPERMISSION, action);
return false;
} else return access == Access.ALLOW;
} else if (access == Access.ALLOW) return true;
me.msg(TL.GENERIC_NOPERMISSION, action);
return false;
}
private static boolean CheckActionState(Faction target, FLocation location, FPlayer me, PermissableAction action, boolean pain) {

View File

@ -169,16 +169,15 @@ public class FactionsPlayerListener implements Listener {
Relation rel = myFaction.getRelationTo(otherFaction);
// no door/chest/whatever protection in wilderness, war zones, or safe zones
if (!otherFaction.isNormal()) return true;
if (otherFaction.isSystemFaction()) return true;
if (myFaction.isWilderness()) {
me.msg(TL.GENERIC_NOPERMISSION, TL.GENERIC_DOTHAT);
return false;
}
if (SavageFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded())
return true;
if (!rel.isMember() || !otherFaction.playerHasOwnershipRights(me, loc) && player.getItemInHand().getType() != null) {
if (player.getItemInHand().getType().toString().toUpperCase().contains("DOOR"))
return false;
}
PermissableAction action = null;
if (SavageFactions.plugin.mc113) {
switch (block.getType()) {
@ -320,8 +319,6 @@ public class FactionsPlayerListener implements Listener {
// Move up access check to check for exceptions
if (!otherFaction.getId().equals(myFaction.getId())) { // If the faction target is not my own
if (SavageFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded())
return true;
// Get faction pain build access relation to me
boolean pain = !justCheck && otherFaction.getAccess(me, PermissableAction.PAIN_BUILD) == Access.ALLOW;
return CheckPlayerAccess(player, me, loc, otherFaction, otherFaction.getAccess(me, action), action, pain);
@ -872,9 +869,6 @@ public class FactionsPlayerListener implements Listener {
Block block = event.getClickedBlock();
Player player = event.getPlayer();
FLocation loc = new FLocation(block.getLocation());
Faction faction = MemoryBoard.getInstance().getFactionAt(loc);
FPlayer fplayer = MemoryFPlayers.getInstance().getByPlayer(player);
// Check if the material is bypassing protection
if (Conf.territoryBypasssProtectedMaterials.contains(block.getType())) return;
@ -882,12 +876,13 @@ public class FactionsPlayerListener implements Listener {
if (block == null) return; // clicked in air, apparently
if (!block.getType().isInteractable()) return;
player.sendMessage("Checking if you can use that block");
if (!canPlayerUseBlock(player, block, false)) {
event.setCancelled(true);
event.setUseInteractedBlock(Event.Result.DENY);
return;
}
player.sendMessage("Checking if you can use that item");
if (!playerCanUseItemHere(player, block.getLocation(), event.getMaterial(), false)) {
event.setCancelled(true);
event.setUseInteractedBlock(Event.Result.DENY);
@ -1042,6 +1037,7 @@ public class FactionsPlayerListener implements Listener {
return false;
}
}
me.msg(TL.GENERIC_NOPERMISSION, action);
return false;
}
}

View File

@ -754,6 +754,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
public boolean isWarZone() {
return this.getId().equals("-2");
}
public boolean isSystemFaction() { return this.isSafeZone() || this.isWarZone() || this.isWilderness(); }
public boolean isPlayerFreeType() {
return this.isSafeZone() || this.isWarZone();