mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-23 01:27:35 +01:00
Update WE/WG and Heroes dependencies, check UUIDs for Heroes players,
dust off deprecated methods
This commit is contained in:
parent
1aa81ef940
commit
e19082d89e
BIN
lib/Heroes.jar
BIN
lib/Heroes.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
10
pom.xml
10
pom.xml
@ -58,7 +58,7 @@
|
||||
<dependency>
|
||||
<groupId>com.herocraftonline</groupId>
|
||||
<artifactId>Heroes</artifactId>
|
||||
<version>1.5.5.3</version>
|
||||
<version>1.5.5.4</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/Heroes.jar</systemPath>
|
||||
</dependency>
|
||||
@ -72,16 +72,16 @@
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldedit</groupId>
|
||||
<artifactId>WorldEdit</artifactId>
|
||||
<version>5.6.2</version>
|
||||
<version>6.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/WorldEdit.jar</systemPath>
|
||||
<systemPath>${project.basedir}/lib/worldedit-bukkit-6.0-dist.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q.worldguard</groupId>
|
||||
<artifactId>WorldGuard</artifactId>
|
||||
<version>5.9</version>
|
||||
<version>6.0.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/lib/WorldGuard.jar</systemPath>
|
||||
<systemPath>${project.basedir}/lib/worldguard-6.0.0-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -229,7 +229,7 @@ public class Quest {
|
||||
|
||||
if (heroesPrimaryClassReq != null) {
|
||||
|
||||
if (plugin.testPrimaryHeroesClass(heroesPrimaryClassReq, player.getName()) == false) {
|
||||
if (plugin.testPrimaryHeroesClass(heroesPrimaryClassReq, player.getUniqueId()) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -237,7 +237,7 @@ public class Quest {
|
||||
|
||||
if (heroesSecondaryClassReq != null) {
|
||||
|
||||
if (plugin.testSecondaryHeroesClass(heroesSecondaryClassReq, player.getName()) == false) {
|
||||
if (plugin.testSecondaryHeroesClass(heroesSecondaryClassReq, player.getUniqueId()) == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -333,7 +333,7 @@ public class Quest {
|
||||
|
||||
for (String s : heroesClasses) {
|
||||
|
||||
Hero hero = plugin.getHero(player.getName());
|
||||
Hero hero = plugin.getHero(player.getUniqueId());
|
||||
hero.addExp(heroesAmounts.get(heroesClasses.indexOf(s)), Quests.heroes.getClassManager().getClass(s), player.getLocation());
|
||||
none = null;
|
||||
|
||||
@ -527,6 +527,7 @@ public class Quest {
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void failQuest(Quester q) {
|
||||
|
||||
Player player = plugin.getServer().getPlayer(q.id);
|
||||
|
@ -1252,6 +1252,7 @@ public class Quester {
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void deliverItem(Quest quest, ItemStack i) {
|
||||
|
||||
Player player = getPlayer();
|
||||
@ -1878,9 +1879,9 @@ public class Quester {
|
||||
return prettyString;
|
||||
}
|
||||
|
||||
public static String fullPotionString(short dv) {
|
||||
public static String fullPotionString(ItemStack is) {
|
||||
|
||||
Potion potion = Potion.fromDamage(dv);
|
||||
Potion potion = Potion.fromItemStack(is);
|
||||
String potionName = "";
|
||||
boolean isPrimary = false;
|
||||
|
||||
@ -1892,15 +1893,15 @@ public class Quester {
|
||||
|
||||
isPrimary = true;
|
||||
|
||||
if (dv == 0) {
|
||||
if (is.getDurability() == 0) {
|
||||
potionName = "Water Bottle";
|
||||
} else if (dv == 16) {
|
||||
} else if (is.getDurability() == 16) {
|
||||
potionName = "Awkward Potion";
|
||||
} else if (dv == 32) {
|
||||
} else if (is.getDurability() == 32) {
|
||||
potionName = "Thick Potion";
|
||||
} else if (dv == 64) {
|
||||
} else if (is.getDurability() == 64) {
|
||||
potionName = "Mundane Potion (Extended)";
|
||||
} else if (dv == 8192) {
|
||||
} else if (is.getDurability() == 8192) {
|
||||
potionName = "Mundane Potion";
|
||||
}
|
||||
|
||||
|
@ -77,6 +77,7 @@ import com.herocraftonline.heroes.characters.classes.HeroClass;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.reflect.Constructor;
|
||||
@ -91,6 +92,7 @@ import java.util.Enumeration;
|
||||
import java.util.UUID;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
@ -268,6 +270,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void defaultEventsFile() {
|
||||
if (new File(this.getDataFolder(), "events.yml").exists() == false) {
|
||||
printInfo("[Quests] Events data not found, writing defaults to file.");
|
||||
@ -285,6 +288,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void defaultQuestsFile() {
|
||||
if (new File(this.getDataFolder(), "quests.yml").exists() == false) {
|
||||
|
||||
@ -303,6 +307,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void defaultConfigFile() {
|
||||
if (new File(this.getDataFolder(), "config.yml").exists() == false) {
|
||||
printInfo("[Quests] Config not found, writing default to file.");
|
||||
@ -441,6 +446,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
vault = (Vault) getServer().getPluginManager().getPlugin("Vault");
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void onDisable() {
|
||||
|
||||
@ -890,6 +896,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void adminGivePoints(final CommandSender cs, String[] args) {
|
||||
if (cs.hasPermission("quests.admin.givepoints")) {
|
||||
|
||||
@ -945,6 +952,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void adminTakePoints(final CommandSender cs, String[] args) {
|
||||
|
||||
if (cs.hasPermission("quests.admin.takepoints")) {
|
||||
@ -1002,6 +1010,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void adminPoints(final CommandSender cs, String[] args) {
|
||||
if (cs.hasPermission("quests.admin.points")) {
|
||||
|
||||
@ -1058,6 +1067,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void adminGive(final CommandSender cs, String[] args) {
|
||||
|
||||
if (cs.hasPermission("quests.admin.give")) {
|
||||
@ -1263,6 +1273,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void adminFinish(final CommandSender cs, String[] args) {
|
||||
|
||||
if (cs.hasPermission("quests.admin.finish")) {
|
||||
@ -1323,6 +1334,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void adminSetStage(final CommandSender cs, String[] args) {
|
||||
if (cs.hasPermission("quests.admin.setstage")) {
|
||||
|
||||
@ -1403,6 +1415,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void adminNextStage(final CommandSender cs, String[] args) {
|
||||
|
||||
if (cs.hasPermission("quests.admin.nextstage")) {
|
||||
@ -1463,6 +1476,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void adminQuit(final CommandSender cs, String[] args) {
|
||||
|
||||
if (cs.hasPermission("quests.admin.quit")) {
|
||||
@ -2187,7 +2201,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
if (q.heroesPrimaryClassReq != null) {
|
||||
|
||||
if (this.testPrimaryHeroesClass(q.heroesPrimaryClassReq, player.getName())) {
|
||||
if (this.testPrimaryHeroesClass(q.heroesPrimaryClassReq, player.getUniqueId())) {
|
||||
cs.sendMessage(BOLD + "" + GREEN + q.heroesPrimaryClassReq + RESET + "" + DARKGREEN + " " + Lang.get("heroesClass"));
|
||||
} else {
|
||||
cs.sendMessage(BOLD + "" + DARKRED + q.heroesPrimaryClassReq + RESET + "" + RED + " " + Lang.get("heroesClass"));
|
||||
@ -2197,7 +2211,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
if (q.heroesSecondaryClassReq != null) {
|
||||
|
||||
if (this.testSecondaryHeroesClass(q.heroesSecondaryClassReq, player.getName())) {
|
||||
if (this.testSecondaryHeroesClass(q.heroesSecondaryClassReq, player.getUniqueId())) {
|
||||
cs.sendMessage(BOLD + "" + DARKRED + q.heroesSecondaryClassReq + RESET + "" + RED + " " + Lang.get("heroesClass"));
|
||||
} else {
|
||||
cs.sendMessage(BOLD + "" + GREEN + q.heroesSecondaryClassReq + RESET + "" + DARKGREEN + " " + Lang.get("heroesClass"));
|
||||
@ -2485,6 +2499,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public Map<UUID, Quester> getOnlineQuesters() {
|
||||
|
||||
Map<UUID, Quester> qs = new HashMap<UUID, Quester>();
|
||||
@ -3147,7 +3162,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
RegionManager rm = worldGuard.getRegionManager(world);
|
||||
if (rm != null) {
|
||||
ProtectedRegion pr = rm.getRegionExact(region);
|
||||
ProtectedRegion pr = rm.getRegion(region);
|
||||
if (pr != null) {
|
||||
quest.region = region;
|
||||
exists = true;
|
||||
@ -3178,19 +3193,19 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
LinkedList<Material> itemsToEnchant = new LinkedList<Material>();
|
||||
List<Integer> amountsToEnchant = new LinkedList<Integer>();
|
||||
|
||||
List<Integer> breakids = new LinkedList<Integer>();
|
||||
List<String> breaknames = new LinkedList<String>();
|
||||
List<Integer> breakamounts = new LinkedList<Integer>();
|
||||
|
||||
List<Integer> damageids = new LinkedList<Integer>();
|
||||
List<String> damagenames = new LinkedList<String>();
|
||||
List<Integer> damageamounts = new LinkedList<Integer>();
|
||||
|
||||
List<Integer> placeids = new LinkedList<Integer>();
|
||||
List<String> placenames = new LinkedList<String>();
|
||||
List<Integer> placeamounts = new LinkedList<Integer>();
|
||||
|
||||
List<Integer> useids = new LinkedList<Integer>();
|
||||
List<String> usenames = new LinkedList<String>();
|
||||
List<Integer> useamounts = new LinkedList<Integer>();
|
||||
|
||||
List<Integer> cutids = new LinkedList<Integer>();
|
||||
List<String> cutnames = new LinkedList<String>();
|
||||
List<Integer> cutamounts = new LinkedList<Integer>();
|
||||
|
||||
//Denizen script load
|
||||
@ -3205,13 +3220,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
if (config.contains("quests." + questName + ".stages.ordered." + s2 + ".break-block-ids")) {
|
||||
if (config.contains("quests." + questName + ".stages.ordered." + s2 + ".break-block-names")) {
|
||||
|
||||
if (checkList(config.getList("quests." + questName + ".stages.ordered." + s2 + ".break-block-ids"), Integer.class)) {
|
||||
breakids = config.getIntegerList("quests." + questName + ".stages.ordered." + s2 + ".break-block-ids");
|
||||
if (checkList(config.getList("quests." + questName + ".stages.ordered." + s2 + ".break-block-names"), Integer.class)) {
|
||||
breaknames = config.getStringList("quests." + questName + ".stages.ordered." + s2 + ".break-block-names");
|
||||
} else {
|
||||
stageFailed("[Quests] break-block-ids: in Stage " + s2 + " of Quest " + quest.name + " is not a list of numbers!");
|
||||
stageFailed("[Quests] break-block-names: in Stage " + s2 + " of Quest " + quest.name + " is not a list of numbers!");
|
||||
}
|
||||
|
||||
if (config.contains("quests." + questName + ".stages.ordered." + s2 + ".break-block-amounts")) {
|
||||
@ -3228,12 +3242,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
}
|
||||
|
||||
if (config.contains("quests." + questName + ".stages.ordered." + s2 + ".damage-block-ids")) {
|
||||
if (config.contains("quests." + questName + ".stages.ordered." + s2 + ".damage-block-names")) {
|
||||
|
||||
if (checkList(config.getList("quests." + questName + ".stages.ordered." + s2 + ".damage-block-ids"), Integer.class)) {
|
||||
damageids = config.getIntegerList("quests." + questName + ".stages.ordered." + s2 + ".damage-block-ids");
|
||||
if (checkList(config.getList("quests." + questName + ".stages.ordered." + s2 + ".damage-block-names"), Integer.class)) {
|
||||
damagenames = config.getStringList("quests." + questName + ".stages.ordered." + s2 + ".damage-block-names");
|
||||
} else {
|
||||
stageFailed("[Quests] damage-block-ids: in Stage " + s2 + " of Quest " + quest.name + " is not a list of numbers!");
|
||||
stageFailed("[Quests] damage-block-names: in Stage " + s2 + " of Quest " + quest.name + " is not a list of numbers!");
|
||||
}
|
||||
|
||||
if (config.contains("quests." + questName + ".stages.ordered." + s2 + ".damage-block-amounts")) {
|
||||
@ -3250,22 +3264,22 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
}
|
||||
|
||||
for (int i : damageids) {
|
||||
for (String s : damagenames) {
|
||||
|
||||
if (Material.getMaterial(i) != null) {
|
||||
oStage.blocksToDamage.put(Material.getMaterial(i), damageamounts.get(damageids.indexOf(i)));
|
||||
if (Material.matchMaterial(s) != null) {
|
||||
oStage.blocksToDamage.put(Material.matchMaterial(s), damageamounts.get(damagenames.indexOf(s)));
|
||||
} else {
|
||||
stageFailed("[Quests] " + i + " inside damage-block-ids: inside Stage " + s2 + " of Quest " + quest.name + " is not a valid item ID!");
|
||||
stageFailed("[Quests] " + s + " inside damage-block-names: inside Stage " + s2 + " of Quest " + quest.name + " is not a valid item name!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (config.contains("quests." + questName + ".stages.ordered." + s2 + ".place-block-ids")) {
|
||||
if (config.contains("quests." + questName + ".stages.ordered." + s2 + ".place-block-names")) {
|
||||
|
||||
if (checkList(config.getList("quests." + questName + ".stages.ordered." + s2 + ".place-block-ids"), Integer.class)) {
|
||||
placeids = config.getIntegerList("quests." + questName + ".stages.ordered." + s2 + ".place-block-ids");
|
||||
if (checkList(config.getList("quests." + questName + ".stages.ordered." + s2 + ".place-block-names"), Integer.class)) {
|
||||
placenames = config.getStringList("quests." + questName + ".stages.ordered." + s2 + ".place-block-names");
|
||||
} else {
|
||||
stageFailed("[Quests] place-block-ids: in Stage " + s2 + " of Quest " + quest.name + " is not a list of numbers!");
|
||||
stageFailed("[Quests] place-block-names: in Stage " + s2 + " of Quest " + quest.name + " is not a list of numbers!");
|
||||
}
|
||||
|
||||
if (config.contains("quests." + questName + ".stages.ordered." + s2 + ".place-block-amounts")) {
|
||||
@ -3282,22 +3296,22 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
}
|
||||
|
||||
for (int i : placeids) {
|
||||
for (String s : placenames) {
|
||||
|
||||
if (Material.getMaterial(i) != null) {
|
||||
oStage.blocksToPlace.put(Material.getMaterial(i), placeamounts.get(placeids.indexOf(i)));
|
||||
if (Material.matchMaterial(s) != null) {
|
||||
oStage.blocksToPlace.put(Material.matchMaterial(s), placeamounts.get(placenames.indexOf(s)));
|
||||
} else {
|
||||
stageFailed("[Quests] " + +i + " inside place-block-ids: inside Stage " + s2 + " of Quest " + quest.name + " is not a valid item ID!");
|
||||
stageFailed("[Quests] " + s + " inside place-block-names: inside Stage " + s2 + " of Quest " + quest.name + " is not a valid item name!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (config.contains("quests." + questName + ".stages.ordered." + s2 + ".use-block-ids")) {
|
||||
if (config.contains("quests." + questName + ".stages.ordered." + s2 + ".use-block-names")) {
|
||||
|
||||
if (checkList(config.getList("quests." + questName + ".stages.ordered." + s2 + ".use-block-ids"), Integer.class)) {
|
||||
useids = config.getIntegerList("quests." + questName + ".stages.ordered." + s2 + ".use-block-ids");
|
||||
if (checkList(config.getList("quests." + questName + ".stages.ordered." + s2 + ".use-block-names"), Integer.class)) {
|
||||
usenames = config.getStringList("quests." + questName + ".stages.ordered." + s2 + ".use-block-names");
|
||||
} else {
|
||||
stageFailed("[Quests] use-block-ids: in Stage " + s2 + " of Quest " + quest.name + " is not a list of numbers!");
|
||||
stageFailed("[Quests] use-block-names: in Stage " + s2 + " of Quest " + quest.name + " is not a list of numbers!");
|
||||
}
|
||||
|
||||
if (config.contains("quests." + questName + ".stages.ordered." + s2 + ".use-block-amounts")) {
|
||||
@ -3314,22 +3328,22 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
}
|
||||
|
||||
for (int i : useids) {
|
||||
for (String s : usenames) {
|
||||
|
||||
if (Material.getMaterial(i) != null) {
|
||||
oStage.blocksToUse.put(Material.getMaterial(i), useamounts.get(useids.indexOf(i)));
|
||||
if (Material.matchMaterial(s) != null) {
|
||||
oStage.blocksToUse.put(Material.matchMaterial(s), useamounts.get(usenames.indexOf(s)));
|
||||
} else {
|
||||
stageFailed("[Quests] " + RED + i + " inside use-block-ids: inside Stage " + s2 + " of Quest " + quest.name + " is not a valid item ID!");
|
||||
stageFailed("[Quests] " + RED + s + " inside use-block-names: inside Stage " + s2 + " of Quest " + quest.name + " is not a valid item name!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (config.contains("quests." + questName + ".stages.ordered." + s2 + ".cut-block-ids")) {
|
||||
if (config.contains("quests." + questName + ".stages.ordered." + s2 + ".cut-block-names")) {
|
||||
|
||||
if (checkList(config.getList("quests." + questName + ".stages.ordered." + s2 + ".cut-block-ids"), Integer.class)) {
|
||||
cutids = config.getIntegerList("quests." + questName + ".stages.ordered." + s2 + ".cut-block-ids");
|
||||
if (checkList(config.getList("quests." + questName + ".stages.ordered." + s2 + ".cut-block-names"), Integer.class)) {
|
||||
cutnames = config.getStringList("quests." + questName + ".stages.ordered." + s2 + ".cut-block-names");
|
||||
} else {
|
||||
stageFailed("[Quests] cut-block-ids: in Stage " + s2 + " of Quest " + quest.name + " is not a list of numbers!");
|
||||
stageFailed("[Quests] cut-block-names: in Stage " + s2 + " of Quest " + quest.name + " is not a list of numbers!");
|
||||
}
|
||||
|
||||
if (config.contains("quests." + questName + ".stages.ordered." + s2 + ".cut-block-amounts")) {
|
||||
@ -3346,12 +3360,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
}
|
||||
|
||||
for (int i : cutids) {
|
||||
for (String s : cutnames) {
|
||||
|
||||
if (Material.getMaterial(i) != null) {
|
||||
oStage.blocksToCut.put(Material.getMaterial(i), cutamounts.get(cutids.indexOf(i)));
|
||||
if (Material.matchMaterial(s) != null) {
|
||||
oStage.blocksToCut.put(Material.matchMaterial(s), cutamounts.get(cutnames.indexOf(s)));
|
||||
} else {
|
||||
stageFailed("[Quests] " + i + " inside cut-block-ids: inside Stage " + s2 + " of Quest " + quest.name + " is not a valid item ID!");
|
||||
stageFailed("[Quests] " + s + " inside cut-block-names: inside Stage " + s2 + " of Quest " + quest.name + " is not a valid item name!");
|
||||
}
|
||||
|
||||
}
|
||||
@ -3404,12 +3418,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
if (Quests.checkList(config.getList("quests." + questName + ".stages.ordered." + s2 + ".enchantment-item-ids"), Integer.class)) {
|
||||
|
||||
for (int item : config.getIntegerList("quests." + questName + ".stages.ordered." + s2 + ".enchantment-item-ids")) {
|
||||
for (String item : config.getStringList("quests." + questName + ".stages.ordered." + s2 + ".enchantment-item-ids")) {
|
||||
|
||||
if (Material.getMaterial(item) != null) {
|
||||
itemsToEnchant.add(Material.getMaterial(item));
|
||||
if (Material.matchMaterial(item) != null) {
|
||||
itemsToEnchant.add(Material.matchMaterial(item));
|
||||
} else {
|
||||
stageFailed("[Quests] " + item + " inside enchantment-item-ids: inside Stage " + s2 + " of Quest " + quest.name + " is not a valid item id!");
|
||||
stageFailed("[Quests] " + item + " inside enchantment-item-ids: inside Stage " + s2 + " of Quest " + quest.name + " is not a valid item name!");
|
||||
}
|
||||
|
||||
}
|
||||
@ -3722,9 +3736,9 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
Map<Material, Integer> breakMap = new EnumMap<Material, Integer>(Material.class);
|
||||
|
||||
for (int i : breakids) {
|
||||
for (String s : breaknames) {
|
||||
|
||||
breakMap.put(Material.getMaterial(i), breakamounts.get(breakids.indexOf(i)));
|
||||
breakMap.put(Material.matchMaterial(s), breakamounts.get(breaknames.indexOf(s)));
|
||||
|
||||
}
|
||||
|
||||
@ -4697,9 +4711,8 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
public static boolean removeItem(Inventory inventory, ItemStack is) {
|
||||
|
||||
int type = is.getTypeId();
|
||||
int amount = is.getAmount();
|
||||
HashMap<Integer, ? extends ItemStack> allItems = inventory.all(type);
|
||||
HashMap<Integer, ? extends ItemStack> allItems = inventory.all(is);
|
||||
HashMap<Integer, Integer> removeFrom = new HashMap<Integer, Integer>();
|
||||
int foundAmount = 0;
|
||||
for (Map.Entry<Integer, ? extends ItemStack> item : allItems.entrySet()) {
|
||||
@ -5177,9 +5190,9 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
}
|
||||
|
||||
public Hero getHero(String player) {
|
||||
public Hero getHero(UUID uuid) {
|
||||
|
||||
Player p = getServer().getPlayer(player);
|
||||
Player p = getServer().getPlayer(uuid);
|
||||
if (p == null) {
|
||||
return null;
|
||||
}
|
||||
@ -5188,16 +5201,16 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
}
|
||||
|
||||
public boolean testPrimaryHeroesClass(String primaryClass, String player) {
|
||||
public boolean testPrimaryHeroesClass(String primaryClass, UUID uuid) {
|
||||
|
||||
Hero hero = getHero(player);
|
||||
Hero hero = getHero(uuid);
|
||||
return hero.getHeroClass().getName().equalsIgnoreCase(primaryClass);
|
||||
|
||||
}
|
||||
|
||||
public boolean testSecondaryHeroesClass(String secondaryClass, String player) {
|
||||
public boolean testSecondaryHeroesClass(String secondaryClass, UUID uuid) {
|
||||
|
||||
Hero hero = getHero(player);
|
||||
Hero hero = getHero(uuid);
|
||||
return hero.getHeroClass().getName().equalsIgnoreCase(secondaryClass);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user