Handle null players in shim method of GlobalRegionManager.

This commit is contained in:
sk89q 2014-08-14 15:17:00 -07:00
parent cd62af698b
commit bf8ef39871

View File

@ -214,7 +214,9 @@ public boolean allows(StateFlag flag, Location location) {
*/
@Deprecated
public boolean allows(StateFlag flag, Location location, @Nullable LocalPlayer player) {
if (player instanceof BukkitPlayer) {
if (player == null) {
return createQuery().testState(location, null, flag);
} else if (player instanceof BukkitPlayer) {
Player p = ((BukkitPlayer) player).getPlayer();
return createQuery().testState(location, p, flag);
} else {