Remove majority of deprecated methods (BREAKING)

This commit is contained in:
PikaMug 2020-02-03 23:51:15 -05:00
parent 7696f5a371
commit 16edbed39b
13 changed files with 63 additions and 407 deletions

View File

@ -70,32 +70,10 @@ public abstract class CustomObjective implements Listener {
descriptions.put(title, description);
}
/**
* Set the title of a prompt
*
* @param name Prompt title
* @deprecated use addPrompt(name, description)
*/
public void addData(String name) {
Entry<String, Object> prompt = new AbstractMap.SimpleEntry<String, Object>(name, null);
data.add(prompt);
}
public Map<String, String> getDescriptions() {
return descriptions;
}
/**
* Set the description for the specified prompt
*
* @param name Prompt title
* @param description Description of expected input
* @deprecated use addTaskPrompt(name, description)
*/
public void addDescription(String name, String description) {
descriptions.put(name, description);
}
public int getCount() {
return count;
}
@ -128,16 +106,6 @@ public abstract class CustomObjective implements Listener {
this.showCount = showCount;
}
/**
* Check whether to let user set required amount for objective
*
* @param enableCount
* @deprecated use setShowCount(boolean)
*/
public void setEnableCount(boolean enableCount) {
setShowCount(enableCount);
}
public String getDisplay() {
return display;
}
@ -147,19 +115,6 @@ public abstract class CustomObjective implements Listener {
}
public Map<String, Object> getDataForPlayer(Player player, CustomObjective customObj, Quest quest) {
return getDatamap(player, customObj, quest);
}
/**
* Get data for specified player's current stage
*
* @param player The player to get data for
* @param obj The CustomObjective to get data for
* @param quest Quest to get player's current stage. Returns null if player is not on quest
* @return data map if everything matches, otherwise null
* @deprecated use getDataForPlayer()
*/
public Map<String, Object> getDatamap(Player player, CustomObjective obj, Quest quest) {
Quester quester = plugin.getQuester(player.getUniqueId());
if (quester != null) {
Stage currentStage = quester.getCurrentStage(quest);
@ -168,7 +123,7 @@ public abstract class CustomObjective implements Listener {
}
CustomObjective found = null;
for (me.blackvein.quests.CustomObjective co : currentStage.customObjectives) {
if (co.getName().equals(obj.getName())) {
if (co.getName().equals(customObj.getName())) {
found = co;
break;
}

View File

@ -59,29 +59,8 @@ public abstract class CustomRequirement {
data.put(title, defaultValue);
descriptions.put(title, description);
}
/**
* Set the title of a prompt
*
* @param name Prompt title
* @deprecated use addPrompt(name, description)
*/
public void addData(String name) {
data.put(name, null);
}
public Map<String, String> getDescriptions() {
return descriptions;
}
/**
* Set the description for the specified prompt
*
* @param name Prompt title
* @param description Description of expected input
* @deprecated use addTaskPrompt(name, description)
*/
public void addDescription(String name, String description) {
descriptions.put(name, description);
}
}

View File

@ -60,31 +60,10 @@ public abstract class CustomReward {
data.put(title, defaultValue);
descriptions.put(title, description);
}
/**
* Set the title of a prompt
*
* @param name Prompt title
* @deprecated use addPrompt(name, description)
*/
public void addData(String name) {
data.put(name, null);
}
public Map<String, String> getDescriptions() {
return descriptions;
}
/**
* Set the description for the specified prompt
*
* @param name Prompt title
* @param description Description of expected input
* @deprecated use addTaskPrompt(name, description)
*/
public void addDescription(String name, String description) {
descriptions.put(name, description);
}
public String getRewardName() {
return rewardName;

View File

@ -72,15 +72,6 @@ public class Dependencies {
return worldGuardApi;
}
/**
* Get mcMMO Classic plugin
*
* @deprecated Use {@link #getMcmmoClassic()}
*/
public mcMMO getMcmmo() {
return mcmmo;
}
public mcMMO getMcmmoClassic() {
return mcmmo;
}

View File

@ -103,20 +103,6 @@ public class Quest {
this.regionStart = regionStart;
}
/**
* @deprecated Use {@link #getRegionStart()}
*/
public String getRegion() {
return getRegionStart();
}
/**
* @deprecated Use {@link #setRegion(String)}
*/
public void setRegion(String region) {
setRegionStart(region);
}
public ItemStack getGUIDisplay() {
return guiDisplay;
}
@ -176,16 +162,6 @@ public class Quest {
public Options getOptions() {
return opts;
}
/**
* Force player to proceed to the next ordered stage
*
* @param quester Player to force
* @deprecated Use nextStage(Quester, boolean)
*/
public void nextStage(Quester quester) {
nextStage(quester, false);
}
/**
* Force player to proceed to the next ordered stage
@ -537,7 +513,7 @@ public class Quest {
}
if (player.isOnline()) {
for (String s : rews.getHeroesClasses()) {
Hero hero = plugin.getHero(player.getUniqueId());
Hero hero = plugin.getDependencies().getHero(player.getUniqueId());
hero.addExp(rews.getHeroesAmounts().get(rews.getHeroesClasses().indexOf(s)),
plugin.getDependencies().getHeroes().getClassManager().getClass(s),
((Player)player).getLocation());
@ -695,11 +671,11 @@ public class Quest {
}
if (rews.getMoney() > 1) {
p.sendMessage("- " + ChatColor.DARK_GREEN + rews.getMoney() + " " + ChatColor.DARK_PURPLE
+ plugin.getCurrency(true));
+ plugin.getDependencies().getCurrency(true));
none = null;
} else if (rews.getMoney() == 1) {
p.sendMessage("- " + ChatColor.DARK_GREEN + rews.getMoney() + " " + ChatColor.DARK_PURPLE
+ plugin.getCurrency(false));
+ plugin.getDependencies().getCurrency(false));
none = null;
}
if (rews.getExp() > 0 || phatLootExp > 0) {

View File

@ -853,7 +853,7 @@ public class QuestFactory implements ConversationAbandonedListener {
if (stage.locationsToKillWithin.isEmpty() == false) {
LinkedList<String> locs = new LinkedList<String>();
for (Location l : stage.locationsToKillWithin) {
locs.add(Quests.getLocationInfo(l));
locs.add(ConfigUtil.getLocationInfo(l));
}
context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS, locs);
context.setSessionData(pref + CK.S_MOB_KILL_LOCATIONS_RADIUS, stage.radiiToKillWithin);
@ -863,7 +863,7 @@ public class QuestFactory implements ConversationAbandonedListener {
if (stage.locationsToReach.isEmpty() == false) {
LinkedList<String> locs = new LinkedList<String>();
for (Location l : stage.locationsToReach) {
locs.add(Quests.getLocationInfo(l));
locs.add(ConfigUtil.getLocationInfo(l));
}
context.setSessionData(pref + CK.S_REACH_LOCATIONS, locs);
context.setSessionData(pref + CK.S_REACH_LOCATIONS_RADIUS, stage.radiiToReachWithin);

View File

@ -996,12 +996,12 @@ public class Quester {
if (delivered < toDeliver) {
String obj = Lang.get(getPlayer(), "deliver");
obj = obj.replace("<item>", ItemUtil.getName(is) + ChatColor.GREEN);
obj = obj.replace("<npc>", plugin.getNPCName(npc));
obj = obj.replace("<npc>", plugin.getDependencies().getNPCName(npc));
unfinishedObjectives.add(ChatColor.GREEN + obj + ": " + delivered + "/" + toDeliver);
} else {
String obj = Lang.get(getPlayer(), "deliver");
obj = obj.replace("<item>", ItemUtil.getName(is) + ChatColor.GRAY);
obj = obj.replace("<npc>", plugin.getNPCName(npc));
obj = obj.replace("<npc>", plugin.getDependencies().getNPCName(npc));
finishedObjectives.add(ChatColor.GRAY + obj + ": " + delivered + "/" + toDeliver);
}
}
@ -1010,11 +1010,11 @@ public class Quester {
if (e.getKey().equals(n)) {
if (e.getValue() == false) {
String obj = Lang.get(getPlayer(), "talkTo");
obj = obj.replace("<npc>", plugin.getNPCName(n));
obj = obj.replace("<npc>", plugin.getDependencies().getNPCName(n));
unfinishedObjectives.add(ChatColor.GREEN + obj);
} else {
String obj = Lang.get(getPlayer(), "talkTo");
obj = obj.replace("<npc>", plugin.getNPCName(n));
obj = obj.replace("<npc>", plugin.getDependencies().getNPCName(n));
finishedObjectives.add(ChatColor.GRAY + obj);
}
}
@ -1030,16 +1030,16 @@ public class Quester {
< getCurrentStage(quest).citizenNumToKill.get(getCurrentStage(quest).citizensToKill
.indexOf(n))) {
unfinishedObjectives.add(ChatColor.GREEN + Lang.get(getPlayer(), "kill") + " "
+ plugin.getNPCName(n) + ChatColor.GREEN + " " + getQuestData(quest)
.citizenNumKilled.get(getCurrentStage(quest).citizensToKill.indexOf(n)) + "/"
+ getCurrentStage(quest).citizenNumToKill.get(getCurrentStage(quest).citizensToKill
.indexOf(n)));
+ plugin.getDependencies().getNPCName(n) + ChatColor.GREEN + " "
+ getQuestData(quest).citizenNumKilled.get(getCurrentStage(quest).citizensToKill
.indexOf(n)) + "/" + getCurrentStage(quest).citizenNumToKill
.get(getCurrentStage(quest).citizensToKill.indexOf(n)));
} else {
finishedObjectives.add(ChatColor.GRAY + Lang.get(getPlayer(), "kill") + " "
+ plugin.getNPCName(n) + ChatColor.GRAY + " " + getCurrentStage(quest)
.citizenNumToKill.get(getCurrentStage(quest).citizensToKill.indexOf(n)) + "/"
+ plugin.getDependencies().getNPCName(n) + ChatColor.GRAY + " "
+ getCurrentStage(quest).citizenNumToKill.get(getCurrentStage(quest).citizensToKill
.indexOf(n)));
.indexOf(n)) + "/" + getCurrentStage(quest).citizenNumToKill
.get(getCurrentStage(quest).citizensToKill.indexOf(n)));
}
}
}
@ -2212,7 +2212,7 @@ public class Quester {
} else if (objective.equalsIgnoreCase("breakBlock")) {
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "break") + " <item>";
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta()
if (plugin.getSettings().canTranslateNames() && !increment.hasItemMeta()
&& !increment.getItemMeta().hasDisplayName()) {
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), null);
} else {
@ -2222,7 +2222,7 @@ public class Quester {
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "damage")
+ " <item>";
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta()
if (plugin.getSettings().canTranslateNames() && !increment.hasItemMeta()
&& !increment.getItemMeta().hasDisplayName()) {
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), null);
} else {
@ -2231,7 +2231,7 @@ public class Quester {
} else if (objective.equalsIgnoreCase("placeBlock")) {
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "place") + " <item>";
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta()
if (plugin.getSettings().canTranslateNames() && !increment.hasItemMeta()
&& !increment.getItemMeta().hasDisplayName()) {
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), null);
} else {
@ -2240,7 +2240,7 @@ public class Quester {
} else if (objective.equalsIgnoreCase("useBlock")) {
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "use") + " <item>";
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta()
if (plugin.getSettings().canTranslateNames() && !increment.hasItemMeta()
&& !increment.getItemMeta().hasDisplayName()) {
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), null);
} else {
@ -2249,7 +2249,7 @@ public class Quester {
} else if (objective.equalsIgnoreCase("cutBlock")) {
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "cut") + " <item>";
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta()
if (plugin.getSettings().canTranslateNames() && !increment.hasItemMeta()
&& !increment.getItemMeta().hasDisplayName()) {
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), null);
} else {
@ -2259,7 +2259,7 @@ public class Quester {
ItemStack is = getCurrentStage(quest).itemsToCraft.get(getCurrentStage(quest).itemsToCraft.indexOf(goal));
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "craft") + " <item> "
+ is.getAmount() + "/" + is.getAmount();
if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta()
if (plugin.getSettings().canTranslateNames() && !increment.hasItemMeta()
&& !increment.getItemMeta().hasDisplayName()) {
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(), null);
} else {
@ -2269,7 +2269,7 @@ public class Quester {
ItemStack is = getCurrentStage(quest).itemsToSmelt.get(getCurrentStage(quest).itemsToSmelt.indexOf(goal));
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "smelt") + " <item> "
+ is.getAmount() + "/" + is.getAmount();
if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta()
if (plugin.getSettings().canTranslateNames() && !increment.hasItemMeta()
&& !increment.getItemMeta().hasDisplayName()) {
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(), null);
} else {
@ -2286,7 +2286,7 @@ public class Quester {
break;
}
}
if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta()
if (plugin.getSettings().canTranslateNames() && !increment.hasItemMeta()
&& !increment.getItemMeta().hasDisplayName()) {
plugin.getLocaleQuery().sendMessage(p, message, increment.getType(), increment.getDurability(), ench);
} else {
@ -2297,7 +2297,7 @@ public class Quester {
ItemStack is = getCurrentStage(quest).itemsToBrew.get(getCurrentStage(quest).itemsToBrew.indexOf(goal));
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "brew") + " <item> "
+ is.getAmount() + "/" + is.getAmount();
if (plugin.getSettings().canTranslateItems() && goal.hasItemMeta()
if (plugin.getSettings().canTranslateNames() && goal.hasItemMeta()
&& !increment.getItemMeta().hasDisplayName()) {
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(), null,
goal.getItemMeta());
@ -2306,12 +2306,12 @@ public class Quester {
}
} else if (objective.equalsIgnoreCase("deliverItem")) {
String obj = Lang.get(p, "deliver");
obj = obj.replace("<npc>", plugin.getNPCName(getCurrentStage(quest).itemDeliveryTargets
obj = obj.replace("<npc>", plugin.getDependencies().getNPCName(getCurrentStage(quest).itemDeliveryTargets
.get(getCurrentStage(quest).itemsToDeliver.indexOf(goal))));
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + obj;
ItemStack is = getCurrentStage(quest).itemsToDeliver.get(getCurrentStage(quest).itemsToDeliver
.indexOf(goal));
if (plugin.getSettings().canTranslateItems() && !increment.hasItemMeta()
if (plugin.getSettings().canTranslateNames() && !increment.hasItemMeta()
&& !increment.getItemMeta().hasDisplayName()) {
plugin.getLocaleQuery().sendMessage(p, message, is.getType(), is.getDurability(), null);
} else {
@ -2328,7 +2328,7 @@ public class Quester {
} else if (objective.equalsIgnoreCase("killMob")) {
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "kill") + " <mob>";
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
if (plugin.getSettings().canTranslateItems()) {
if (plugin.getSettings().canTranslateNames()) {
plugin.getLocaleQuery().sendMessage(p, message, mob, extra);
} else {
p.sendMessage(message.replace("<mob>", MiscUtil.getProperMobName(mob)));
@ -2339,7 +2339,7 @@ public class Quester {
p.sendMessage(message);
} else if (objective.equalsIgnoreCase("talkToNPC")) {
String obj = Lang.get(p, "talkTo");
obj = obj.replace("<npc>", plugin.getNPCName(npc.getId()));
obj = obj.replace("<npc>", plugin.getDependencies().getNPCName(npc.getId()));
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + obj;
p.sendMessage(message);
} else if (objective.equalsIgnoreCase("killNPC")) {
@ -2350,7 +2350,7 @@ public class Quester {
} else if (objective.equalsIgnoreCase("tameMob")) {
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + Lang.get(p, "tame") + " <mob>";
message = message + " " + goal.getAmount() + "/" + goal.getAmount();
if (plugin.getSettings().canTranslateItems()) {
if (plugin.getSettings().canTranslateNames()) {
plugin.getLocaleQuery().sendMessage(p, message, mob, extra);
} else {
p.sendMessage(message.replace("<mob>", MiscUtil.getProperMobName(mob)));
@ -3164,8 +3164,8 @@ public class Quester {
LinkedList<Location> locations = new LinkedList<Location>();
List<Integer> radii = questSec.getIntegerList("mob-kill-location-radii");
for (String loc : questSec.getStringList("mob-kill-locations")) {
if (Quests.getLocation(loc) != null) {
locations.add(Quests.getLocation(loc));
if (ConfigUtil.getLocation(loc) != null) {
locations.add(ConfigUtil.getLocation(loc));
}
}
getQuestData(quest).locationsToKillWithin = locations;
@ -3223,8 +3223,8 @@ public class Quester {
}
List<Integer> radii = questSec.getIntegerList("radii-to-reach-within");
for (String loc : questSec.getStringList("locations-to-reach")) {
if (Quests.getLocation(loc) != null) {
locations.add(Quests.getLocation(loc));
if (ConfigUtil.getLocation(loc) != null) {
locations.add(ConfigUtil.getLocation(loc));
}
}
getQuestData(quest).locationsReached = locations;

View File

@ -72,7 +72,6 @@ import org.bukkit.plugin.java.JavaPlugin;
import com.codisimus.plugins.phatloots.PhatLootsAPI;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.herocraftonline.heroes.characters.Hero;
import com.herocraftonline.heroes.characters.classes.HeroClass;
import me.blackvein.quests.actions.Action;
@ -88,7 +87,6 @@ import me.blackvein.quests.listeners.PlayerListener;
import me.blackvein.quests.tasks.NpcEffectThread;
import me.blackvein.quests.tasks.PlayerMoveThread;
import me.blackvein.quests.util.ConfigUtil;
import me.blackvein.quests.util.InventoryUtil;
import me.blackvein.quests.util.ItemUtil;
import me.blackvein.quests.util.Lang;
import me.blackvein.quests.util.LocaleQuery;
@ -281,20 +279,6 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
this.events = actions;
}
/**
* @deprecated Use getActions()
*/
public LinkedList<Action> getEvents() {
return events;
}
/**
* @deprecated Use setActions()
*/
public void setEvents(LinkedList<Action> events) {
this.events = events;
}
public LinkedList<Quester> getQuesters() {
return questers;
}
@ -545,7 +529,8 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
Quest quest = new Quest();
failedToLoad = false;
if (config.contains("quests." + questKey + ".name")) {
quest = getQuest(parseString(config.getString("quests." + questKey + ".name"), quest));
quest = getQuest(ConfigUtil.parseString(config.getString("quests." + questKey + ".name"),
quest));
loadCustomSections(quest, config, questKey);
} else {
skipQuestProcess("Quest block is missing", questKey);
@ -689,7 +674,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems() && !e.hasItemMeta() && !e.getItemMeta().hasDisplayName()) {
if (getSettings().canTranslateNames() && !e.hasItemMeta() && !e.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null);
} else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e)));
@ -712,7 +697,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems() && !e.hasItemMeta() && !e.getItemMeta().hasDisplayName()) {
if (getSettings().canTranslateNames() && !e.hasItemMeta() && !e.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null);
} else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e)));
@ -735,7 +720,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems() && !e.hasItemMeta() && !e.getItemMeta().hasDisplayName()) {
if (getSettings().canTranslateNames() && !e.hasItemMeta() && !e.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null);
} else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e)));
@ -758,7 +743,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems() && !e.hasItemMeta() && !e.getItemMeta().hasDisplayName()) {
if (getSettings().canTranslateNames() && !e.hasItemMeta() && !e.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null);
} else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e)));
@ -781,7 +766,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems() && !e.hasItemMeta() && !e.getItemMeta().hasDisplayName()) {
if (getSettings().canTranslateNames() && !e.hasItemMeta() && !e.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getType(), e.getDurability(), null);
} else {
quester.getPlayer().sendMessage(message.replace("<item>", ItemUtil.getName(e)));
@ -807,7 +792,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems() && !is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
if (getSettings().canTranslateNames() && !is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(),
is.getEnchantments());
} else {
@ -832,7 +817,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems() && !is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
if (getSettings().canTranslateNames() && !is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(),
is.getEnchantments());
} else {
@ -882,7 +867,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
}
Map<Enchantment, Integer> enchs = new HashMap<Enchantment, Integer>();
enchs.put(enchantment, 1);
if (getSettings().canTranslateItems()) {
if (getSettings().canTranslateNames()) {
localeQuery.sendMessage(quester.getPlayer(), message, mat, (short) 0, enchs);
} else {
quester.getPlayer().sendMessage(message
@ -910,7 +895,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems()) {
if (getSettings().canTranslateNames()) {
if (is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
// Bukkit version is 1.9+
localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(),
@ -984,7 +969,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems()) {
if (getSettings().canTranslateNames()) {
localeQuery.sendMessage(quester.getPlayer(), message, e, null);
} else {
quester.getPlayer().sendMessage(message.replace("<mob>", MiscUtil.getProperMobName(e)));
@ -1030,7 +1015,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
if (getSettings().canTranslateItems() && !is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
if (getSettings().canTranslateNames() && !is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
localeQuery.sendMessage(quester.getPlayer(), message, is.getType(), is.getDurability(),
is.getEnchantments());
} else {
@ -1047,7 +1032,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
} else {
message = color + Lang.get(quester.getPlayer(), "talkTo");
}
message = message.replace("<npc>", getNPCName(n));
message = message.replace("<npc>", depends.getNPCName(n));
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
@ -1093,7 +1078,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
message = color + Lang.get(quester.getPlayer(), "tame") + " " + "<mob>"
+ color + ": " + e2.getValue() + "/" + e.getValue();
}
if (getSettings().canTranslateItems()) {
if (getSettings().canTranslateNames()) {
localeQuery.sendMessage(quester.getPlayer(), message, e.getKey(), null);
} else {
quester.getPlayer().sendMessage(message.replace("<mob>",
@ -1199,17 +1184,6 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
}
}
/**
* Show the player a list of their quests
*
* @deprecated Use #listQuests(Quester)
* @param player Player to show the list
* @param page Page to display, with 7 quests per page
*/
public void listQuests(Player player, int page) {
listQuests(getQuester(player.getUniqueId()), page);
}
/**
* Show the player a list of their quests
*
@ -1343,28 +1317,6 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
return quester;
}
/**
* Get online Quester from player name
*
* @deprecated Use {@link #getQuester(UUID)}
* @param name Player name
* @return Quester, or null if offline
*/
public Quester getQuester(String name) {
UUID id = null;
Quester quester = null;
for (Player p : Bukkit.getOnlinePlayers()) {
if (p.getName().equalsIgnoreCase(name)) {
id = p.getUniqueId();
break;
}
}
if (id != null) {
quester = getQuester(id);
}
return quester;
}
/**
* Get a list of all online Questers
*
@ -1416,7 +1368,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
failedToLoad = false;
quest.id = questKey;
if (config.contains("quests." + questKey + ".name")) {
quest.setName(parseString(config.getString("quests." + questKey + ".name"), quest));
quest.setName(ConfigUtil.parseString(config.getString("quests." + questKey + ".name"), quest));
} else {
skipQuestProcess("Quest block is missing", questKey);
}
@ -1432,7 +1384,8 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
}
}
if (config.contains("quests." + questKey + ".block-start")) {
Location location = getLocation(config.getString("quests." + questKey + ".block-start"));
Location location = ConfigUtil.getLocation(config.getString("quests." + questKey
+ ".block-start"));
if (location != null) {
quest.blockStart = location;
} else {
@ -1479,12 +1432,14 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
}
}
if (config.contains("quests." + questKey + ".finish-message")) {
quest.finished = parseString(config.getString("quests." + questKey + ".finish-message"), quest);
quest.finished = ConfigUtil.parseString(config.getString("quests." + questKey
+ ".finish-message"), quest);
} else {
skipQuestProcess("finish-message is missing", questKey);
}
if (config.contains("quests." + questKey + ".ask-message")) {
quest.description = parseString(config.getString("quests." + questKey + ".ask-message"), quest);
quest.description = ConfigUtil.parseString(config.getString("quests." + questKey
+ ".ask-message"), quest);
} else {
skipQuestProcess("ask-message is missing", questKey);
}
@ -3027,15 +2982,6 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
throw new StageFormatException(quest, stage);
}
/**
* Load actions from file
*
* @deprecated Use loadActions()
*/
public void loadEvents() {
loadActions();
}
/**
* Load actions from file
*/
@ -3092,108 +3038,10 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
getLogger().log(Level.WARNING, "Empty file actions.yml was not loaded.");
}
}
/**
* @deprecated Use ConfigUtil.parseStringWithPossibleLineBreaks(String, Quest, Player)
*/
public String[] parseStringWithPossibleLineBreaks(String s, Quest quest, Player player) {
return ConfigUtil.parseStringWithPossibleLineBreaks(s, quest);
}
/**
* @deprecated Use ConfigUtil.parseStringWithPossibleLineBreaks(String, Quest)
*/
public static String[] parseStringWithPossibleLineBreaks(String s, Quest quest) {
return ConfigUtil.parseStringWithPossibleLineBreaks(s, quest);
}
/**
* @deprecated Use ConfigUtil.parseStringWithPossibleLineBreaks(String, NPC)
*/
public static String[] parseStringWithPossibleLineBreaks(String s, NPC npc) {
return ConfigUtil.parseStringWithPossibleLineBreaks(s, npc);
}
/**
* @deprecated Use ConfigUtil.parseString(String, Quest)
*/
public static String parseString(String s, Quest quest) {
return ConfigUtil.parseString(s, quest);
}
/**
* @deprecated Use ConfigUtil.parseString(String, Quest, Player)
*/
public String parseString(String s, Quest quest, Player player) {
return ConfigUtil.parseString(s, quest, player);
}
/**
* @deprecated Use ConfigUtil.parseString(String, NPC)
*/
public static String parseString(String s, NPC npc) {
return ConfigUtil.parseString(s);
}
/**
* @deprecated Use ConfigUtil.parseString(String)
*/
public static String parseString(String s) {
return ConfigUtil.parseString(s);
}
/**
* @deprecated Use ConfigUtil.getLocation(String)
*/
public static Location getLocation(String arg) {
return ConfigUtil.getLocation(arg);
}
/**
* @deprecated Use ConfigUtil.getLocationInfo(Location)
*/
public static String getLocationInfo(Location loc) {
return ConfigUtil.getLocationInfo(loc);
}
/**
* Gets living EntityType from name
*
* @deprecated Use MiscUtil.getProperMobType(EntityType)
* @param mob Name to get type from
* @return EntityType or null if invalid
*/
public static EntityType getMobType(String mob) {
return MiscUtil.getProperMobType(mob);
}
/**
* @deprecated Use MiscUtil.getTime(long)
*/
public static String getTime(long milliseconds) {
return MiscUtil.getTime(milliseconds);
}
public static SkillType getMcMMOSkill(String s) {
return SkillType.getSkill(s);
}
/**
* Adds item to player's inventory. If full, item is dropped at player's location.
*
* @deprecated Use InventoryUtil.addItem(Player, ItemStack)
* @throws NullPointerException when ItemStack is null
*/
public static void addItem(Player p, ItemStack i) throws Exception {
InventoryUtil.addItem(p, i);
}
/**
* @deprecated Use Dependencies.getCurrency(boolean)
*/
public String getCurrency(boolean plural) {
return depends.getCurrency(plural);
}
/**
* @deprecated Use InventoryUtil.removeItem(Inventory, ItemStack)
@ -3364,31 +3212,6 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
}
return null;
}
/**
* Get an Action by name
*
* @param name Name of the action
* @return Action or null if not found
* @deprecated Use getAction()
*/
public Action getEvent(String name) {
return getAction(name);
}
/**
* @deprecated Use Dependencies.getNPCLocation(int)
*/
public Location getNPCLocation(int id) {
return depends.getNPCLocation(id);
}
/**
* @deprecated Use Dependencies.getNPCName(int)
*/
public String getNPCName(int id) {
return depends.getNPCName(id);
}
/**
* Checks whether an NPC has a quest that the player may accept
@ -3443,25 +3266,4 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
}
return false;
}
/**
* @deprecated Use Dependencies.getHero(UUID)
*/
public Hero getHero(UUID uuid) {
return depends.getHero(uuid);
}
/**
* @deprecated Use Dependencies.testPrimaryHeroClass(String, UUID)
*/
public boolean testPrimaryHeroesClass(String primaryClass, UUID uuid) {
return depends.testPrimaryHeroesClass(primaryClass, uuid);
}
/**
* @deprecated Use Dependencies.testSecondaryHeroClass(String, UUID)
*/
public boolean testSecondaryHeroesClass(String secondaryClass, UUID uuid) {
return depends.testSecondaryHeroesClass(secondaryClass, uuid);
}
}

View File

@ -134,18 +134,6 @@ public class Settings {
public void setTopLimit(int topLimit) {
this.topLimit = topLimit;
}
/**
* @deprecated As of release 2.6.4, use {@link #canTranslateNames()}
*/
public boolean canTranslateItems() {
return translateNames;
}
/**
* @deprecated As of release 2.6.4, use {@link #setTranslateNames()}
*/
public void setTranslateItems(boolean translateItems) {
this.translateNames = translateItems;
}
public boolean canTranslateNames() {
return translateNames;
}

View File

@ -318,20 +318,6 @@ public class Stage {
this.killNames = killNames;
}
/**
* @deprecated use getKillNames()
*/
public LinkedList<String> getAreaNames() {
return killNames;
}
/**
* @deprecated use setKillNames()
*/
public void setAreaNames(LinkedList<String> killNames) {
this.killNames = killNames;
}
public LinkedList<Location> getLocationsToReach() {
return locationsToReach;
}

View File

@ -746,7 +746,6 @@ public class CmdExecutor implements CommandExecutor {
}
}
@SuppressWarnings("deprecation")
private void questsList(final CommandSender cs, String[] args) {
if (cs.hasPermission("quests.list")) {
if (!(cs instanceof Player)) {
@ -766,7 +765,7 @@ public class CmdExecutor implements CommandExecutor {
return;
}
plugin.listQuests(player, 1);
plugin.listQuests(quester, 1);
} else if (args.length == 2) {
int page = 1;
try {
@ -782,7 +781,7 @@ public class CmdExecutor implements CommandExecutor {
return;
}
plugin.listQuests(player, page);
plugin.listQuests(quester, page);
}
} catch (NumberFormatException e) {
cs.sendMessage(ChatColor.YELLOW + Lang.get("pageSelectionNum"));

View File

@ -37,6 +37,7 @@ import me.blackvein.quests.Quester;
import me.blackvein.quests.Quests;
import me.blackvein.quests.util.ItemUtil;
import me.blackvein.quests.util.Lang;
import me.blackvein.quests.util.MiscUtil;
import me.blackvein.quests.util.RomanNumeral;
import net.citizensnpcs.api.CitizensAPI;
import net.citizensnpcs.api.event.NPCDeathEvent;
@ -103,7 +104,7 @@ public class NpcListener implements Listener {
text += (hand.getItemMeta().hasDisplayName() ? ")" : "");
}
text += " x " + ChatColor.DARK_AQUA + hand.getAmount() + ChatColor.GRAY;
if (plugin.getSettings().canTranslateItems() && !hasMeta
if (plugin.getSettings().canTranslateNames() && !hasMeta
&& !hand.getItemMeta().hasDisplayName()) {
plugin.getLocaleQuery().sendMessage(player, Lang
.get(player, "questInvalidDeliveryItem").replace("<item>", text), hand
@ -252,7 +253,7 @@ public class NpcListener implements Listener {
String early = Lang.get(player, "questTooEarly");
early = early.replace("<quest>", ChatColor.AQUA + q.getName() + ChatColor.YELLOW);
early = early.replace("<time>", ChatColor.DARK_PURPLE
+ Quests.getTime(quester.getCooldownDifference(q)) + ChatColor.YELLOW);
+ MiscUtil.getTime(quester.getCooldownDifference(q)) + ChatColor.YELLOW);
player.sendMessage(ChatColor.YELLOW + early);
} else if (q.getPlanner().getCooldown() < 0) {
String completed = Lang.get(player, "questAlreadyCompleted");

View File

@ -353,7 +353,7 @@ public class PlayerListener implements Listener {
early = early.replace("<quest>", ChatColor.AQUA + q.getName()
+ ChatColor.YELLOW);
early = early.replace("<time>", ChatColor.DARK_PURPLE
+ Quests.getTime(quester.getCooldownDifference(q))
+ MiscUtil.getTime(quester.getCooldownDifference(q))
+ ChatColor.YELLOW);
player.sendMessage(ChatColor.YELLOW + early);
return;