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

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

View File

@ -34,6 +34,12 @@ public class JoinCommand implements Command
return false; 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 // Per-arena sanity checks
if (!arena.canJoin(p)) { if (!arena.canJoin(p)) {
return false; return false;

View File

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