@@ -169,16 +169,15 @@ public static boolean canPlayerUseBlock(Player player, Block block, boolean just
169
169
Relation rel = myFaction .getRelationTo (otherFaction );
170
170
171
171
// no door/chest/whatever protection in wilderness, war zones, or safe zones
172
- if (!otherFaction .isNormal ()) return true ;
172
+ if (otherFaction .isSystemFaction ()) return true ;
173
+ if (myFaction .isWilderness ()) {
174
+ me .msg (TL .GENERIC_NOPERMISSION , TL .GENERIC_DOTHAT );
175
+ return false ;
176
+ }
173
177
174
178
if (SavageFactions .plugin .getConfig ().getBoolean ("hcf.raidable" , false ) && otherFaction .getLandRounded () > otherFaction .getPowerRounded ())
175
179
return true ;
176
180
177
- if (!rel .isMember () || !otherFaction .playerHasOwnershipRights (me , loc ) && player .getItemInHand ().getType () != null ) {
178
- if (player .getItemInHand ().getType ().toString ().toUpperCase ().contains ("DOOR" ))
179
- return false ;
180
- }
181
-
182
181
PermissableAction action = null ;
183
182
if (SavageFactions .plugin .mc113 ) {
184
183
switch (block .getType ()) {
@@ -320,8 +319,6 @@ public static boolean canPlayerUseBlock(Player player, Block block, boolean just
320
319
321
320
// Move up access check to check for exceptions
322
321
if (!otherFaction .getId ().equals (myFaction .getId ())) { // If the faction target is not my own
323
- if (SavageFactions .plugin .getConfig ().getBoolean ("hcf.raidable" , false ) && otherFaction .getLandRounded () > otherFaction .getPowerRounded ())
324
- return true ;
325
322
// Get faction pain build access relation to me
326
323
boolean pain = !justCheck && otherFaction .getAccess (me , PermissableAction .PAIN_BUILD ) == Access .ALLOW ;
327
324
return CheckPlayerAccess (player , me , loc , otherFaction , otherFaction .getAccess (me , action ), action , pain );
@@ -872,22 +869,20 @@ public void onPlayerInteract(PlayerInteractEvent event) {
872
869
873
870
Block block = event .getClickedBlock ();
874
871
Player player = event .getPlayer ();
875
- FLocation loc = new FLocation (block .getLocation ());
876
- Faction faction = MemoryBoard .getInstance ().getFactionAt (loc );
877
- FPlayer fplayer = MemoryFPlayers .getInstance ().getByPlayer (player );
878
872
879
873
// Check if the material is bypassing protection
880
874
if (Conf .territoryBypasssProtectedMaterials .contains (block .getType ())) return ;
881
875
882
876
if (block == null ) return ; // clicked in air, apparently
883
877
884
878
if (!block .getType ().isInteractable ()) return ;
885
-
879
+ player . sendMessage ( "Checking if you can use that block" );
886
880
if (!canPlayerUseBlock (player , block , false )) {
887
881
event .setCancelled (true );
888
882
event .setUseInteractedBlock (Event .Result .DENY );
889
883
return ;
890
884
}
885
+ player .sendMessage ("Checking if you can use that item" );
891
886
if (!playerCanUseItemHere (player , block .getLocation (), event .getMaterial (), false )) {
892
887
event .setCancelled (true );
893
888
event .setUseInteractedBlock (Event .Result .DENY );
@@ -1042,6 +1037,7 @@ else if (landOwned && !myFaction.getOwnerListString(loc).contains(player.getName
1042
1037
return false ;
1043
1038
}
1044
1039
}
1040
+ me .msg (TL .GENERIC_NOPERMISSION , action );
1045
1041
return false ;
1046
1042
}
1047
1043
}
0 commit comments