mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-12-24 01:58:34 +01:00
v0.88.3 - Added new commands: config reload, force end, enabled true|false
This commit is contained in:
parent
4145c4f5d7
commit
0ccbc22fca
BIN
MobArena.jar
BIN
MobArena.jar
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
name: MobArena
|
||||
main: com.garbagemule.MobArena.MobArena
|
||||
version: 0.88.2
|
||||
version: 0.88.3
|
||||
commands:
|
||||
ma:
|
||||
description: Base command for MobArena
|
||||
|
@ -33,6 +33,7 @@ public class ArenaManager
|
||||
protected static Location spectatorLoc = null;
|
||||
protected static boolean isRunning = false;
|
||||
protected static boolean isSetup = false;
|
||||
protected static boolean isEnabled = true;
|
||||
protected static boolean isProtected = true;
|
||||
|
||||
// Location variables for the arena region.
|
||||
@ -176,6 +177,11 @@ public class ArenaManager
|
||||
*/
|
||||
public static void playerJoin(Player p)
|
||||
{
|
||||
if (!isEnabled)
|
||||
{
|
||||
tellPlayer(p, "MobArena is not enabled.");
|
||||
return;
|
||||
}
|
||||
if (!isSetup)
|
||||
{
|
||||
tellPlayer(p, "MobArena has not been set up yet!");
|
||||
|
@ -103,6 +103,52 @@ public class MACommands implements CommandExecutor
|
||||
String cmd = args[0].toLowerCase();
|
||||
String arg = args[1].toLowerCase();
|
||||
|
||||
// ma enabled [true|false]
|
||||
if (cmd.equals("enabled"))
|
||||
{
|
||||
if (!arg.equals("true") && !arg.equals("false"))
|
||||
{
|
||||
ArenaManager.tellPlayer(p, "/ma enabled [true|false]");
|
||||
return true;
|
||||
}
|
||||
|
||||
// Set the boolean
|
||||
ArenaManager.isEnabled = Boolean.valueOf(arg);
|
||||
ArenaManager.tellPlayer(p, "Enabled: " + arg);
|
||||
return true;
|
||||
}
|
||||
|
||||
// ma force end
|
||||
if (cmd.equals("force"))
|
||||
{
|
||||
if (!arg.equals("end"))
|
||||
{
|
||||
ArenaManager.tellPlayer(p, "/ma force end");
|
||||
return true;
|
||||
}
|
||||
|
||||
// End the arena.
|
||||
for (Player player : ArenaManager.playerSet)
|
||||
ArenaManager.playerLeave(player);
|
||||
ArenaManager.tellPlayer(p, "Forced arena end.");
|
||||
return true;
|
||||
}
|
||||
|
||||
// ma config reload
|
||||
if (cmd.equals("config"))
|
||||
{
|
||||
if (!arg.equals("reload"))
|
||||
{
|
||||
ArenaManager.tellPlayer(p, "/ma config reload");
|
||||
return true;
|
||||
}
|
||||
|
||||
// End the arena.
|
||||
ArenaManager.init(ArenaManager.plugin);
|
||||
ArenaManager.tellPlayer(p, "Config-file was reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
// ma setwarp [arena|lobby|spectator]
|
||||
if (cmd.equals("setwarp"))
|
||||
{
|
||||
|
@ -72,7 +72,12 @@ public class MAUtils
|
||||
ItemStack stack, current;
|
||||
int id, amount;
|
||||
|
||||
PlayerInventory inv = clearInventory(p);
|
||||
PlayerInventory inv;
|
||||
|
||||
if (reward)
|
||||
inv = p.getInventory();
|
||||
else
|
||||
inv = clearInventory(p);
|
||||
|
||||
for (String s : strings)
|
||||
{
|
||||
|
@ -20,8 +20,9 @@ public class MobArena extends JavaPlugin
|
||||
/* Array of commands used to determine if a command belongs to MobArena
|
||||
* or Mean Admins. */
|
||||
public final String[] COMMANDS = {"join", "j", "leave", "l", "list", "who", "spectate", "spec",
|
||||
"setwarp", "addspawn", "delspawn", "setregion", "expandregion",
|
||||
"protect", "undo", "dooooo", "reset", "ready", "notready"};
|
||||
"ready", "notready", "enabled", "force", "config", "setwarp",
|
||||
"addspawn", "delspawn", "setregion", "expandregion", "protect",
|
||||
"undo", "dooooo", "reset"};
|
||||
|
||||
public MobArena()
|
||||
{
|
||||
@ -74,9 +75,7 @@ public class MobArena extends JavaPlugin
|
||||
public void onDisable()
|
||||
{
|
||||
for (Player p : ArenaManager.playerSet)
|
||||
{
|
||||
ArenaManager.playerLeave(p);
|
||||
}
|
||||
|
||||
System.out.println("WAIT! WHAT ARE YOU DOING?!");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user