mirror of
https://github.com/garbagemule/MobArena.git
synced 2025-02-05 07:01:21 +01:00
fix joining from other arenas (hopefully), readd missing block destroy check
This commit is contained in:
parent
806583f41a
commit
10147532a5
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user