mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-29 14:16:09 +01:00
Merge branch 'master' into master
This commit is contained in:
commit
47e1dbd74e
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
||||
|
||||
<groupId>me.blackvein.quests</groupId>
|
||||
<artifactId>quests</artifactId>
|
||||
<version>2.10.0</version>
|
||||
<version>2.9.8</version>
|
||||
<name>quests</name>
|
||||
<url>https://github.com/FlyingPikachu/Quests/</url>
|
||||
<packaging>jar</packaging>
|
||||
|
@ -679,6 +679,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
if (isPlayer) {
|
||||
Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||
if (quester != null) {
|
||||
for (Quest quest : quester.currentQuests.keySet()) {
|
||||
if (quester.hasObjective(quest, "reachLocation")) {
|
||||
quester.reachLocation(quest, evt.getTo());
|
||||
@ -687,4 +688,5 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -496,10 +496,12 @@ public class Quester {
|
||||
finishedObjectives.add(ChatColor.GRAY + Lang.get("killPlayer") + ChatColor.GRAY + ": " + getQuestData(quest).getPlayersKilled() + "/" + getCurrentStage(quest).playersToKill);
|
||||
}
|
||||
}
|
||||
int index2 = 0;
|
||||
for (ItemStack is : getCurrentStage(quest).itemsToDeliver) {
|
||||
int delivered = getQuestData(quest).itemsDelivered.get(is);
|
||||
int amt = is.getAmount();
|
||||
Integer npc = getCurrentStage(quest).itemDeliveryTargets.get(getCurrentStage(quest).itemsToDeliver.indexOf(is));
|
||||
Integer npc = getCurrentStage(quest).itemDeliveryTargets.get(index2);
|
||||
index2++;
|
||||
if (delivered < amt) {
|
||||
String obj = Lang.get("deliver");
|
||||
obj = obj.replaceAll("<item>", ItemUtil.getName(is));
|
||||
@ -2204,18 +2206,18 @@ public class Quester {
|
||||
|
||||
public static ConfigurationSection getLegacyQuestData(FileConfiguration questSec, String questName) {
|
||||
ConfigurationSection newData = questSec.createSection("questData");
|
||||
if (questSec.contains("blocks-damaged-names")) {
|
||||
List<String> names = questSec.getStringList("blocks-damaged-names");
|
||||
List<Integer> amounts = questSec.getIntegerList("blocks-damaged-amounts");
|
||||
newData.set(questName + ".blocks-damaged-names", names);
|
||||
newData.set(questName + ".blocks-damaged-amounts", amounts);
|
||||
}
|
||||
if (questSec.contains("blocks-broken-names")) {
|
||||
List<String> names = questSec.getStringList("blocks-broken-names");
|
||||
List<Integer> amounts = questSec.getIntegerList("blocks-broken-amounts");
|
||||
newData.set(questName + ".blocks-broken-names", names);
|
||||
newData.set(questName + ".blocks-broken-amounts", amounts);
|
||||
}
|
||||
if (questSec.contains("blocks-damaged-names")) {
|
||||
List<String> names = questSec.getStringList("blocks-damaged-names");
|
||||
List<Integer> amounts = questSec.getIntegerList("blocks-damaged-amounts");
|
||||
newData.set(questName + ".blocks-damaged-names", names);
|
||||
newData.set(questName + ".blocks-damaged-amounts", amounts);
|
||||
}
|
||||
if (questSec.contains("blocks-placed-names")) {
|
||||
List<String> names = questSec.getStringList("blocks-placed-names");
|
||||
List<Integer> amounts = questSec.getIntegerList("blocks-placed-amounts");
|
||||
|
@ -1275,7 +1275,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
cs.sendMessage(ChatColor.GOLD + Lang.get("quests") + " " + this.getDescription().getVersion());
|
||||
cs.sendMessage(ChatColor.GOLD + Lang.get("createdBy") + " " + ChatColor.DARK_RED + "Blackvein"
|
||||
+ ChatColor.GOLD + " " + Lang.get("continuedBy") + " " + ChatColor.DARK_RED + "FlyingPikachu");
|
||||
cs.sendMessage(ChatColor.AQUA + "" + ChatColor.UNDERLINE + "https://www.spigotmc.org/resources/quests.3711/");
|
||||
cs.sendMessage(ChatColor.DARK_AQUA + "" + ChatColor.UNDERLINE + "https://www.spigotmc.org/resources/quests.3711/");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1936,7 +1936,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
}
|
||||
if (quester == null) {
|
||||
if (!questerBlacklist.contains(id.toString())) {
|
||||
getLogger().log(Level.WARNING, "Quester data for UUID \"" + id.toString() + "\" not stored. Attempting manual data retrieval..");
|
||||
getLogger().log(Level.WARNING, "Quester data for UUID \"" + id.toString() + "\" not stored. Attempting manual data retrieval...");
|
||||
}
|
||||
quester = new Quester(this);
|
||||
quester.id = id;
|
||||
@ -2780,10 +2780,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
itemsToDeliver = config.getStringList("quests." + questName + ".stages.ordered." + s2 + ".items-to-deliver");
|
||||
itemDeliveryTargetIds = config.getIntegerList("quests." + questName + ".stages.ordered." + s2 + ".npc-delivery-ids");
|
||||
deliveryMessages.addAll(config.getStringList("quests." + questName + ".stages.ordered." + s2 + ".delivery-messages"));
|
||||
int index = 0;
|
||||
for (String item : itemsToDeliver) {
|
||||
ItemStack is = ItemUtil.readItemStack("" + item);
|
||||
int npcId = itemDeliveryTargetIds.get(index);
|
||||
index++;
|
||||
if (is != null) {
|
||||
int npcId = itemDeliveryTargetIds.get(itemsToDeliver.indexOf(item));
|
||||
NPC npc = CitizensAPI.getNPCRegistry().getById(npcId);
|
||||
if (npc != null) {
|
||||
oStage.itemsToDeliver.add(is);
|
||||
|
@ -717,7 +717,7 @@ public class CreateStagePrompt extends FixedSetPrompt {
|
||||
if (Integer.parseInt(s) > 0) {
|
||||
amounts.add(Integer.parseInt(s));
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditortNotGreaterThanZero"));
|
||||
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditorNotGreaterThanZero"));
|
||||
return new BreakBlockAmountsPrompt();
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
@ -745,10 +745,10 @@ public class CreateStagePrompt extends FixedSetPrompt {
|
||||
LinkedList<Short> durability = new LinkedList<Short>();
|
||||
for (String s : args) {
|
||||
try {
|
||||
if (Short.parseShort(s) > 0) {
|
||||
if (Short.parseShort(s) >= 0) {
|
||||
durability.add(Short.parseShort(s));
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditortNotGreaterThanZero"));
|
||||
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditorNotGreaterThanZero"));
|
||||
return new BreakBlockDurabilityPrompt();
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
@ -962,10 +962,10 @@ public class CreateStagePrompt extends FixedSetPrompt {
|
||||
LinkedList<Short> durability = new LinkedList<Short>();
|
||||
for (String s : args) {
|
||||
try {
|
||||
if (Short.parseShort(s) > 0) {
|
||||
if (Short.parseShort(s) >= 0) {
|
||||
durability.add(Short.parseShort(s));
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditortNotGreaterThanZero"));
|
||||
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditorNotGreaterThanZero"));
|
||||
return new DamageBlockDurabilityPrompt();
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
@ -1179,10 +1179,10 @@ public class CreateStagePrompt extends FixedSetPrompt {
|
||||
LinkedList<Short> durability = new LinkedList<Short>();
|
||||
for (String s : args) {
|
||||
try {
|
||||
if (Short.parseShort(s) > 0) {
|
||||
if (Short.parseShort(s) >= 0) {
|
||||
durability.add(Short.parseShort(s));
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditortNotGreaterThanZero"));
|
||||
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditorNotGreaterThanZero"));
|
||||
return new PlaceBlockDurabilityPrompt();
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
@ -1396,10 +1396,10 @@ public class CreateStagePrompt extends FixedSetPrompt {
|
||||
LinkedList<Short> durability = new LinkedList<Short>();
|
||||
for (String s : args) {
|
||||
try {
|
||||
if (Short.parseShort(s) > 0) {
|
||||
if (Short.parseShort(s) >= 0) {
|
||||
durability.add(Short.parseShort(s));
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditortNotGreaterThanZero"));
|
||||
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditorNotGreaterThanZero"));
|
||||
return new UseBlockDurabilityPrompt();
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
@ -1613,10 +1613,10 @@ public class CreateStagePrompt extends FixedSetPrompt {
|
||||
LinkedList<Short> durability = new LinkedList<Short>();
|
||||
for (String s : args) {
|
||||
try {
|
||||
if (Short.parseShort(s) > 0) {
|
||||
if (Short.parseShort(s) >= 0) {
|
||||
durability.add(Short.parseShort(s));
|
||||
} else {
|
||||
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditortNotGreaterThanZero"));
|
||||
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditorNotGreaterThanZero"));
|
||||
return new CutBlockDurabilityPrompt();
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user