mirror of
https://github.com/PikaMug/Quests.git
synced 2025-02-22 15:31:27 +01:00
Soft-depend PhatLoots
This commit is contained in:
parent
75b4d871af
commit
84a38a9aa8
@ -8,8 +8,8 @@ import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.herocraftonline.heroes.characters.Hero;
|
||||
import com.sk89q.worldguard.protection.ApplicableRegionSet;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import java.util.HashMap;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@ -280,7 +280,8 @@ public class Quest {
|
||||
|
||||
}
|
||||
|
||||
public void completeQuest(Quester q) {
|
||||
@SuppressWarnings("deprecation")
|
||||
public void completeQuest(Quester q) {
|
||||
|
||||
Player player = plugin.getServer().getPlayer(q.id);
|
||||
q.hardQuit(this);
|
||||
@ -339,7 +340,6 @@ public class Quest {
|
||||
|
||||
LinkedList<ItemStack> phatLootItems = new LinkedList<ItemStack>();
|
||||
int phatLootExp = 0;
|
||||
int phatLootMoney = 0;
|
||||
|
||||
LinkedList<String> phatLootMessages = new LinkedList<String>();
|
||||
|
||||
@ -353,7 +353,6 @@ public class Quest {
|
||||
}
|
||||
|
||||
if (lb.getMoney() > 0) {
|
||||
phatLootMoney += lb.getMoney();
|
||||
Quests.economy.depositPlayer(player.getName(), lb.getMoney());
|
||||
}
|
||||
|
||||
|
@ -2,14 +2,15 @@ package me.blackvein.quests.prompts;
|
||||
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.herocraftonline.heroes.characters.classes.HeroClass;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import me.blackvein.quests.CustomRequirement;
|
||||
|
||||
import me.blackvein.quests.CustomRequirement;
|
||||
import me.blackvein.quests.util.ColorUtil;
|
||||
import me.blackvein.quests.Quest;
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
@ -39,7 +40,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
|
||||
String text;
|
||||
@ -433,7 +435,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected Prompt acceptValidatedInput(ConversationContext context, String input) {
|
||||
|
||||
if (input.equalsIgnoreCase("1")) {
|
||||
@ -478,11 +481,13 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
|
||||
}
|
||||
|
||||
private List<ItemStack> getItems(ConversationContext context) {
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<ItemStack> getItems(ConversationContext context) {
|
||||
return (List<ItemStack>) context.getSessionData(CK.REQ_ITEMS);
|
||||
}
|
||||
|
||||
private List<Boolean> getRemoveItems(ConversationContext context) {
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<Boolean> getRemoveItems(ConversationContext context) {
|
||||
return (List<Boolean>) context.getSessionData(CK.REQ_ITEMS_REMOVE);
|
||||
}
|
||||
}
|
||||
@ -569,7 +574,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
return text + YELLOW + Lang.get("reqCustomPrompt");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Prompt acceptInput(ConversationContext context, String input) {
|
||||
|
||||
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) {
|
||||
@ -642,7 +648,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
|
||||
private class RequirementCustomDataListPrompt extends StringPrompt {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
|
||||
String text = BOLD + "" + AQUA + "- ";
|
||||
@ -683,7 +690,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
@Override
|
||||
public Prompt acceptInput(ConversationContext context, String input) {
|
||||
|
||||
LinkedList<Map<String, Object>> datamapList = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REQ_CUSTOM_DATA);
|
||||
@SuppressWarnings("unchecked")
|
||||
LinkedList<Map<String, Object>> datamapList = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REQ_CUSTOM_DATA);
|
||||
Map<String, Object> datamap = datamapList.getLast();
|
||||
|
||||
int numInput;
|
||||
@ -731,7 +739,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
public String getPromptText(ConversationContext context) {
|
||||
String text = "";
|
||||
String temp = (String) context.getSessionData(CK.REQ_CUSTOM_DATA_TEMP);
|
||||
Map<String, String> descriptions = (Map<String, String>) context.getSessionData(CK.REQ_CUSTOM_DATA_DESCRIPTIONS);
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, String> descriptions = (Map<String, String>) context.getSessionData(CK.REQ_CUSTOM_DATA_DESCRIPTIONS);
|
||||
if (descriptions.get(temp) != null) {
|
||||
text += GOLD + descriptions.get(temp) + "\n";
|
||||
}
|
||||
@ -744,7 +753,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
|
||||
@Override
|
||||
public Prompt acceptInput(ConversationContext context, String input) {
|
||||
LinkedList<Map<String, Object>> datamapList = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REQ_CUSTOM_DATA);
|
||||
@SuppressWarnings("unchecked")
|
||||
LinkedList<Map<String, Object>> datamapList = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REQ_CUSTOM_DATA);
|
||||
Map<String, Object> datamap = datamapList.getLast();
|
||||
datamap.put((String) context.getSessionData(CK.REQ_CUSTOM_DATA_TEMP), input);
|
||||
context.setSessionData(CK.REQ_CUSTOM_DATA_TEMP, null);
|
||||
@ -767,7 +777,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
text += BOLD + "" + GREEN + "1" + RESET + GREEN + " - " + Lang.get("reqSetSkills") + "(" + Lang.get("noneSet") + ")\n";
|
||||
} else {
|
||||
text += BOLD + "" + GREEN + "1" + RESET + GREEN + " - " + Lang.get("reqSetSkills") + "\n";
|
||||
LinkedList<String> skills = (LinkedList<String>) cc.getSessionData(CK.REQ_MCMMO_SKILLS);
|
||||
@SuppressWarnings("unchecked")
|
||||
LinkedList<String> skills = (LinkedList<String>) cc.getSessionData(CK.REQ_MCMMO_SKILLS);
|
||||
for (String skill : skills) {
|
||||
text += GRAY + " - " + AQUA + skill + "\n";
|
||||
}
|
||||
@ -777,7 +788,8 @@ public class RequirementsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
text += BOLD + "" + GREEN + "2" + RESET + GREEN + " - " + Lang.get("reqSetSkillAmounts") + " (" + Lang.get("noneSet") + ")\n";
|
||||
} else {
|
||||
text += BOLD + "" + GREEN + "2" + RESET + GREEN + " - " + Lang.get("reqSetSkillAmounts") + "\n";
|
||||
LinkedList<Integer> amounts = (LinkedList<Integer>) cc.getSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS);
|
||||
@SuppressWarnings("unchecked")
|
||||
LinkedList<Integer> amounts = (LinkedList<Integer>) cc.getSessionData(CK.REQ_MCMMO_SKILL_AMOUNTS);
|
||||
for (int i : amounts) {
|
||||
text += GRAY + " - " + AQUA + i + "\n";
|
||||
}
|
||||
|
@ -4,11 +4,13 @@ import com.codisimus.plugins.phatloots.PhatLoot;
|
||||
import com.codisimus.plugins.phatloots.PhatLootsAPI;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.herocraftonline.heroes.characters.classes.HeroClass;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import me.blackvein.quests.CustomReward;
|
||||
import me.blackvein.quests.util.ColorUtil;
|
||||
import me.blackvein.quests.QuestFactory;
|
||||
@ -17,6 +19,7 @@ import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.util.CK;
|
||||
import me.blackvein.quests.util.ItemUtil;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.FixedSetPrompt;
|
||||
import org.bukkit.conversations.NumericPrompt;
|
||||
@ -38,7 +41,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
|
||||
String text;
|
||||
@ -369,7 +373,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
|
||||
}
|
||||
|
||||
private List<ItemStack> getItems(ConversationContext context) {
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<ItemStack> getItems(ConversationContext context) {
|
||||
return (List<ItemStack>) context.getSessionData(CK.REW_ITEMS);
|
||||
}
|
||||
|
||||
@ -491,7 +496,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected Prompt acceptValidatedInput(ConversationContext context, String input) {
|
||||
|
||||
if (input.equalsIgnoreCase("1")) {
|
||||
@ -536,11 +542,13 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
|
||||
}
|
||||
|
||||
private List<String> getSkills(ConversationContext context) {
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<String> getSkills(ConversationContext context) {
|
||||
return (List<String>) context.getSessionData(CK.REW_MCMMO_SKILLS);
|
||||
}
|
||||
|
||||
private List<Integer> getSkillAmounts(ConversationContext context) {
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<Integer> getSkillAmounts(ConversationContext context) {
|
||||
return (List<Integer>) context.getSessionData(CK.REW_MCMMO_AMOUNTS);
|
||||
}
|
||||
|
||||
@ -690,7 +698,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected Prompt acceptValidatedInput(ConversationContext context, String input) {
|
||||
|
||||
if (input.equalsIgnoreCase("1")) {
|
||||
@ -735,11 +744,13 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
|
||||
}
|
||||
|
||||
private List<String> getClasses(ConversationContext context) {
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<String> getClasses(ConversationContext context) {
|
||||
return (List<String>) context.getSessionData(CK.REW_HEROES_CLASSES);
|
||||
}
|
||||
|
||||
private List<Double> getClassAmounts(ConversationContext context) {
|
||||
@SuppressWarnings("unchecked")
|
||||
private List<Double> getClassAmounts(ConversationContext context) {
|
||||
return (List<Double>) context.getSessionData(CK.REW_HEROES_AMOUNTS);
|
||||
}
|
||||
|
||||
@ -924,7 +935,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
return text + YELLOW + Lang.get("rewCustomRewardPrompt");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public Prompt acceptInput(ConversationContext context, String input) {
|
||||
|
||||
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false && input.equalsIgnoreCase(Lang.get("cmdClear")) == false) {
|
||||
@ -997,7 +1009,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
|
||||
private class RewardCustomDataListPrompt extends StringPrompt {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public String getPromptText(ConversationContext context) {
|
||||
|
||||
String text = BOLD + "" + AQUA + "- ";
|
||||
@ -1038,7 +1051,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
@Override
|
||||
public Prompt acceptInput(ConversationContext context, String input) {
|
||||
|
||||
LinkedList<Map<String, Object>> datamapList = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REW_CUSTOM_DATA);
|
||||
@SuppressWarnings("unchecked")
|
||||
LinkedList<Map<String, Object>> datamapList = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REW_CUSTOM_DATA);
|
||||
Map<String, Object> datamap = datamapList.getLast();
|
||||
|
||||
int numInput;
|
||||
@ -1086,7 +1100,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
public String getPromptText(ConversationContext context) {
|
||||
String text = "";
|
||||
String temp = (String) context.getSessionData(CK.REW_CUSTOM_DATA_TEMP);
|
||||
Map<String, String> descriptions = (Map<String, String>) context.getSessionData(CK.REW_CUSTOM_DATA_DESCRIPTIONS);
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, String> descriptions = (Map<String, String>) context.getSessionData(CK.REW_CUSTOM_DATA_DESCRIPTIONS);
|
||||
if (descriptions.get(temp) != null) {
|
||||
text += GOLD + descriptions.get(temp) + "\n";
|
||||
}
|
||||
@ -1099,7 +1114,8 @@ public class RewardsPrompt extends FixedSetPrompt implements ColorUtil {
|
||||
|
||||
@Override
|
||||
public Prompt acceptInput(ConversationContext context, String input) {
|
||||
LinkedList<Map<String, Object>> datamapList = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REW_CUSTOM_DATA);
|
||||
@SuppressWarnings("unchecked")
|
||||
LinkedList<Map<String, Object>> datamapList = (LinkedList<Map<String, Object>>) context.getSessionData(CK.REW_CUSTOM_DATA);
|
||||
Map<String, Object> datamap = datamapList.getLast();
|
||||
datamap.put((String) context.getSessionData(CK.REW_CUSTOM_DATA_TEMP), input);
|
||||
context.setSessionData(CK.REW_CUSTOM_DATA_TEMP, null);
|
||||
|
@ -5,7 +5,7 @@ description: Player questing system
|
||||
website: http://dev.bukkit.org/server-mods/quests/
|
||||
dev-url: https://github.com/Blackvein/Quests/
|
||||
authors: [Blackvein]
|
||||
softdepend: [Citizens, Vault]
|
||||
softdepend: [Citizens, PhatLoots, Vault]
|
||||
permissions:
|
||||
quests.quest:
|
||||
description: View current Quest objectives
|
||||
|
Loading…
Reference in New Issue
Block a user