Skip to content

Commit

Permalink
finish restore command and add to list of commands when dueladmin is …
Browse files Browse the repository at this point in the history
…run. Pre Release 0.9.11.2
  • Loading branch information
teozfrank committed Jan 18, 2015
1 parent fb4d75f commit 3488c69
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
Util.sendEmptyMsg(sender,ChatColor.GREEN+ "/dueladmin remove <arenaname> - "+ ChatColor.GOLD + "removes a duel arena with the given name.");
Util.sendEmptyMsg(sender,ChatColor.GREEN+ "/dueladmin setspawnpoint1 <arenaname> - "+ ChatColor.GOLD + "set the first spawnpoint for a duel arena.");
Util.sendEmptyMsg(sender,ChatColor.GREEN+ "/dueladmin setspawnpoint2 <arenaname> - "+ ChatColor.GOLD + "set the second spawnpoint for a duel arena.");
Util.sendEmptyMsg(sender,ChatColor.GREEN+ "/dueladmin restore <player> - "+ ChatColor.GOLD + "attempt to restore a players data.");
Util.sendEmptyMsg(sender,ChatColor.GREEN+ "/dueladmin reload - "+ ChatColor.GOLD + "reload the plugin configs.");
Util.sendEmptyMsg(sender, "");
Util.sendEmptyMsg(sender, ChatColor.GOLD + "Below commands only work if MySql is setup and enabled.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@ public void run(DuelArena duelArena, CommandSender sender, String subCmd, String

String playerName = getValue(args, 0, "");

Player player = Bukkit.getPlayer(playerName);
Player player = Bukkit.getPlayerExact(playerName);
if(player != null) {
dm.restorePlayerData(player);
boolean success = dm.restorePlayerData(player);
if(success) {
Util.sendMsg(sender, ChatColor.GREEN + "Player data for " + playerName + " was successfully restored!");
} else {
Util.sendMsg(sender, ChatColor.RED + "There was an error trying to restore player data for player " + playerName);
}
} else {
Util.sendMsg(sender, ChatColor.RED + "The player " + playerName + " is not online! did you type it correctly?");
}
}
}
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: DuelMe
version: 0.9.11.1 Pre Release
version: 0.9.11.2 Pre Release
author: teozfrank
description: allows players to duel each other in a controlled environment
main: com.teozcommunity.teozfrank.duelme.main.DuelMe
Expand Down

0 comments on commit 3488c69

Please sign in to comment.