fix joining from other arenas (hopefully), readd missing block destroy check

This commit is contained in:
Brian 2012-05-19 17:30:20 -04:00
parent 806583f41a
commit 10147532a5
3 changed files with 12 additions and 3 deletions

View File

@ -169,11 +169,14 @@ public class ArenaListener
return false;
// Below this, arena is running - ACStache
Block b = event.getBlock();
if (arena.removeBlock(b) || b.getType() == Material.TNT)
return true;
if (softRestore) {
if (arena.isProtected())
return false;
Block b = event.getBlock();
BlockState state = b.getState();
Repairable r = null;
@ -188,7 +191,7 @@ public class ArenaListener
arena.addRepairable(r);
if(!softRestoreDrops)
if (!softRestoreDrops)
b.setTypeId(0);
return true;
}

View File

@ -34,6 +34,12 @@ public class JoinCommand implements Command
return false;
}
// Deny joining from other arenas
if (am.getArenaWithPlayer(p) != null) {
Messenger.tellPlayer(p, Msg.JOIN_ALREADY_PLAYING);
return false;
}
// Per-arena sanity checks
if (!arena.canJoin(p)) {
return false;

View File

@ -149,7 +149,7 @@ public class ItemParser
}
private static ItemStack withDataAndAmount(String item, String data, String amount) {
Material m = getMaterial(item.toUpperCase());
Material m = getMaterial(item);
short d = getData(data, m);
int a = getAmount(amount);