mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-12-03 23:53:27 +01:00
Move f perm checks up
This commit is contained in:
parent
2291554e1e
commit
4531da8190
@ -251,6 +251,7 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!canPlayerUseBlock(player, block, false)) {
|
if (!canPlayerUseBlock(player, block, false)) {
|
||||||
|
System.out.println("Cancelling " + player.getName() + " " + block.getType().name());
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
if (Conf.handleExploitInteractionSpam) {
|
if (Conf.handleExploitInteractionSpam) {
|
||||||
String name = player.getName();
|
String name = player.getName();
|
||||||
@ -318,6 +319,11 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Access access = otherFaction.getAccess(me, PermissableAction.ITEM);
|
||||||
|
if (access != null && access != Access.UNDEFINED) {
|
||||||
|
return access == Access.ALLOW;
|
||||||
|
}
|
||||||
|
|
||||||
if (otherFaction.hasPlayersOnline()) {
|
if (otherFaction.hasPlayersOnline()) {
|
||||||
if (!Conf.territoryDenyUseageMaterials.contains(material)) {
|
if (!Conf.territoryDenyUseageMaterials.contains(material)) {
|
||||||
return true; // Item isn't one we're preventing for online factions.
|
return true; // Item isn't one we're preventing for online factions.
|
||||||
@ -363,13 +369,6 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
Faction myFaction = me.getFaction();
|
Faction myFaction = me.getFaction();
|
||||||
Relation rel = myFaction.getRelationTo(otherFaction);
|
Relation rel = myFaction.getRelationTo(otherFaction);
|
||||||
|
|
||||||
|
|
||||||
Access access = otherFaction.getAccess(me, PermissableAction.ITEM);
|
|
||||||
if (access != null && access != Access.UNDEFINED) {
|
|
||||||
// TODO: Update this once new access values are added other than just allow / deny.
|
|
||||||
return access == Access.ALLOW;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cancel if we are not in our own territory
|
// Cancel if we are not in our own territory
|
||||||
if (rel.confDenyUseage()) {
|
if (rel.confDenyUseage()) {
|
||||||
if (!justCheck) {
|
if (!justCheck) {
|
||||||
@ -414,23 +413,6 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dupe fix.
|
|
||||||
Faction myFaction = me.getFaction();
|
|
||||||
Relation rel = myFaction.getRelationTo(otherFaction);
|
|
||||||
if (!rel.isMember() || !otherFaction.playerHasOwnershipRights(me, loc) && player.getItemInHand() != null) {
|
|
||||||
switch (player.getItemInHand().getType()) {
|
|
||||||
case CHEST:
|
|
||||||
case SIGN_POST:
|
|
||||||
case TRAPPED_CHEST:
|
|
||||||
case SIGN:
|
|
||||||
case WOOD_DOOR:
|
|
||||||
case IRON_DOOR:
|
|
||||||
return false;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PermissableAction action = null;
|
PermissableAction action = null;
|
||||||
|
|
||||||
switch (block.getType()) {
|
switch (block.getType()) {
|
||||||
@ -468,6 +450,23 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Dupe fix.
|
||||||
|
Faction myFaction = me.getFaction();
|
||||||
|
Relation rel = myFaction.getRelationTo(otherFaction);
|
||||||
|
if (!rel.isMember() || !otherFaction.playerHasOwnershipRights(me, loc) && player.getItemInHand() != null) {
|
||||||
|
switch (player.getItemInHand().getType()) {
|
||||||
|
case CHEST:
|
||||||
|
case SIGN_POST:
|
||||||
|
case TRAPPED_CHEST:
|
||||||
|
case SIGN:
|
||||||
|
case WOOD_DOOR:
|
||||||
|
case IRON_DOOR:
|
||||||
|
return false;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// We only care about some material types.
|
// We only care about some material types.
|
||||||
if (otherFaction.hasPlayersOnline()) {
|
if (otherFaction.hasPlayersOnline()) {
|
||||||
if (!Conf.territoryProtectedMaterials.contains(material)) {
|
if (!Conf.territoryProtectedMaterials.contains(material)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user