Added data support for Custom Reward Names

This commit is contained in:
Blackvein 2014-01-16 20:20:13 -08:00
parent c89e4c7459
commit c689268e9c
2 changed files with 7 additions and 14 deletions

View File

@ -2,10 +2,6 @@ package me.blackvein.quests;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import org.bukkit.DyeColor;
import org.bukkit.Material;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;

View File

@ -56,15 +56,6 @@ public class Quest {
String heroesSecondaryClassReq = null; String heroesSecondaryClassReq = null;
Map<String, Map<String, Object>> customRequirements = new HashMap<String, Map<String, Object>>(); Map<String, Map<String, Object>> customRequirements = new HashMap<String, Map<String, Object>>();
Map<String, Map<String, Object>> customRewards = new HashMap<String, Map<String, Object>>(); Map<String, Map<String, Object>> customRewards = new HashMap<String, Map<String, Object>>();
/**
* Somehow I need to make customObjectives in the Stage class have the same
* sort of thing here ^ where it stores the custom data for the custom objective
* set by the questmaker.
*
*
*
*
*/
public String failRequirements = null; public String failRequirements = null;
// //
@ -500,6 +491,12 @@ public class Quest {
} }
if(found != null){ if(found != null){
Map<String, Object> datamap = customRewards.get(found.getName());
String message = found.getRewardName();
for(String key : datamap.keySet()){
message = message.replaceAll("%" + ((String) key) + "%", ((String) datamap.get(key)));
}
player.sendMessage("- " + ChatColor.GOLD + found.getRewardName()); player.sendMessage("- " + ChatColor.GOLD + found.getRewardName());
found.giveReward(player, customRewards.get(s)); found.giveReward(player, customRewards.get(s));
}else{ }else{