mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-24 18:18:20 +01:00
Some fixes to /questsadmin reset
This commit is contained in:
parent
c75f679158
commit
322c2d908a
@ -1600,27 +1600,36 @@ try{
|
||||
cs.sendMessage(YELLOW + Lang.get("playerNotFound"));
|
||||
return;
|
||||
}
|
||||
UUID id = quester.id;
|
||||
questers.remove(id);
|
||||
|
||||
try {
|
||||
quester.hardClear();
|
||||
quester.saveData();
|
||||
quester.updateJournal();
|
||||
final File dataFolder = new File(this.getDataFolder(), "data/");
|
||||
final File found = new File(dataFolder, quester.id + ".yml");
|
||||
final File found = new File(dataFolder, id + ".yml");
|
||||
found.delete();
|
||||
|
||||
String msg = Lang.get("questReset");
|
||||
if (Bukkit.getOfflinePlayer(quester.id).getName() != null) {
|
||||
msg = msg.replaceAll("<player>", GREEN + Bukkit.getOfflinePlayer(quester.id).getName() + GOLD);
|
||||
if (Bukkit.getOfflinePlayer(id).getName() != null) {
|
||||
msg = msg.replaceAll("<player>", GREEN + Bukkit.getOfflinePlayer(id).getName() + GOLD);
|
||||
} else {
|
||||
msg = msg.replaceAll("<player>", GREEN + args[1] + GOLD);
|
||||
}
|
||||
cs.sendMessage(GOLD + msg);
|
||||
cs.sendMessage(PURPLE + " UUID: " + DARKAQUA + quester.id);
|
||||
cs.sendMessage(PURPLE + " UUID: " + DARKAQUA + id);
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
getLogger().info("Data file does not exist for " + quester.id.toString());
|
||||
getLogger().info("Data file does not exist for " + id.toString());
|
||||
}
|
||||
|
||||
quester = new Quester(this);
|
||||
quester.id = id;
|
||||
quester.saveData();
|
||||
questers.put(id, quester);
|
||||
|
||||
} else {
|
||||
|
||||
cs.sendMessage(RED + Lang.get("questCmdNoPerms"));
|
||||
|
Loading…
Reference in New Issue
Block a user