mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-12-25 02:27:35 +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
|
name: MobArena
|
||||||
main: com.garbagemule.MobArena.MobArena
|
main: com.garbagemule.MobArena.MobArena
|
||||||
version: 0.88.2
|
version: 0.88.3
|
||||||
commands:
|
commands:
|
||||||
ma:
|
ma:
|
||||||
description: Base command for MobArena
|
description: Base command for MobArena
|
||||||
|
@ -33,6 +33,7 @@ public class ArenaManager
|
|||||||
protected static Location spectatorLoc = null;
|
protected static Location spectatorLoc = null;
|
||||||
protected static boolean isRunning = false;
|
protected static boolean isRunning = false;
|
||||||
protected static boolean isSetup = false;
|
protected static boolean isSetup = false;
|
||||||
|
protected static boolean isEnabled = true;
|
||||||
protected static boolean isProtected = true;
|
protected static boolean isProtected = true;
|
||||||
|
|
||||||
// Location variables for the arena region.
|
// Location variables for the arena region.
|
||||||
@ -176,6 +177,11 @@ public class ArenaManager
|
|||||||
*/
|
*/
|
||||||
public static void playerJoin(Player p)
|
public static void playerJoin(Player p)
|
||||||
{
|
{
|
||||||
|
if (!isEnabled)
|
||||||
|
{
|
||||||
|
tellPlayer(p, "MobArena is not enabled.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!isSetup)
|
if (!isSetup)
|
||||||
{
|
{
|
||||||
tellPlayer(p, "MobArena has not been set up yet!");
|
tellPlayer(p, "MobArena has not been set up yet!");
|
||||||
|
@ -103,6 +103,52 @@ public class MACommands implements CommandExecutor
|
|||||||
String cmd = args[0].toLowerCase();
|
String cmd = args[0].toLowerCase();
|
||||||
String arg = args[1].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]
|
// ma setwarp [arena|lobby|spectator]
|
||||||
if (cmd.equals("setwarp"))
|
if (cmd.equals("setwarp"))
|
||||||
{
|
{
|
||||||
|
@ -72,7 +72,12 @@ public class MAUtils
|
|||||||
ItemStack stack, current;
|
ItemStack stack, current;
|
||||||
int id, amount;
|
int id, amount;
|
||||||
|
|
||||||
PlayerInventory inv = clearInventory(p);
|
PlayerInventory inv;
|
||||||
|
|
||||||
|
if (reward)
|
||||||
|
inv = p.getInventory();
|
||||||
|
else
|
||||||
|
inv = clearInventory(p);
|
||||||
|
|
||||||
for (String s : strings)
|
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
|
/* Array of commands used to determine if a command belongs to MobArena
|
||||||
* or Mean Admins. */
|
* or Mean Admins. */
|
||||||
public final String[] COMMANDS = {"join", "j", "leave", "l", "list", "who", "spectate", "spec",
|
public final String[] COMMANDS = {"join", "j", "leave", "l", "list", "who", "spectate", "spec",
|
||||||
"setwarp", "addspawn", "delspawn", "setregion", "expandregion",
|
"ready", "notready", "enabled", "force", "config", "setwarp",
|
||||||
"protect", "undo", "dooooo", "reset", "ready", "notready"};
|
"addspawn", "delspawn", "setregion", "expandregion", "protect",
|
||||||
|
"undo", "dooooo", "reset"};
|
||||||
|
|
||||||
public MobArena()
|
public MobArena()
|
||||||
{
|
{
|
||||||
@ -74,9 +75,7 @@ public class MobArena extends JavaPlugin
|
|||||||
public void onDisable()
|
public void onDisable()
|
||||||
{
|
{
|
||||||
for (Player p : ArenaManager.playerSet)
|
for (Player p : ArenaManager.playerSet)
|
||||||
{
|
|
||||||
ArenaManager.playerLeave(p);
|
ArenaManager.playerLeave(p);
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("WAIT! WHAT ARE YOU DOING?!");
|
System.out.println("WAIT! WHAT ARE YOU DOING?!");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user