removeleaderboard command fixes, new Msg enum, plugin.yml

This commit is contained in:
Brian 2012-05-13 13:58:59 -04:00
parent 708ed2821d
commit d856f32103
3 changed files with 16 additions and 6 deletions

View File

@ -1,7 +1,7 @@
name: MobArena
author: garbagemule
main: com.garbagemule.MobArena.MobArena
version: 0.94.4.65
version: 0.94.4.66
softdepend: [Spout,MultiVerse,XcraftGate,Towny,Heroes,MagicSpells,Vault]
commands:
ma:

View File

@ -7,6 +7,7 @@ public enum Msg
ARENA_START("Let the slaughter begin!", "Arena started!", Material.REDSTONE_TORCH_ON),
ARENA_END("Arena finished.", "Arena finished.", Material.REDSTONE_TORCH_OFF),
ARENA_DOES_NOT_EXIST("That arena does not exist. Type /ma arenas for a list.", "Can't find arena."),
ARENA_LBOARD_NOT_FOUND("That arena does not have a leaderboard set up."),
JOIN_NOT_ENABLED("MobArena is not enabled.", "MobArena disabled.", Material.REDSTONE_TORCH_OFF),
JOIN_IN_OTHER_ARENA("You are already in an arena! Leave that one first.", "In another arena."),
JOIN_ARENA_NOT_ENABLED("This arena is not enabled.", "Arena disabled.", Material.REDSTONE_TORCH_OFF),

View File

@ -3,6 +3,7 @@ package com.garbagemule.MobArena.commands.setup;
import org.bukkit.command.CommandSender;
import com.garbagemule.MobArena.Messenger;
import com.garbagemule.MobArena.Msg;
import com.garbagemule.MobArena.commands.Command;
import com.garbagemule.MobArena.commands.CommandInfo;
import com.garbagemule.MobArena.framework.ArenaMaster;
@ -23,17 +24,25 @@ public class RemoveLeaderboardCommand implements Command{
// If no argument, use the currently selected arena
if (arg1.equals("")) {
if(am.getSelectedArena().getRegion().getLeaderboard() != null) {
if (am.getSelectedArena().getRegion().getLeaderboard() != null) {
am.getSelectedArena().getRegion().set("leaderboard", null);
Messenger.tellPlayer(sender, "Leaderboard for " + am.getSelectedArena().arenaName() + " successfully removed!");
return true;
}
else {
Messenger.tellPlayer(sender, Msg.ARENA_LBOARD_NOT_FOUND);
}
}
else {
if(am.getArenaWithName(arg1) != null) {
am.getArenaWithName(arg1).getRegion().set("leaderboard", null);
Messenger.tellPlayer(sender, "Leaderboard for " + am.getSelectedArena().arenaName() + " successfully removed!");
return true;
if (am.getArenaWithName(arg1) != null) {
if (am.getSelectedArena().getRegion().getLeaderboard() != null) {
am.getArenaWithName(arg1).getRegion().set("leaderboard", null);
Messenger.tellPlayer(sender, "Leaderboard for " + am.getArenaWithName(arg1).arenaName() + " successfully removed!");
return true;
}
else {
Messenger.tellPlayer(sender, Msg.ARENA_LBOARD_NOT_FOUND);
}
}
else {
Messenger.tellPlayer(sender, "Usage: /ma removeleaderboard <arenaname>");