mirror of
https://github.com/PikaMug/Quests.git
synced 2024-09-29 15:37:27 +02: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>
|
<groupId>me.blackvein.quests</groupId>
|
||||||
<artifactId>quests</artifactId>
|
<artifactId>quests</artifactId>
|
||||||
<version>2.10.0</version>
|
<version>2.9.8</version>
|
||||||
<name>quests</name>
|
<name>quests</name>
|
||||||
<url>https://github.com/FlyingPikachu/Quests/</url>
|
<url>https://github.com/FlyingPikachu/Quests/</url>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
@ -679,6 +679,7 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
if (isPlayer) {
|
if (isPlayer) {
|
||||||
Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||||
|
if (quester != null) {
|
||||||
for (Quest quest : quester.currentQuests.keySet()) {
|
for (Quest quest : quester.currentQuests.keySet()) {
|
||||||
if (quester.hasObjective(quest, "reachLocation")) {
|
if (quester.hasObjective(quest, "reachLocation")) {
|
||||||
quester.reachLocation(quest, evt.getTo());
|
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);
|
finishedObjectives.add(ChatColor.GRAY + Lang.get("killPlayer") + ChatColor.GRAY + ": " + getQuestData(quest).getPlayersKilled() + "/" + getCurrentStage(quest).playersToKill);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
int index2 = 0;
|
||||||
for (ItemStack is : getCurrentStage(quest).itemsToDeliver) {
|
for (ItemStack is : getCurrentStage(quest).itemsToDeliver) {
|
||||||
int delivered = getQuestData(quest).itemsDelivered.get(is);
|
int delivered = getQuestData(quest).itemsDelivered.get(is);
|
||||||
int amt = is.getAmount();
|
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) {
|
if (delivered < amt) {
|
||||||
String obj = Lang.get("deliver");
|
String obj = Lang.get("deliver");
|
||||||
obj = obj.replaceAll("<item>", ItemUtil.getName(is));
|
obj = obj.replaceAll("<item>", ItemUtil.getName(is));
|
||||||
@ -2204,18 +2206,18 @@ public class Quester {
|
|||||||
|
|
||||||
public static ConfigurationSection getLegacyQuestData(FileConfiguration questSec, String questName) {
|
public static ConfigurationSection getLegacyQuestData(FileConfiguration questSec, String questName) {
|
||||||
ConfigurationSection newData = questSec.createSection("questData");
|
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")) {
|
if (questSec.contains("blocks-broken-names")) {
|
||||||
List<String> names = questSec.getStringList("blocks-broken-names");
|
List<String> names = questSec.getStringList("blocks-broken-names");
|
||||||
List<Integer> amounts = questSec.getIntegerList("blocks-broken-amounts");
|
List<Integer> amounts = questSec.getIntegerList("blocks-broken-amounts");
|
||||||
newData.set(questName + ".blocks-broken-names", names);
|
newData.set(questName + ".blocks-broken-names", names);
|
||||||
newData.set(questName + ".blocks-broken-amounts", amounts);
|
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")) {
|
if (questSec.contains("blocks-placed-names")) {
|
||||||
List<String> names = questSec.getStringList("blocks-placed-names");
|
List<String> names = questSec.getStringList("blocks-placed-names");
|
||||||
List<Integer> amounts = questSec.getIntegerList("blocks-placed-amounts");
|
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("quests") + " " + this.getDescription().getVersion());
|
||||||
cs.sendMessage(ChatColor.GOLD + Lang.get("createdBy") + " " + ChatColor.DARK_RED + "Blackvein"
|
cs.sendMessage(ChatColor.GOLD + Lang.get("createdBy") + " " + ChatColor.DARK_RED + "Blackvein"
|
||||||
+ ChatColor.GOLD + " " + Lang.get("continuedBy") + " " + ChatColor.DARK_RED + "FlyingPikachu");
|
+ 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1936,7 +1936,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
}
|
}
|
||||||
if (quester == null) {
|
if (quester == null) {
|
||||||
if (!questerBlacklist.contains(id.toString())) {
|
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 = new Quester(this);
|
||||||
quester.id = id;
|
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");
|
itemsToDeliver = config.getStringList("quests." + questName + ".stages.ordered." + s2 + ".items-to-deliver");
|
||||||
itemDeliveryTargetIds = config.getIntegerList("quests." + questName + ".stages.ordered." + s2 + ".npc-delivery-ids");
|
itemDeliveryTargetIds = config.getIntegerList("quests." + questName + ".stages.ordered." + s2 + ".npc-delivery-ids");
|
||||||
deliveryMessages.addAll(config.getStringList("quests." + questName + ".stages.ordered." + s2 + ".delivery-messages"));
|
deliveryMessages.addAll(config.getStringList("quests." + questName + ".stages.ordered." + s2 + ".delivery-messages"));
|
||||||
|
int index = 0;
|
||||||
for (String item : itemsToDeliver) {
|
for (String item : itemsToDeliver) {
|
||||||
ItemStack is = ItemUtil.readItemStack("" + item);
|
ItemStack is = ItemUtil.readItemStack("" + item);
|
||||||
|
int npcId = itemDeliveryTargetIds.get(index);
|
||||||
|
index++;
|
||||||
if (is != null) {
|
if (is != null) {
|
||||||
int npcId = itemDeliveryTargetIds.get(itemsToDeliver.indexOf(item));
|
|
||||||
NPC npc = CitizensAPI.getNPCRegistry().getById(npcId);
|
NPC npc = CitizensAPI.getNPCRegistry().getById(npcId);
|
||||||
if (npc != null) {
|
if (npc != null) {
|
||||||
oStage.itemsToDeliver.add(is);
|
oStage.itemsToDeliver.add(is);
|
||||||
|
@ -717,7 +717,7 @@ public class CreateStagePrompt extends FixedSetPrompt {
|
|||||||
if (Integer.parseInt(s) > 0) {
|
if (Integer.parseInt(s) > 0) {
|
||||||
amounts.add(Integer.parseInt(s));
|
amounts.add(Integer.parseInt(s));
|
||||||
} else {
|
} 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();
|
return new BreakBlockAmountsPrompt();
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
@ -745,10 +745,10 @@ public class CreateStagePrompt extends FixedSetPrompt {
|
|||||||
LinkedList<Short> durability = new LinkedList<Short>();
|
LinkedList<Short> durability = new LinkedList<Short>();
|
||||||
for (String s : args) {
|
for (String s : args) {
|
||||||
try {
|
try {
|
||||||
if (Short.parseShort(s) > 0) {
|
if (Short.parseShort(s) >= 0) {
|
||||||
durability.add(Short.parseShort(s));
|
durability.add(Short.parseShort(s));
|
||||||
} else {
|
} 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();
|
return new BreakBlockDurabilityPrompt();
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
@ -962,10 +962,10 @@ public class CreateStagePrompt extends FixedSetPrompt {
|
|||||||
LinkedList<Short> durability = new LinkedList<Short>();
|
LinkedList<Short> durability = new LinkedList<Short>();
|
||||||
for (String s : args) {
|
for (String s : args) {
|
||||||
try {
|
try {
|
||||||
if (Short.parseShort(s) > 0) {
|
if (Short.parseShort(s) >= 0) {
|
||||||
durability.add(Short.parseShort(s));
|
durability.add(Short.parseShort(s));
|
||||||
} else {
|
} 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();
|
return new DamageBlockDurabilityPrompt();
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
@ -1179,10 +1179,10 @@ public class CreateStagePrompt extends FixedSetPrompt {
|
|||||||
LinkedList<Short> durability = new LinkedList<Short>();
|
LinkedList<Short> durability = new LinkedList<Short>();
|
||||||
for (String s : args) {
|
for (String s : args) {
|
||||||
try {
|
try {
|
||||||
if (Short.parseShort(s) > 0) {
|
if (Short.parseShort(s) >= 0) {
|
||||||
durability.add(Short.parseShort(s));
|
durability.add(Short.parseShort(s));
|
||||||
} else {
|
} 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();
|
return new PlaceBlockDurabilityPrompt();
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
@ -1396,10 +1396,10 @@ public class CreateStagePrompt extends FixedSetPrompt {
|
|||||||
LinkedList<Short> durability = new LinkedList<Short>();
|
LinkedList<Short> durability = new LinkedList<Short>();
|
||||||
for (String s : args) {
|
for (String s : args) {
|
||||||
try {
|
try {
|
||||||
if (Short.parseShort(s) > 0) {
|
if (Short.parseShort(s) >= 0) {
|
||||||
durability.add(Short.parseShort(s));
|
durability.add(Short.parseShort(s));
|
||||||
} else {
|
} 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();
|
return new UseBlockDurabilityPrompt();
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
@ -1613,10 +1613,10 @@ public class CreateStagePrompt extends FixedSetPrompt {
|
|||||||
LinkedList<Short> durability = new LinkedList<Short>();
|
LinkedList<Short> durability = new LinkedList<Short>();
|
||||||
for (String s : args) {
|
for (String s : args) {
|
||||||
try {
|
try {
|
||||||
if (Short.parseShort(s) > 0) {
|
if (Short.parseShort(s) >= 0) {
|
||||||
durability.add(Short.parseShort(s));
|
durability.add(Short.parseShort(s));
|
||||||
} else {
|
} 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();
|
return new CutBlockDurabilityPrompt();
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user