Added back a FactionsBlockListener.playerCanBuildDestroyBlock() method which references Location instead of Block, mainly for backwards compatibility

This commit is contained in:
Brettflan 2012-05-16 11:52:47 -05:00
parent 58bec9d6dc
commit a0909ddb5c

View File

@ -57,6 +57,11 @@ public class FactionsBlockListener implements Listener
} }
public static boolean playerCanBuildDestroyBlock(Player player, Block block, String action, boolean justCheck) public static boolean playerCanBuildDestroyBlock(Player player, Block block, String action, boolean justCheck)
{
return playerCanBuildDestroyBlock(player, block.getLocation(), action, justCheck);
}
public static boolean playerCanBuildDestroyBlock(Player player, Location location, String action, boolean justCheck)
{ {
String name = player.getName(); String name = player.getName();
if (Conf.playersWhoBypassAllProtection.contains(name)) return true; if (Conf.playersWhoBypassAllProtection.contains(name)) return true;
@ -64,7 +69,6 @@ public class FactionsBlockListener implements Listener
FPlayer me = FPlayers.i.get(name); FPlayer me = FPlayers.i.get(name);
if (me.hasAdminMode()) return true; if (me.hasAdminMode()) return true;
Location location = block.getLocation();
FLocation loc = new FLocation(location); FLocation loc = new FLocation(location);
Faction factionHere = Board.getFactionAt(loc); Faction factionHere = Board.getFactionAt(loc);