Let's try something else, to finish it up
This commit is contained in:
parent
f658a6de74
commit
90a5f53e21
Binary file not shown.
@ -176,7 +176,7 @@ public interface Faction extends EconomyParticipator {
|
|||||||
boolean noMonstersInTerritory();
|
boolean noMonstersInTerritory();
|
||||||
|
|
||||||
boolean isNormal();
|
boolean isNormal();
|
||||||
|
boolean isSystemFaction();
|
||||||
@Deprecated
|
@Deprecated
|
||||||
boolean isNone();
|
boolean isNone();
|
||||||
|
|
||||||
|
@ -501,7 +501,9 @@ public class FactionsBlockListener implements Listener {
|
|||||||
}
|
}
|
||||||
me.msg(TL.GENERIC_NOPERMISSION, action);
|
me.msg(TL.GENERIC_NOPERMISSION, action);
|
||||||
return false;
|
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) {
|
private static boolean CheckActionState(Faction target, FLocation location, FPlayer me, PermissableAction action, boolean pain) {
|
||||||
|
@ -169,16 +169,15 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
Relation rel = myFaction.getRelationTo(otherFaction);
|
Relation rel = myFaction.getRelationTo(otherFaction);
|
||||||
|
|
||||||
// no door/chest/whatever protection in wilderness, war zones, or safe zones
|
// 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())
|
if (SavageFactions.plugin.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded())
|
||||||
return true;
|
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;
|
PermissableAction action = null;
|
||||||
if (SavageFactions.plugin.mc113) {
|
if (SavageFactions.plugin.mc113) {
|
||||||
switch (block.getType()) {
|
switch (block.getType()) {
|
||||||
@ -320,8 +319,6 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
|
|
||||||
// Move up access check to check for exceptions
|
// Move up access check to check for exceptions
|
||||||
if (!otherFaction.getId().equals(myFaction.getId())) { // If the faction target is not my own
|
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
|
// Get faction pain build access relation to me
|
||||||
boolean pain = !justCheck && otherFaction.getAccess(me, PermissableAction.PAIN_BUILD) == Access.ALLOW;
|
boolean pain = !justCheck && otherFaction.getAccess(me, PermissableAction.PAIN_BUILD) == Access.ALLOW;
|
||||||
return CheckPlayerAccess(player, me, loc, otherFaction, otherFaction.getAccess(me, action), action, pain);
|
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();
|
Block block = event.getClickedBlock();
|
||||||
Player player = event.getPlayer();
|
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
|
// Check if the material is bypassing protection
|
||||||
if (Conf.territoryBypasssProtectedMaterials.contains(block.getType())) return;
|
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 == null) return; // clicked in air, apparently
|
||||||
|
|
||||||
if (!block.getType().isInteractable()) return;
|
if (!block.getType().isInteractable()) return;
|
||||||
|
player.sendMessage("Checking if you can use that block");
|
||||||
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");
|
||||||
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);
|
||||||
@ -1042,6 +1037,7 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
me.msg(TL.GENERIC_NOPERMISSION, action);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -754,6 +754,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
|
|||||||
public boolean isWarZone() {
|
public boolean isWarZone() {
|
||||||
return this.getId().equals("-2");
|
return this.getId().equals("-2");
|
||||||
}
|
}
|
||||||
|
public boolean isSystemFaction() { return this.isSafeZone() || this.isWarZone() || this.isWilderness(); }
|
||||||
|
|
||||||
public boolean isPlayerFreeType() {
|
public boolean isPlayerFreeType() {
|
||||||
return this.isSafeZone() || this.isWarZone();
|
return this.isSafeZone() || this.isWarZone();
|
||||||
|
Loading…
Reference in New Issue
Block a user