mirror of
https://github.com/PikaMug/Quests.git
synced 2025-01-03 15:08:10 +01:00
Warn if custom reward has no name, fixes #53. Bump version number
This commit is contained in:
parent
71f5496c64
commit
038c3dc86f
@ -423,13 +423,17 @@ public class Quest {
|
|||||||
if (found != null) {
|
if (found != null) {
|
||||||
Map<String, Object> datamap = customRewards.get(found.getName());
|
Map<String, Object> datamap = customRewards.get(found.getName());
|
||||||
String message = found.getRewardName();
|
String message = found.getRewardName();
|
||||||
for (String key : datamap.keySet()) {
|
if (message != null) {
|
||||||
message = message.replaceAll("%" + ((String) key) + "%", ((String) datamap.get(key)));
|
for (String key : datamap.keySet()) {
|
||||||
|
message = message.replaceAll("%" + ((String) key) + "%", ((String) datamap.get(key)));
|
||||||
|
}
|
||||||
|
player.sendMessage("- " + ChatColor.GOLD + message);
|
||||||
|
} else {
|
||||||
|
plugin.getLogger().warning("Failed to notify player: Custom Reward does not have an assigned name");
|
||||||
}
|
}
|
||||||
player.sendMessage("- " + ChatColor.GOLD + message);
|
|
||||||
found.giveReward(player, customRewards.get(s));
|
found.giveReward(player, customRewards.get(s));
|
||||||
} else {
|
} else {
|
||||||
plugin.getLogger().warning("[Quests] Quester \"" + player.getName() + "\" completed the Quest \"" + name + "\", but the Custom Reward \"" + s + "\" could not be found. Does it still exist?");
|
plugin.getLogger().warning("Quester \"" + player.getName() + "\" completed the Quest \"" + name + "\", but the Custom Reward \"" + s + "\" could not be found. Does it still exist?");
|
||||||
}
|
}
|
||||||
none = null;
|
none = null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user