@@ -317,18 +317,16 @@ public static boolean canPlayerUseBlock(Player player, Block block, boolean just
317
317
}
318
318
319
319
// Move up access check to check for exceptions
320
- Access access = otherFaction .getAccess (me , action );
321
320
if (!otherFaction .getId ().equals (myFaction .getId ())) { // If the faction target is not my own
322
321
if (SavageFactions .plugin .getConfig ().getBoolean ("hcf.raidable" , false ) && otherFaction .getLandRounded () > otherFaction .getPowerRounded ())
323
322
return true ;
324
323
// Get faction pain build access relation to me
325
324
boolean pain = !justCheck && otherFaction .getAccess (me , PermissableAction .PAIN_BUILD ) == Access .ALLOW ;
326
- return CheckPlayerAccess (player , me , loc , otherFaction , access , action , pain );
327
- } else if (otherFaction .getId ().equals (myFaction .getId ())) {
328
- boolean pain = !justCheck && myFaction .getAccess (me , PermissableAction .PAIN_BUILD ) == Access .ALLOW ;
329
- return CheckPlayerAccess (player , me , loc , myFaction , access , action , pain );
325
+ return CheckPlayerAccess (player , me , loc , otherFaction , otherFaction .getAccess (me , action ), action , pain );
326
+ } else if (otherFaction .getId ().equals (myFaction .getId ())) {;
327
+ return CheckPlayerAccess (player , me , loc , myFaction , myFaction .getAccess (me , action ), action , (!justCheck && myFaction .getAccess (me , PermissableAction .PAIN_BUILD ) == Access .ALLOW ));
330
328
}
331
- return CheckPlayerAccess (player , me , loc , myFaction , access , action , Conf .territoryPainBuild );
329
+ return CheckPlayerAccess (player , me , loc , myFaction , otherFaction . getAccess ( me , action ) , action , Conf .territoryPainBuild );
332
330
}
333
331
334
332
@@ -882,7 +880,6 @@ public void onPlayerInteract(PlayerInteractEvent event) {
882
880
883
881
if (playerCanUseItemHere (player , block .getLocation (), event .getMaterial (), false )) return ;
884
882
885
- SavageFactions .plugin .log ("Something has failed, canceling the event" );
886
883
event .setCancelled (true );
887
884
}
888
885
@@ -1020,7 +1017,7 @@ private static boolean CheckPlayerAccess(Player player, FPlayer me, FLocation lo
1020
1017
if (access != null && access != Access .UNDEFINED ) {
1021
1018
// TODO: Update this once new access values are added other than just allow / deny.
1022
1019
boolean landOwned = (myFaction .doesLocationHaveOwnersSet (loc ) && !myFaction .getOwnerList (loc ).isEmpty ());
1023
- if (landOwned && myFaction .getOwnerListString (loc ).contains (player .getName ()) || me .getRole () == Role .LEADER ) return true ;
1020
+ if (( landOwned && myFaction .getOwnerListString (loc ).contains (player .getName ())) || ( me .getRole () == Role .LEADER && me . getFactionId (). equals ( myFaction . getId ())) ) return true ;
1024
1021
else if (landOwned && !myFaction .getOwnerListString (loc ).contains (player .getName ())) {
1025
1022
me .msg ("<b>You can't do that in this territory, it is owned by: " + myFaction .getOwnerListString (loc ));
1026
1023
if (doPain ) {
0 commit comments