Track NPCs by UUID instead. Bump version

This commit is contained in:
PikaMug 2022-04-17 19:28:23 -04:00
parent b7282cbada
commit c593c210a3
24 changed files with 950 additions and 750 deletions

View File

@ -5,7 +5,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>4.3.1</version>
<version>4.4.0</version>
</parent>
<artifactId>quests-api</artifactId>

View File

@ -513,7 +513,7 @@ public class QuestData {
}
};
public LinkedList<Boolean> citizensInteracted = new LinkedList<Boolean>() {
public LinkedList<Boolean> npcsInteracted = new LinkedList<Boolean>() {
private static final long serialVersionUID = 2447610341508300847L;
@ -580,7 +580,7 @@ public class QuestData {
}
};
public LinkedList<Integer> citizensNumKilled = new LinkedList<Integer>() {
public LinkedList<Integer> npcsNumKilled = new LinkedList<Integer>() {
private static final long serialVersionUID = 1849192351499071688L;
@ -1180,23 +1180,23 @@ public class QuestData {
}
}
public LinkedList<Boolean> getCitizensInteracted() {
return citizensInteracted;
public LinkedList<Boolean> getNpcsInteracted() {
return npcsInteracted;
}
public void setCitizensInteracted(final LinkedList<Boolean> citizensInteracted) {
this.citizensInteracted = citizensInteracted;
public void setNpcsInteracted(final LinkedList<Boolean> npcsInteracted) {
this.npcsInteracted = npcsInteracted;
if (doJournalUpdate) {
quester.updateJournal();
}
}
public LinkedList<Integer> getCitizensNumKilled() {
return citizensNumKilled;
public LinkedList<Integer> getNpcsNumKilled() {
return npcsNumKilled;
}
public void setCitizensNumKilled(final LinkedList<Integer> citizensNumKilled) {
this.citizensNumKilled = citizensNumKilled;
public void setNpcsNumKilled(final LinkedList<Integer> npcsNumKilled) {
this.npcsNumKilled = npcsNumKilled;
if (doJournalUpdate) {
quester.updateJournal();
}

View File

@ -71,6 +71,8 @@ public interface IDependencies {
String getNPCName(final int id);
String getNPCName(final UUID uuid);
int getMcmmoSkillLevel(final SkillType st, final String player);
Hero getHero(final UUID uuid);

View File

@ -24,6 +24,7 @@ import org.bukkit.inventory.ItemStack;
import java.util.LinkedList;
import java.util.Map;
import java.util.UUID;
public interface IStage {
LinkedList<ItemStack> getBlocksToBreak();
@ -92,11 +93,11 @@ public interface IStage {
void setItemsToDeliver(final LinkedList<ItemStack> itemsToDeliver);
LinkedList<Integer> getItemDeliveryTargets();
LinkedList<UUID> getItemDeliveryTargets();
boolean addItemDeliveryTarget(Integer itemDeliveryTarget);
boolean addItemDeliveryTarget(UUID itemDeliveryTarget);
void setItemDeliveryTargets(final LinkedList<Integer> itemDeliveryTargets);
void setItemDeliveryTargets(final LinkedList<UUID> itemDeliveryTargets);
LinkedList<String> getDeliverMessages();
@ -104,23 +105,23 @@ public interface IStage {
void setDeliverMessages(final LinkedList<String> deliverMessages);
LinkedList<Integer> getCitizensToInteract();
LinkedList<UUID> getNpcsToInteract();
boolean addCitizenToInteract(Integer citizenToInteract);
boolean addNpcToInteract(UUID npcToInteract);
void setCitizensToInteract(final LinkedList<Integer> citizensToInteract);
void setNpcsToInteract(final LinkedList<UUID> npcsToInteract);
LinkedList<Integer> getCitizensToKill();
LinkedList<UUID> getNpcsToKill();
boolean addCitizenToKill(Integer citizenToKill);
boolean addNpcToKill(UUID citizenToKill);
void setCitizensToKill(final LinkedList<Integer> citizensToKill);
void setNpcsToKill(final LinkedList<UUID> npcsToKill);
LinkedList<Integer> getCitizenNumToKill();
LinkedList<Integer> getNpcNumToKill();
boolean addCitizenNumToKill(Integer citizenNumToKill);
boolean addNpcNumToKill(Integer npcNumToKill);
void setCitizenNumToKill(final LinkedList<Integer> citizenNumToKill);
void setNpcNumToKill(final LinkedList<Integer> npcNumToKill);
LinkedList<EntityType> getMobsToKill();

View File

@ -5,7 +5,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>4.3.1</version>
<version>4.4.0</version>
</parent>
<artifactId>quests-core</artifactId>

View File

@ -272,14 +272,28 @@ public class Dependencies implements IDependencies {
return plugin.getDenizenTrigger().runDenizenScript(scriptName, quester);
}
/**
* @deprecated Use {@link #getNPCLocation(UUID)}
*/
public Location getNPCLocation(final int id) {
return citizens.getNPCRegistry().getById(id).getStoredLocation();
}
public Location getNPCLocation(final UUID uuid) {
return citizens.getNPCRegistry().getByUniqueId(uuid).getStoredLocation();
}
/**
* @deprecated Use {@link #getNPCName(UUID)}
*/
public String getNPCName(final int id) {
return citizens.getNPCRegistry().getById(id).getName();
}
public String getNPCName(final UUID uuid) {
return citizens.getNPCRegistry().getByUniqueId(uuid).getName();
}
public int getMcmmoSkillLevel(final SkillType st, final String player) {
final McMMOPlayer mPlayer = UserManager.getPlayer(player);
if (mPlayer == null) {

View File

@ -449,14 +449,14 @@ public class Quest implements IQuest {
final IQuest quest = this;
Bukkit.getScheduler().runTask(plugin, () -> {
Location targetLocation = null;
if (stage.getCitizensToInteract() != null && stage.getCitizensToInteract().size() > 0) {
targetLocation = plugin.getDependencies().getNPCLocation(stage.getCitizensToInteract().getFirst());
} else if (stage.getCitizensToKill() != null && stage.getCitizensToKill().size() > 0) {
targetLocation = plugin.getDependencies().getNPCLocation(stage.getCitizensToKill().getFirst());
if (stage.getNpcsToInteract() != null && stage.getNpcsToInteract().size() > 0) {
targetLocation = plugin.getDependencies().getNPCLocation(stage.getNpcsToInteract().getFirst());
} else if (stage.getNpcsToKill() != null && stage.getNpcsToKill().size() > 0) {
targetLocation = plugin.getDependencies().getNPCLocation(stage.getNpcsToKill().getFirst());
} else if (stage.getLocationsToReach() != null && stage.getLocationsToReach().size() > 0) {
targetLocation = stage.getLocationsToReach().getFirst();
} else if (stage.getItemDeliveryTargets() != null && stage.getItemDeliveryTargets().size() > 0) {
final NPC npc = plugin.getDependencies().getCitizens().getNPCRegistry().getById(stage
final NPC npc = plugin.getDependencies().getCitizens().getNPCRegistry().getByUniqueId(stage
.getItemDeliveryTargets().getFirst());
targetLocation = npc.getStoredLocation();
} else if (stage.getPlayersToKill() != null && stage.getPlayersToKill() > 0) {

View File

@ -1341,7 +1341,7 @@ public class Quester implements IQuester {
delivered = data.itemsDelivered.get(deliverIndex).getAmount();
}
final int toDeliver = is.getAmount();
final Integer npc = stage.getItemDeliveryTargets().get(deliverIndex);
final UUID npc = stage.getItemDeliveryTargets().get(deliverIndex);
final ChatColor color = delivered < toDeliver ? ChatColor.GREEN : ChatColor.GRAY;
String message = color + Lang.get(getPlayer(), "deliver").replace("<npc>", depends.getNPCName(npc));
if (message.contains("<count>")) {
@ -1357,10 +1357,10 @@ public class Quester implements IQuester {
deliverIndex++;
}
int interactIndex = 0;
for (final Integer n : stage.getCitizensToInteract()) {
for (final UUID n : stage.getNpcsToInteract()) {
boolean interacted = false;
if (data.citizensInteracted.size() > interactIndex) {
interacted = data.citizensInteracted.get(interactIndex);
if (data.npcsInteracted.size() > interactIndex) {
interacted = data.npcsInteracted.get(interactIndex);
}
final ChatColor color = !interacted ? ChatColor.GREEN : ChatColor.GRAY;
String message = color + Lang.get(getPlayer(), "talkTo")
@ -1372,12 +1372,12 @@ public class Quester implements IQuester {
interactIndex++;
}
int npcKillIndex = 0;
for (final Integer n : stage.getCitizensToKill()) {
for (final UUID n : stage.getNpcsToKill()) {
int npcKilled = 0;
if (data.citizensNumKilled.size() > npcKillIndex) {
npcKilled = data.citizensNumKilled.get(npcKillIndex);
if (data.npcsNumKilled.size() > npcKillIndex) {
npcKilled = data.npcsNumKilled.get(npcKillIndex);
}
final int toNpcKill = stage.getCitizenNumToKill().get(npcKillIndex);
final int toNpcKill = stage.getNpcNumToKill().get(npcKillIndex);
final ChatColor color = npcKilled < toNpcKill ? ChatColor.GREEN : ChatColor.GRAY;
String message = color + Lang.get(getPlayer(), "kill");
if (message.contains("<mob>")) {
@ -1850,7 +1850,7 @@ public class Quester implements IQuester {
final ItemStack progress = data.itemsDelivered.get(deliverIndex);
final int delivered = progress.getAmount();
final int toDeliver = goal.getAmount();
final Integer npc = stage.getItemDeliveryTargets().get(deliverIndex);
final UUID npc = stage.getItemDeliveryTargets().get(deliverIndex);
final ChatColor color = delivered < toDeliver ? ChatColor.GREEN : ChatColor.GRAY;
String message = color + Lang.get(getPlayer(), "deliver").replace("<npc>", depends.getNPCName(npc));
if (message.contains("<count>")) {
@ -1870,10 +1870,10 @@ public class Quester implements IQuester {
deliverIndex++;
}
int interactIndex = 0;
for (final Integer n : stage.getCitizensToInteract()) {
for (final UUID n : stage.getNpcsToInteract()) {
boolean interacted = false;
if (data.citizensInteracted.size() > interactIndex) {
interacted = data.citizensInteracted.get(interactIndex);
if (data.npcsInteracted.size() > interactIndex) {
interacted = data.npcsInteracted.get(interactIndex);
final ChatColor color = !interacted ? ChatColor.GREEN : ChatColor.GRAY;
String message = color + Lang.get(getPlayer(), "talkTo")
.replace("<npc>", depends.getNPCName(n));
@ -1885,12 +1885,12 @@ public class Quester implements IQuester {
interactIndex++;
}
int npcKillIndex = 0;
for (final Integer n : stage.getCitizensToKill()) {
for (final UUID n : stage.getNpcsToKill()) {
int npcKilled = 0;
if (data.citizensNumKilled.size() > npcKillIndex) {
npcKilled = data.citizensNumKilled.get(npcKillIndex);
if (data.npcsNumKilled.size() > npcKillIndex) {
npcKilled = data.npcsNumKilled.get(npcKillIndex);
}
final int toNpcKill = stage.getCitizenNumToKill().get(npcKillIndex);
final int toNpcKill = stage.getNpcNumToKill().get(npcKillIndex);
final ChatColor color = npcKilled < toNpcKill ? ChatColor.GREEN : ChatColor.GRAY;
String message = color + Lang.get(getPlayer(), "kill");
if (message.contains("<mob>")) {
@ -2982,7 +2982,7 @@ public class Quester implements IQuester {
final Player player = getPlayer();
for (final Integer match : matches) {
final LinkedList<ItemStack> items = new LinkedList<>(getQuestData(quest).itemsDelivered);
if (!getCurrentStage(quest).getItemDeliveryTargets().get(match).equals(npc.getId())) {
if (!getCurrentStage(quest).getItemDeliveryTargets().get(match).equals(npc.getUniqueId())) {
continue;
}
final ItemStack found = items.get(match);
@ -3025,7 +3025,7 @@ public class Quester implements IQuester {
final String[] message = ConfigUtil.parseStringWithPossibleLineBreaks(getCurrentStage(quest)
.getDeliverMessages().get(new Random().nextInt(getCurrentStage(quest).getDeliverMessages()
.size())), plugin.getDependencies().getCitizens().getNPCRegistry()
.getById(getCurrentStage(quest).getItemDeliveryTargets().get(items.indexOf(found))));
.getByUniqueId(getCurrentStage(quest).getItemDeliveryTargets().get(items.indexOf(found))));
player.sendMessage(message);
}
@ -3054,12 +3054,12 @@ public class Quester implements IQuester {
* @param npc The NPC being interacted with
*/
public void interactWithNPC(final IQuest quest, final NPC npc) {
if (!getCurrentStage(quest).getCitizensToInteract().contains(npc.getId())) {
if (!getCurrentStage(quest).getNpcsToInteract().contains(npc.getUniqueId())) {
return;
}
final int index = getCurrentStage(quest).getCitizensToInteract().indexOf(npc.getId());
final boolean npcsInteracted = getQuestData(quest).citizensInteracted.get(index);
final int index = getCurrentStage(quest).getNpcsToInteract().indexOf(npc.getUniqueId());
final boolean npcsInteracted = getQuestData(quest).npcsInteracted.get(index);
final ObjectiveType type = ObjectiveType.TALK_TO_NPC;
final Set<String> dispatchedQuestIDs = new HashSet<>();
@ -3068,14 +3068,14 @@ public class Quester implements IQuester {
plugin.getServer().getPluginManager().callEvent(preEvent);
if (!npcsInteracted) {
getQuestData(quest).citizensInteracted.set(index, true);
getQuestData(quest).npcsInteracted.set(index, true);
finishObjective(quest, new BukkitObjective(type, new ItemStack(Material.AIR, 1),
new ItemStack(Material.AIR, 1)), null, null, npc, null, null, null, null);
dispatchedQuestIDs.addAll(dispatchMultiplayerEverything(quest, type,
(final IQuester q, final IQuest cq) -> {
if (!dispatchedQuestIDs.contains(cq.getId())) {
q.getQuestData(quest).citizensInteracted.set(index, true);
q.getQuestData(quest).npcsInteracted.set(index, true);
if (q.testComplete(quest)) {
quest.nextStage(q, false);
}
@ -3096,13 +3096,13 @@ public class Quester implements IQuester {
* @param npc The NPC being killed
*/
public void killNPC(final IQuest quest, final NPC npc) {
if (!getCurrentStage(quest).getCitizensToKill().contains(npc.getId())) {
if (!getCurrentStage(quest).getNpcsToKill().contains(npc.getUniqueId())) {
return;
}
final int index = getCurrentStage(quest).getCitizensToKill().indexOf(npc.getId());
final int npcsKilled = getQuestData(quest).citizensNumKilled.get(index);
final int npcsToKill = getCurrentStage(quest).getCitizenNumToKill().get(index);
final int index = getCurrentStage(quest).getNpcsToKill().indexOf(npc.getUniqueId());
final int npcsKilled = getQuestData(quest).npcsNumKilled.get(index);
final int npcsToKill = getCurrentStage(quest).getNpcNumToKill().get(index);
final ObjectiveType type = ObjectiveType.KILL_NPC;
final Set<String> dispatchedQuestIDs = new HashSet<>();
@ -3110,9 +3110,9 @@ public class Quester implements IQuester {
new BukkitObjective(type, npcsKilled, npcsToKill));
plugin.getServer().getPluginManager().callEvent(preEvent);
final int newNpcsKilled = getQuestData(quest).citizensNumKilled.get(index) + 1;
final int newNpcsKilled = getQuestData(quest).npcsNumKilled.get(index) + 1;
if (npcsKilled < npcsToKill) {
getQuestData(quest).citizensNumKilled.set(index, newNpcsKilled);
getQuestData(quest).npcsNumKilled.set(index, newNpcsKilled);
if (newNpcsKilled >= npcsToKill) {
finishObjective(quest, new BukkitObjective(type, new ItemStack(Material.AIR, 1),
new ItemStack(Material.AIR, npcsToKill)), null, null, npc, null, null, null, null);
@ -3121,7 +3121,7 @@ public class Quester implements IQuester {
dispatchedQuestIDs.addAll(dispatchMultiplayerEverything(quest, type,
(final IQuester q, final IQuest cq) -> {
if (!dispatchedQuestIDs.contains(cq.getId())) {
q.getQuestData(quest).citizensNumKilled.set(index, newNpcsKilled);
q.getQuestData(quest).npcsNumKilled.set(index, newNpcsKilled);
if (q.testComplete(quest)) {
quest.nextStage(q, false);
}
@ -4183,14 +4183,14 @@ public class Quester implements IQuester {
data.itemsDelivered.add(temp);
}
}
if (!quest.getStage(stage).getCitizensToInteract().isEmpty()) {
for (final Integer ignored : quest.getStage(stage).getCitizensToInteract()) {
data.citizensInteracted.add(false);
if (!quest.getStage(stage).getNpcsToInteract().isEmpty()) {
for (final UUID ignored : quest.getStage(stage).getNpcsToInteract()) {
data.npcsInteracted.add(false);
}
}
if (!quest.getStage(stage).getCitizensToKill().isEmpty()) {
for (final Integer ignored : quest.getStage(stage).getCitizensToKill()) {
data.citizensNumKilled.add(0);
if (!quest.getStage(stage).getNpcsToKill().isEmpty()) {
for (final UUID ignored : quest.getStage(stage).getNpcsToKill()) {
data.npcsNumKilled.add(0);
}
}
if (!quest.getStage(stage).getMobsToKill().isEmpty()) {
@ -4374,11 +4374,11 @@ public class Quester implements IQuester {
}
questSec.set("item-delivery-amounts", deliveryAmounts);
}
if (!questData.citizensInteracted.isEmpty()) {
questSec.set("has-talked-to", questData.citizensInteracted);
if (!questData.npcsInteracted.isEmpty()) {
questSec.set("has-talked-to", questData.npcsInteracted);
}
if (!questData.citizensNumKilled.isEmpty()) {
questSec.set("citizen-amounts-killed", questData.citizensNumKilled);
if (!questData.npcsNumKilled.isEmpty()) {
questSec.set("npc-killed-amounts", questData.npcsNumKilled);
}
if (!questData.mobNumKilled.isEmpty()) {
questSec.set("mobs-killed-amounts", questData.mobNumKilled);

View File

@ -151,6 +151,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
private final Collection<IQuest> quests = new ConcurrentSkipListSet<>();
private Collection<IAction> actions = new ConcurrentSkipListSet<>();
private Collection<ICondition> conditions = new ConcurrentSkipListSet<>();
private LinkedList<UUID> questNpcUuids = new LinkedList<>();
private LinkedList<Integer> questNpcIds = new LinkedList<>();
private TabExecutor cmdExecutor;
private ConversationFactory conversationFactory;
@ -535,10 +536,24 @@ public class Quests extends JavaPlugin implements QuestsAPI {
this.questers = new ConcurrentSkipListSet<>(questers);
}
public LinkedList<UUID> getQuestNpcUuids() {
return questNpcUuids;
}
public void setQuestNpcUuids(final LinkedList<UUID> questNpcUuids) {
this.questNpcUuids = questNpcUuids;
}
/**
* @deprecated Use {@link #getQuestNpcUuids()}
*/
public LinkedList<Integer> getQuestNpcIds() {
return questNpcIds;
}
/**
* @deprecated Use {@link #setQuestNpcUuids(LinkedList)}
*/
public void setQuestNpcIds(final LinkedList<Integer> questNpcIds) {
this.questNpcIds = questNpcIds;
}
@ -1366,7 +1381,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
delivered = data.itemsDelivered.get(deliverIndex).getAmount();
}
final int toDeliver = is.getAmount();
final Integer npc = stage.getItemDeliveryTargets().get(deliverIndex);
final UUID npc = stage.getItemDeliveryTargets().get(deliverIndex);
final ChatColor color = delivered < toDeliver ? ChatColor.GREEN : ChatColor.GRAY;
String message = color + "- " + Lang.get(quester.getPlayer(), "deliver").replace("<npc>", depends.getNPCName(npc));
if (message.contains("<count>")) {
@ -1387,14 +1402,14 @@ public class Quests extends JavaPlugin implements QuestsAPI {
deliverIndex++;
}
int interactIndex = 0;
for (final Integer n : stage.getCitizensToInteract()) {
for (final UUID uuid : stage.getNpcsToInteract()) {
boolean interacted = false;
if (data.citizensInteracted.size() > interactIndex) {
interacted = data.citizensInteracted.get(interactIndex);
if (data.npcsInteracted.size() > interactIndex) {
interacted = data.npcsInteracted.get(interactIndex);
}
final ChatColor color = !interacted ? ChatColor.GREEN : ChatColor.GRAY;
String message = color + "- " + Lang.get(quester.getPlayer(), "talkTo")
.replace("<npc>", depends.getNPCName(n));
.replace("<npc>", depends.getNPCName(uuid));
if (depends.getPlaceholderApi() != null) {
message = PlaceholderAPI.setPlaceholders(quester.getPlayer(), message);
}
@ -1402,18 +1417,18 @@ public class Quests extends JavaPlugin implements QuestsAPI {
interactIndex++;
}
int npcKillIndex = 0;
for (final Integer n : stage.getCitizensToKill()) {
for (final UUID uuid : stage.getNpcsToKill()) {
int npcKilled = 0;
if (data.citizensNumKilled.size() > npcKillIndex) {
npcKilled = data.citizensNumKilled.get(npcKillIndex);
if (data.npcsNumKilled.size() > npcKillIndex) {
npcKilled = data.npcsNumKilled.get(npcKillIndex);
}
final int toNpcKill = stage.getCitizenNumToKill().get(npcKillIndex);
final int toNpcKill = stage.getNpcNumToKill().get(npcKillIndex);
final ChatColor color = npcKilled < toNpcKill ? ChatColor.GREEN : ChatColor.GRAY;
String message = color + "- " + Lang.get(quester.getPlayer(), "kill");
if (message.contains("<mob>")) {
message = message.replace("<mob>", depends.getNPCName(n));
message = message.replace("<mob>", depends.getNPCName(uuid));
} else {
message += " " + depends.getNPCName(n);
message += " " + depends.getNPCName(uuid);
}
if (message.contains("<count>")) {
message = message.replace("<count>", "" + color + npcKilled + "/" + toNpcKill);
@ -1830,11 +1845,23 @@ public class Quests extends JavaPlugin implements QuestsAPI {
} else {
throw new QuestFormatException("finish-message is missing", questKey);
}
if (depends.getCitizens() != null && config.contains("quests." + questKey + ".npc-giver-id")) {
if (config.contains("quests." + questKey + ".npc-giver-uuid")) {
final UUID uuid = UUID.fromString(Objects.requireNonNull(config.getString("quests." + questKey
+ ".npc-giver-uuid")));
if (CitizensAPI.getNPCRegistry().getByUniqueId(uuid) != null) {
quest.setNpcStart(CitizensAPI.getNPCRegistry().getByUniqueId(uuid));
questNpcUuids.add(uuid);
} else {
throw new QuestFormatException("npc-giver-uuid has invalid NPC UUID " + uuid, questKey);
}
} else if (depends.getCitizens() != null && config.contains("quests." + questKey + ".npc-giver-id")) {
// Legacy
final int npcId = config.getInt("quests." + questKey + ".npc-giver-id");
if (CitizensAPI.getNPCRegistry().getById(npcId) != null) {
quest.setNpcStart(CitizensAPI.getNPCRegistry().getById(npcId));
final NPC npc = CitizensAPI.getNPCRegistry().getById(npcId);
quest.setNpcStart(npc);
questNpcIds.add(npcId);
questNpcUuids.add(npc.getUniqueId());
} else {
throw new QuestFormatException("npc-giver-id has invalid NPC ID " + npcId, questKey);
}
@ -2435,10 +2462,13 @@ public class Quests extends JavaPlugin implements QuestsAPI {
final List<ItemStack> itemsToEnchant;
final List<ItemStack> itemsToBrew;
final List<ItemStack> itemsToConsume;
final List<String> npcUuidsToTalkTo;
final List<Integer> npcIdsToTalkTo;
final List<ItemStack> itemsToDeliver;
final List<String> itemDeliveryTargetUuids;
final List<Integer> itemDeliveryTargetIds;
final List<String> deliveryMessages;
final List<String> npcUuidsToKill;
final List<Integer> npcIdsToKill;
final List<Integer> npcAmountsToKill;
// Legacy Denizen script load
@ -2896,15 +2926,45 @@ public class Quests extends JavaPlugin implements QuestsAPI {
throw new StageFormatException("players-to-kill is not a number", quest, stageNum);
}
}
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".npc-ids-to-talk-to")) {
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".npc-uuids-to-talk-to")) {
if (ConfigUtil.checkList(config.getList("quests." + questKey + ".stages.ordered." + stageNum
+ ".npc-uuids-to-talk-to"), String.class)) {
npcUuidsToTalkTo = config.getStringList("quests." + questKey + ".stages.ordered." + stageNum
+ ".npc-uuids-to-talk-to");
for (final String s : npcUuidsToTalkTo) {
final UUID uuid = UUID.fromString(s);
if (getDependencies().getCitizens() != null) {
NPC npc = CitizensAPI.getNPCRegistry().getByUniqueId(uuid);
if (npc != null) {
oStage.addNpcToInteract(uuid);
questNpcIds.add(npc.getId());
questNpcUuids.add(uuid);
} else {
throw new StageFormatException("npc-uuids-to-talk-to has invalid NPC UUID of "
+ s, quest, stageNum);
}
} else {
throw new StageFormatException("Citizens not found for npc-uuids-to-talk-to", quest,
stageNum);
}
}
} else {
throw new StageFormatException("npc-ids-to-talk-to is not a list of numbers", quest, stageNum);
}
} else if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".npc-ids-to-talk-to")) {
// Legacy
if (ConfigUtil.checkList(config.getList("quests." + questKey + ".stages.ordered." + stageNum
+ ".npc-ids-to-talk-to"), Integer.class)) {
npcIdsToTalkTo = config.getIntegerList("quests." + questKey + ".stages.ordered." + stageNum
+ ".npc-ids-to-talk-to");
for (final int i : npcIdsToTalkTo) {
if (getDependencies().getCitizens() != null) {
if (CitizensAPI.getNPCRegistry().getById(i) != null) {
questNpcIds.add(i);
final NPC npc = CitizensAPI.getNPCRegistry().getById(i);
if (npc != null) {
final UUID npcUuid = npc.getUniqueId();
oStage.addNpcToInteract(npcUuid);
questNpcIds.add(npc.getId());
questNpcUuids.add(npcUuid);
} else {
throw new StageFormatException("npc-ids-to-talk-to has invalid NPC ID of " + i, quest,
stageNum);
@ -2914,13 +2974,58 @@ public class Quests extends JavaPlugin implements QuestsAPI {
stageNum);
}
}
oStage.setCitizensToInteract(new LinkedList<>(npcIdsToTalkTo));
} else {
throw new StageFormatException("npc-ids-to-talk-to is not a list of numbers", quest, stageNum);
}
}
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".items-to-deliver")) {
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".npc-delivery-ids")) {
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".npc-delivery-uuids")) {
if (ConfigUtil.checkList(config.getList("quests." + questKey + ".stages.ordered." + stageNum
+ ".npc-delivery-uuids"), String.class)) {
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum
+ ".delivery-messages")) {
itemsToDeliver = (List<ItemStack>) config.get("quests." + questKey + ".stages.ordered."
+ stageNum + ".items-to-deliver");
itemDeliveryTargetUuids = config.getStringList("quests." + questKey + ".stages.ordered."
+ stageNum + ".npc-delivery-uuids");
deliveryMessages = config.getStringList("quests." + questKey + ".stages.ordered."
+ stageNum + ".delivery-messages");
int index = 0;
if (ConfigUtil.checkList(itemsToDeliver, ItemStack.class)) {
for (final ItemStack stack : itemsToDeliver) {
if (stack != null) {
final UUID npcUuid = UUID.fromString(itemDeliveryTargetUuids.get(index));
final String msg = deliveryMessages.size() > index
? deliveryMessages.get(index)
: deliveryMessages.get(deliveryMessages.size() - 1);
index++;
if (getDependencies().getCitizens() != null) {
final NPC npc = CitizensAPI.getNPCRegistry().getByUniqueId(npcUuid);
if (npc != null) {
oStage.addItemToDeliver(stack);
oStage.addItemDeliveryTarget(npcUuid);
oStage.addDeliverMessage(msg);
} else {
throw new StageFormatException("npc-delivery-ids has invalid NPC " +
"UUID of " + npcUuid, quest, stageNum);
}
} else {
throw new StageFormatException(
"Citizens not found for npc-delivery-uuids", quest, stageNum);
}
}
}
} else {
throw new StageFormatException("items-to-deliver has invalid formatting", quest,
stageNum);
}
}
} else {
throw new StageFormatException("npc-delivery-ids is not a list of numbers", quest, stageNum);
}
} else if (config.contains("quests." + questKey + ".stages.ordered." + stageNum
+ ".npc-delivery-ids")) {
// Legacy
if (ConfigUtil.checkList(config.getList("quests." + questKey + ".stages.ordered." + stageNum
+ ".npc-delivery-ids"), Integer.class)) {
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum
@ -2944,7 +3049,7 @@ public class Quests extends JavaPlugin implements QuestsAPI {
final NPC npc = CitizensAPI.getNPCRegistry().getById(npcId);
if (npc != null) {
oStage.addItemToDeliver(stack);
oStage.addItemDeliveryTarget(npcId);
oStage.addItemDeliveryTarget(npc.getUniqueId());
oStage.addDeliverMessage(msg);
} else {
throw new StageFormatException("npc-delivery-ids has invalid NPC " +
@ -2956,55 +3061,11 @@ public class Quests extends JavaPlugin implements QuestsAPI {
}
}
}
} else {
final List<String> items = config.getStringList("quests." + questKey
+ ".stages.ordered." + stageNum + ".items-to-deliver");
if (ConfigUtil.checkList(items, String.class)) {
// Legacy
for (final String item : items) {
final ItemStack is = ItemUtil.readItemStack("" + item);
if (index <= itemDeliveryTargetIds.size()) {
if (itemDeliveryTargetIds.size() != deliveryMessages.size()) {
throw new StageFormatException(
"delivery-messages must be same size as items-to-deliver",
quest, stageNum);
}
final int npcId = itemDeliveryTargetIds.get(index);
final String msg = deliveryMessages.get(index);
index++;
if (is != null) {
if (getDependencies().getCitizens() != null) {
final NPC npc = CitizensAPI.getNPCRegistry().getById(npcId);
if (npc != null) {
oStage.addItemToDeliver(is);
oStage.addItemDeliveryTarget(npcId);
oStage.addDeliverMessage(msg);
} else {
throw new StageFormatException(
"npc-delivery-ids has invalid NPC ID of " + npcId,
quest, stageNum);
}
} else {
throw new StageFormatException(
"Citizens was not found installed for npc-delivery-ids",
quest, stageNum);
}
} else {
throw new StageFormatException(
"items-to-deliver has invalid formatting " + item, quest,
stageNum);
}
} else {
throw new StageFormatException("items-to-deliver is missing target IDs"
, quest, stageNum);
}
}
} else {
throw new StageFormatException("items-to-deliver has invalid formatting", quest,
stageNum);
}
}
}
} else {
throw new StageFormatException("npc-delivery-ids is not a list of numbers", quest, stageNum);
}
@ -3012,9 +3073,46 @@ public class Quests extends JavaPlugin implements QuestsAPI {
throw new StageFormatException("npc-delivery-id is missing", quest, stageNum);
}
}
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".npc-ids-to-kill")) {
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".npc-uuids-to-kill")) {
if (ConfigUtil.checkList(config.getList("quests." + questKey + ".stages.ordered." + stageNum
+ ".npc-uuids-to-kill"), String.class)) {
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".npc-kill-amounts")) {
if (ConfigUtil.checkList(config.getList("quests." + questKey + ".stages.ordered." + stageNum
+ ".npc-kill-amounts"), Integer.class)) {
npcUuidsToKill = config.getStringList("quests." + questKey + ".stages.ordered." + stageNum
+ ".npc-uuids-to-kill");
npcAmountsToKill = config.getIntegerList("quests." + questKey + ".stages.ordered."
+ stageNum + ".npc-kill-amounts");
for (final String s : npcUuidsToKill) {
final UUID npcUuid = UUID.fromString(s);
final NPC npc = CitizensAPI.getNPCRegistry().getByUniqueId(npcUuid);
if (npc != null) {
if (npcAmountsToKill.get(npcUuidsToKill.indexOf(s)) > 0) {
oStage.addNpcToKill(npcUuid);
oStage.addNpcNumToKill(npcAmountsToKill.get(npcUuidsToKill.indexOf(s)));
questNpcIds.add(npc.getId());
questNpcUuids.add(npcUuid);
} else {
throw new StageFormatException("npc-kill-amounts is not a positive number",
quest, stageNum);
}
} else {
throw new StageFormatException("npc-uuids-to-kill has invalid NPC UUID of " + s,
quest, stageNum);
}
}
} else {
throw new StageFormatException("npc-kill-amounts is not a list of numbers", quest,
stageNum);
}
} else {
throw new StageFormatException("npc-kill-amounts is missing", quest, stageNum);
}
}
} else if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".npc-ids-to-kill")) {
if (ConfigUtil.checkList(config.getList("quests." + questKey + ".stages.ordered." + stageNum
+ ".npc-ids-to-kill"), Integer.class)) {
// Legacy
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".npc-kill-amounts")) {
if (ConfigUtil.checkList(config.getList("quests." + questKey + ".stages.ordered." + stageNum
+ ".npc-kill-amounts"), Integer.class)) {
@ -3023,11 +3121,14 @@ public class Quests extends JavaPlugin implements QuestsAPI {
npcAmountsToKill = config.getIntegerList("quests." + questKey + ".stages.ordered."
+ stageNum + ".npc-kill-amounts");
for (final int i : npcIdsToKill) {
if (CitizensAPI.getNPCRegistry().getById(i) != null) {
final NPC npc = CitizensAPI.getNPCRegistry().getById(i);
if (npc != null) {
if (npcAmountsToKill.get(npcIdsToKill.indexOf(i)) > 0) {
oStage.addCitizenToKill(i);
oStage.addCitizenNumToKill(npcAmountsToKill.get(npcIdsToKill.indexOf(i)));
questNpcIds.add(i);
final UUID npcUuid = npc.getUniqueId();
oStage.addNpcToKill(npcUuid);
oStage.addNpcNumToKill(npcAmountsToKill.get(npcIdsToKill.indexOf(i)));
questNpcIds.add(npc.getId());
questNpcUuids.add(npcUuid);
} else {
throw new StageFormatException("npc-kill-amounts is not a positive number",
quest, stageNum);
@ -3044,8 +3145,6 @@ public class Quests extends JavaPlugin implements QuestsAPI {
} else {
throw new StageFormatException("npc-kill-amounts is missing", quest, stageNum);
}
} else {
throw new StageFormatException("npc-ids-to-kill is not a list of numbers", quest, stageNum);
}
}
if (config.contains("quests." + questKey + ".stages.ordered." + stageNum + ".mobs-to-kill")) {

View File

@ -28,6 +28,7 @@ import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
public class Stage implements IStage {
@ -42,7 +43,7 @@ public class Stage implements IStage {
private LinkedList<ItemStack> itemsToBrew = new LinkedList<>();
private LinkedList<ItemStack> itemsToConsume = new LinkedList<>();
private LinkedList<ItemStack> itemsToDeliver = new LinkedList<>();
private LinkedList<Integer> itemDeliveryTargets = new LinkedList<Integer>() {
private LinkedList<UUID> itemDeliveryTargets = new LinkedList<UUID>() {
private static final long serialVersionUID = -2774443496142382127L;
@ -50,11 +51,10 @@ public class Stage implements IStage {
public boolean equals(final Object o) {
if (o instanceof LinkedList) {
@SuppressWarnings("unchecked")
final
LinkedList<Integer> otherList = (LinkedList<Integer>) o;
for (final Integer i : this) {
final Integer other = otherList.get(this.indexOf(i));
if (!other.equals(i)) {
final LinkedList<UUID> otherList = (LinkedList<UUID>) o;
for (final UUID uuid : this) {
final UUID other = otherList.get(this.indexOf(uuid));
if (!other.equals(uuid)) {
return false;
}
}
@ -63,7 +63,7 @@ public class Stage implements IStage {
}
};
private LinkedList<String> deliverMessages = new LinkedList<>();
private LinkedList<Integer> citizensToInteract = new LinkedList<Integer>() {
private LinkedList<UUID> npcsToInteract = new LinkedList<UUID>() {
private static final long serialVersionUID = -4086855121042524435L;
@ -71,11 +71,10 @@ public class Stage implements IStage {
public boolean equals(final Object o) {
if (o instanceof LinkedList) {
@SuppressWarnings("unchecked")
final
LinkedList<Integer> otherList = (LinkedList<Integer>) o;
for (final Integer i : this) {
final Integer other = otherList.get(this.indexOf(i));
if (!other.equals(i)) {
final LinkedList<UUID> otherList = (LinkedList<UUID>) o;
for (final UUID uuid : this) {
final UUID other = otherList.get(this.indexOf(uuid));
if (!other.equals(uuid)) {
return false;
}
}
@ -83,7 +82,7 @@ public class Stage implements IStage {
return true;
}
};
private LinkedList<Integer> citizensToKill = new LinkedList<Integer>() {
private LinkedList<UUID> npcsToKill = new LinkedList<UUID>() {
private static final long serialVersionUID = 7705964814014176415L;
@ -91,11 +90,10 @@ public class Stage implements IStage {
public boolean equals(final Object o) {
if (o instanceof LinkedList) {
@SuppressWarnings("unchecked")
final
LinkedList<Integer> otherList = (LinkedList<Integer>) o;
for (final Integer i : this) {
final Integer other = otherList.get(this.indexOf(i));
if (!other.equals(i)) {
final LinkedList<UUID> otherList = (LinkedList<UUID>) o;
for (final UUID uuid : this) {
final UUID other = otherList.get(this.indexOf(uuid));
if (!other.equals(uuid)) {
return false;
}
}
@ -103,7 +101,7 @@ public class Stage implements IStage {
return true;
}
};
private LinkedList<Integer> citizenNumToKill = new LinkedList<>();
private LinkedList<Integer> npcNumToKill = new LinkedList<>();
private LinkedList<EntityType> mobsToKill = new LinkedList<>();
private LinkedList<Integer> mobNumToKill = new LinkedList<>();
private LinkedList<Location> locationsToKillWithin = new LinkedList<>();
@ -284,16 +282,16 @@ public class Stage implements IStage {
this.itemsToDeliver = itemsToDeliver;
}
public LinkedList<Integer> getItemDeliveryTargets() {
public LinkedList<UUID> getItemDeliveryTargets() {
return itemDeliveryTargets;
}
@Override
public boolean addItemDeliveryTarget(Integer itemDeliveryTarget) {
public boolean addItemDeliveryTarget(UUID itemDeliveryTarget) {
return itemDeliveryTargets.add(itemDeliveryTarget);
}
public void setItemDeliveryTargets(final LinkedList<Integer> itemDeliveryTargets) {
public void setItemDeliveryTargets(final LinkedList<UUID> itemDeliveryTargets) {
this.itemDeliveryTargets = itemDeliveryTargets;
}
@ -310,43 +308,42 @@ public class Stage implements IStage {
this.deliverMessages = deliverMessages;
}
public LinkedList<Integer> getCitizensToInteract() {
return citizensToInteract;
public LinkedList<UUID> getNpcsToInteract() {
return npcsToInteract;
}
@Override
public boolean addCitizenToInteract(Integer citizenToInteract) {
return citizensToInteract.add(citizenToInteract);
public boolean addNpcToInteract(UUID npcToInteract) {
return npcsToInteract.add(npcToInteract);
}
public void setCitizensToInteract(final LinkedList<Integer> citizensToInteract) {
this.citizensToInteract = citizensToInteract;
public void setNpcsToInteract(final LinkedList<UUID> npcsToInteract) {
this.npcsToInteract = npcsToInteract;
}
public LinkedList<Integer> getCitizensToKill() {
return citizensToKill;
public LinkedList<UUID> getNpcsToKill() {
return npcsToKill;
}
@Override
public boolean addCitizenToKill(Integer citizenToKill) {
return citizensToKill.add(citizenToKill);
public boolean addNpcToKill(UUID npcToKill) {
return npcsToKill.add(npcToKill);
}
public void setCitizensToKill(final LinkedList<Integer> citizensToKill) {
this.citizensToKill = citizensToKill;
public void setNpcsToKill(final LinkedList<UUID> npcsToKill) {
this.npcsToKill = npcsToKill;
}
public LinkedList<Integer> getCitizenNumToKill() {
return citizenNumToKill;
public LinkedList<Integer> getNpcNumToKill() {
return npcNumToKill;
}
@Override
public boolean addCitizenNumToKill(Integer citizenNumToKill) {
return this.citizenNumToKill.add(citizenNumToKill);
public boolean addNpcNumToKill(Integer npcNumToKill) {
return this.npcNumToKill.add(npcNumToKill);
}
public void setCitizenNumToKill(final LinkedList<Integer> citizenNumToKill) {
this.citizenNumToKill = citizenNumToKill;
public void setNpcNumToKill(final LinkedList<Integer> npcNumToKill) {
this.npcNumToKill = npcNumToKill;
}
public LinkedList<EntityType> getMobsToKill() {
@ -761,8 +758,8 @@ public class Stage implements IStage {
if (!itemsToBrew.isEmpty()) { return true; }
if (!itemsToConsume.isEmpty()) { return true; }
if (!itemsToDeliver.isEmpty()) { return true; }
if (!citizensToInteract.isEmpty()) { return true; }
if (!citizensToKill.isEmpty()) { return true; }
if (!npcsToInteract.isEmpty()) { return true; }
if (!npcsToKill.isEmpty()) { return true; }
if (!locationsToReach.isEmpty()) { return true; }
if (!mobsToKill.isEmpty()) {return true; }
if (!mobsToTame.isEmpty()) { return true; }
@ -777,8 +774,8 @@ public class Stage implements IStage {
* @return true if stage contains a locatable objective
*/
public boolean hasLocatableObjective() {
if (!citizensToInteract.isEmpty()) { return true; }
if (!citizensToKill.isEmpty()) { return true; }
if (!npcsToInteract.isEmpty()) { return true; }
if (!npcsToKill.isEmpty()) { return true; }
if (!locationsToReach.isEmpty()) { return true; }
if (!itemDeliveryTargets.isEmpty()) { return true; }
if (playersToKill != null) { return true; }
@ -826,9 +823,9 @@ public class Stage implements IStage {
} else if (type.equals(ObjectiveType.KILL_PLAYER)) {
return playersToKill != null;
} else if (type.equals(ObjectiveType.TALK_TO_NPC)) {
return !citizensToInteract.isEmpty();
return !npcsToInteract.isEmpty();
} else if (type.equals(ObjectiveType.KILL_NPC)) {
return !citizensToKill.isEmpty();
return !npcsToKill.isEmpty();
} else if (type.equals(ObjectiveType.TAME_MOB)) {
return !mobsToTame.isEmpty();
} else if (type.equals(ObjectiveType.SHEAR_SHEEP)) {

View File

@ -251,7 +251,7 @@ public class EntityPrompt extends QuestsEditorNumericPrompt {
@Override
public String getQueryText(final ConversationContext context) {
return Lang.get("conditionEditorNpcsPrompt");
return Lang.get("enterNpcUniqueIds");
}
@Override

View File

@ -13,7 +13,6 @@
package me.blackvein.quests.convo.quests.main;
import com.sk89q.worldguard.protection.managers.RegionManager;
import me.blackvein.quests.quests.IQuest;
import me.blackvein.quests.Quests;
import me.blackvein.quests.convo.QuestsNumericPrompt;
import me.blackvein.quests.convo.generic.ItemStackPrompt;
@ -26,6 +25,7 @@ import me.blackvein.quests.convo.quests.rewards.RewardsPrompt;
import me.blackvein.quests.convo.quests.stages.StageMenuPrompt;
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
import me.blackvein.quests.quests.IQuest;
import me.blackvein.quests.reflect.worldguard.WorldGuardAPI;
import me.blackvein.quests.util.CK;
import me.blackvein.quests.util.ItemUtil;
@ -49,6 +49,7 @@ import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
@ -196,12 +197,9 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
!= null) {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else if (plugin.getDependencies().getCitizens() != null) {
final Integer id = (Integer) context.getSessionData(CK.Q_START_NPC);
if (id != null) {
return ChatColor.GRAY + "(" + ChatColor.AQUA + CitizensAPI.getNPCRegistry().getById(id).getName()
+ ChatColor.RESET + ChatColor.GRAY + ")";
}
final UUID uuid = UUID.fromString((String) Objects.requireNonNull(context.getSessionData(CK.Q_START_NPC)));
return ChatColor.GRAY + "(" + ChatColor.AQUA + CitizensAPI.getNPCRegistry().getByUniqueId(uuid)
.getName() + ChatColor.RESET + ChatColor.GRAY + ")";
} else {
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
}
@ -249,8 +247,14 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
final StringBuilder text = new StringBuilder(ChatColor.GOLD + "- " + getTitle(context).replaceFirst(": ", ": "
+ ChatColor.AQUA) + ChatColor.GOLD + " -");
try {
for (int i = 1; i <= size; i++) {
text.append("\n").append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i).append(ChatColor.RESET).append(" - ").append(getSelectionText(context, i)).append(" ").append(getAdditionalText(context, i));
text.append("\n").append(getNumberColor(context, i)).append(ChatColor.BOLD).append(i)
.append(ChatColor.RESET).append(" - ").append(getSelectionText(context, i)).append(" ")
.append(getAdditionalText(context, i));
}
} catch (Exception e) {
e.printStackTrace();
}
return text.toString();
}
@ -475,15 +479,15 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
@Override
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
final QuestsEditorPostOpenStringPromptEvent event = new QuestsEditorPostOpenStringPromptEvent(context, this);
final QuestsEditorPostOpenStringPromptEvent event
= new QuestsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
if (context.getForWhom() instanceof Player) {
final Set<UUID> selectingNpcs = plugin.getQuestFactory().getSelectingNpcs();
selectingNpcs.add(((Player) context.getForWhom()).getUniqueId());
plugin.getQuestFactory().setSelectingNpcs(selectingNpcs);
return ChatColor.YELLOW + getQueryText(context) + "\n"
+ ChatColor.GOLD + Lang.get("npcHint");
return ChatColor.YELLOW + Lang.get("questEditorClickNPCStart");
} else {
return ChatColor.YELLOW + getQueryText(context);
}
@ -496,23 +500,23 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
}
if (!input.equalsIgnoreCase(Lang.get("cmdCancel")) && !input.equalsIgnoreCase(Lang.get("cmdClear"))) {
try {
final int i = Integer.parseInt(input);
if (i > -1) {
if (CitizensAPI.getNPCRegistry().getById(i) == null) {
final UUID uuid = UUID.fromString(input);
if (plugin.getDependencies().getCitizens() != null) {
if (CitizensAPI.getNPCRegistry().getByUniqueId(uuid) == null) {
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorInvalidNPC"));
return new QuestNPCStartPrompt(context);
}
context.setSessionData(CK.Q_START_NPC, i);
context.setSessionData(CK.Q_START_NPC, uuid.toString());
}
if (context.getForWhom() instanceof Player) {
final Set<UUID> selectingNpcs = plugin.getQuestFactory().getSelectingNpcs();
selectingNpcs.remove(((Player) context.getForWhom()).getUniqueId());
plugin.getQuestFactory().setSelectingNpcs(selectingNpcs);
}
return new QuestMainPrompt(context);
}
} catch (final NumberFormatException e) {
} catch (final IllegalArgumentException e) {
context.getForWhom().sendRawMessage(ChatColor.RED
+ Lang.get("reqNotANumber").replace("<input>", input));
+ Lang.get("reqNotAUniqueId").replace("<input>", input));
return new QuestNPCStartPrompt(context);
}
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
@ -606,7 +610,8 @@ public class QuestMainPrompt extends QuestsEditorNumericPrompt {
@Override
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
final QuestsEditorPostOpenStringPromptEvent event = new QuestsEditorPostOpenStringPromptEvent(context, this);
final QuestsEditorPostOpenStringPromptEvent event
= new QuestsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
StringBuilder text = new StringBuilder(ChatColor.AQUA + getTitle(context) + "\n");

View File

@ -438,8 +438,8 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
return new BlockBreakNamesPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
.replace("<data>", s));
return new BlockBreakNamesPrompt(context);
}
}
@ -508,8 +508,8 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
return new BlockBreakAmountsPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
.replace("<data>", s));
return new BlockBreakAmountsPrompt(context);
}
}
@ -565,8 +565,8 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
return new BlockBreakDurabilityPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
.replace("<data>", s));
return new BlockBreakDurabilityPrompt(context);
}
}
@ -808,8 +808,8 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
return new BlockDamageNamesPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
.replace("<data>", s));
return new BlockDamageNamesPrompt(context);
}
}
@ -877,8 +877,8 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
return new BlockDamageAmountsPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
.replace("<data>", s));
return new BlockDamageAmountsPrompt(context);
}
}
@ -933,8 +933,8 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
return new BlockDamageDurabilityPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
.replace("<data>", s));
return new BlockDamageDurabilityPrompt(context);
}
}
@ -1176,8 +1176,8 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
return new BlockPlaceNamesPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
.replace("<data>", s));
return new BlockPlaceNamesPrompt(context);
}
}
@ -1245,8 +1245,8 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
return new BlockPlaceAmountsPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
.replace("<data>", s));
return new BlockPlaceAmountsPrompt(context);
}
}
@ -1301,8 +1301,8 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
return new BlockPlaceDurabilityPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
.replace("<data>", s));
return new BlockPlaceDurabilityPrompt(context);
}
}
@ -1542,8 +1542,8 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
return new BlockUseNamesPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
.replace("<data>", s));
return new BlockUseNamesPrompt(context);
}
}
@ -1610,8 +1610,8 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
return new BlockUseAmountsPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
.replace("<data>", s));
return new BlockUseAmountsPrompt(context);
}
}
@ -1666,8 +1666,8 @@ public class BlocksPrompt extends QuestsEditorNumericPrompt {
return new BlockUseDurabilityPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfNumbers")
.replace("<data>", s));
return new BlockUseDurabilityPrompt(context);
}
}

View File

@ -18,6 +18,7 @@ import me.blackvein.quests.convo.quests.QuestsEditorNumericPrompt;
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
import me.blackvein.quests.convo.quests.stages.StageMainPrompt;
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenNumericPromptEvent;
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
import me.blackvein.quests.util.CK;
import me.blackvein.quests.util.ItemUtil;
import me.blackvein.quests.util.Lang;
@ -98,7 +99,8 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else {
final StringBuilder text = new StringBuilder();
final LinkedList<Integer> npcs = (LinkedList<Integer>) context.getSessionData(pref + CK.S_DELIVERY_NPCS);
final LinkedList<String> npcs
= (LinkedList<String>) context.getSessionData(pref + CK.S_DELIVERY_NPCS);
final LinkedList<ItemStack> items
= (LinkedList<ItemStack>) context.getSessionData(pref + CK.S_DELIVERY_ITEMS);
if (npcs != null && items != null) {
@ -106,9 +108,9 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.BLUE)
.append(ItemUtil.getName(items.get(i))).append(ChatColor.GRAY).append(" x ")
.append(ChatColor.AQUA).append(items.get(i).getAmount()).append(ChatColor.GRAY)
.append(" ").append(Lang.get("to")).append(" ").append(ChatColor.DARK_AQUA)
.append(" ").append(Lang.get("to")).append(" ").append(ChatColor.BLUE)
.append(plugin.getDependencies().getCitizens().getNPCRegistry()
.getById(npcs.get(i)).getName());
.getByUniqueId(UUID.fromString(npcs.get(i))).getName());
}
}
return text.toString();
@ -122,13 +124,13 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else {
final StringBuilder text = new StringBuilder();
final LinkedList<Integer> npcs
= (LinkedList<Integer>) context.getSessionData(pref + CK.S_NPCS_TO_TALK_TO);
final LinkedList<String> npcs
= (LinkedList<String>) context.getSessionData(pref + CK.S_NPCS_TO_TALK_TO);
if (npcs != null) {
for (final Integer npc : npcs) {
text.append(ChatColor.GRAY).append(" - ").append(ChatColor.BLUE)
for (final String npc : npcs) {
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.BLUE)
.append(plugin.getDependencies().getCitizens().getNPCRegistry()
.getById(npc).getName()).append("\n");
.getByUniqueId(UUID.fromString(npc)).getName());
}
}
return text.toString();
@ -142,15 +144,16 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else {
final StringBuilder text = new StringBuilder();
final LinkedList<Integer> npcs = (LinkedList<Integer>) context.getSessionData(pref + CK.S_NPCS_TO_KILL);
final LinkedList<String> npcs
= (LinkedList<String>) context.getSessionData(pref + CK.S_NPCS_TO_KILL);
final LinkedList<Integer> amounts
= (LinkedList<Integer>) context.getSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS);
if (npcs != null && amounts != null) {
for (int i = 0; i < npcs.size(); i++) {
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.BLUE)
.append(plugin.getDependencies().getCitizens().getNPCRegistry()
.getById(npcs.get(i)).getName()).append(ChatColor.GRAY).append(" x ")
.append(ChatColor.AQUA).append(amounts.get(i));
.getByUniqueId(UUID.fromString(npcs.get(i))).getName()).append(ChatColor.GRAY)
.append(" x ").append(ChatColor.AQUA).append(amounts.get(i));
}
}
return text.toString();
@ -260,7 +263,7 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
case 1:
return ChatColor.YELLOW + Lang.get("stageEditorDeliveryAddItem");
case 2:
return ChatColor.YELLOW + Lang.get("stageEditorDeliveryNPCs");
return ChatColor.YELLOW + Lang.get("stageEditorNPCUniqueIds");
case 3:
return ChatColor.YELLOW + Lang.get("stageEditorDeliveryMessages");
case 4:
@ -296,14 +299,14 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else {
final StringBuilder text = new StringBuilder();
final List<Integer> deliveryNpcs
= (List<Integer>) context.getSessionData(pref + CK.S_DELIVERY_NPCS);
final List<String> deliveryNpcs = (List<String>) context.getSessionData(pref + CK.S_DELIVERY_NPCS);
if (deliveryNpcs != null) {
for (final int i : deliveryNpcs) {
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA).append(i)
.append(ChatColor.GRAY).append(" (").append(ChatColor.AQUA)
.append(plugin.getDependencies().getCitizens().getNPCRegistry()
.getById(i).getName()).append(ChatColor.GRAY).append(")");
for (final String s : deliveryNpcs) {
final UUID uuid = UUID.fromString(s);
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA)
.append(plugin.getDependencies().getCitizens().getNPCRegistry().getByUniqueId(uuid)
.getName()).append(ChatColor.GRAY).append(" (").append(ChatColor.BLUE).append(s)
.append(ChatColor.GRAY).append(")");
}
}
return text.toString();
@ -386,7 +389,7 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
final int one;
final int two;
final List<ItemStack> items = (List<ItemStack>) context.getSessionData(pref + CK.S_DELIVERY_ITEMS);
final List<Integer> npcs = (List<Integer>) context.getSessionData(pref + CK.S_DELIVERY_NPCS);
final List<UUID> npcs = (List<UUID>) context.getSessionData(pref + CK.S_DELIVERY_NPCS);
if (items != null) {
one = items.size();
} else {
@ -427,46 +430,59 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
@Override
public String getQueryText(final ConversationContext context) {
return Lang.get("stageEditorNPCPrompt");
return Lang.get("enterNpcUniqueIds");
}
@Override
public @NotNull String getPromptText(final ConversationContext context) {
final Set<UUID> temp = plugin.getQuestFactory().getSelectingNpcs();
temp.add(((Player) context.getForWhom()).getUniqueId());
plugin.getQuestFactory().setSelectingNpcs(temp);
return ChatColor.YELLOW + getQueryText(context) + "\n" + ChatColor.GOLD + Lang.get("npcHint");
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
if (context.getPlugin() != null) {
final QuestsEditorPostOpenStringPromptEvent event
= new QuestsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
}
if (context.getForWhom() instanceof Player) {
final Set<UUID> selectingNpcs = plugin.getQuestFactory().getSelectingNpcs();
selectingNpcs.add(((Player) context.getForWhom()).getUniqueId());
plugin.getQuestFactory().setSelectingNpcs(selectingNpcs);
return ChatColor.YELLOW + Lang.get("questEditorClickNPCStart");
} else {
return ChatColor.YELLOW + getQueryText(context);
}
}
@Override
@SuppressWarnings("unchecked")
public Prompt acceptInput(final @NotNull ConversationContext context, final String input) {
if (input == null) {
return null;
}
if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
final String[] args = input.split(" ");
final LinkedList<Integer> npcs = new LinkedList<>();
final LinkedList<String> npcs = context.getSessionData(pref + CK.S_DELIVERY_NPCS) != null
? (LinkedList<String>) context.getSessionData(pref + CK.S_DELIVERY_NPCS) : new LinkedList<>();
for (final String s : args) {
try {
final int i = Integer.parseInt(s);
if (plugin.getDependencies().getCitizens().getNPCRegistry().getById(i) != null) {
npcs.add(i);
final UUID uuid = UUID.fromString(s);
if (plugin.getDependencies().getCitizens().getNPCRegistry().getByUniqueId(uuid) != null
&& npcs != null) {
npcs.add(uuid.toString());
} else {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + "" + i + ChatColor.RED + " "
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + "" + uuid + ChatColor.RED + " "
+ Lang.get("stageEditorInvalidNPC"));
return new NpcDeliveryNpcsPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
} catch (final IllegalArgumentException e) {
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfUniqueIds")
.replace("<data>", s));
return new NpcDeliveryNpcsPrompt(context);
}
}
context.setSessionData(pref + CK.S_DELIVERY_NPCS, npcs);
}
final Set<UUID> temp = plugin.getQuestFactory().getSelectingNpcs();
temp.remove(((Player) context.getForWhom()).getUniqueId());
plugin.getQuestFactory().setSelectingNpcs(temp);
final Set<UUID> selectingNpcs = plugin.getQuestFactory().getSelectingNpcs();
selectingNpcs.remove(((Player) context.getForWhom()).getUniqueId());
plugin.getQuestFactory().setSelectingNpcs(selectingNpcs);
return new NpcsDeliveryListPrompt(context);
}
}
@ -488,6 +504,12 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
}
@Override
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
if (context.getPlugin() != null) {
final QuestsEditorPostOpenStringPromptEvent event
= new QuestsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
}
return ChatColor.YELLOW + getQueryText(context) + "\n" + ChatColor.GOLD + Lang.get("stageEditorNPCNote");
}
@ -518,39 +540,51 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
@Override
public String getQueryText(final ConversationContext context) {
return Lang.get("stageEditorNPCToTalkToPrompt");
return Lang.get("enterOrClearNpcUniqueIds");
}
@Override
public @NotNull String getPromptText(final ConversationContext context) {
final Set<UUID> temp = plugin.getQuestFactory().getSelectingNpcs();
temp.add(((Player) context.getForWhom()).getUniqueId());
plugin.getQuestFactory().setSelectingNpcs(temp);
return ChatColor.YELLOW + getQueryText(context) + "\n" + ChatColor.GOLD
+ Lang.get("npcHint");
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
if (context.getPlugin() != null) {
final QuestsEditorPostOpenStringPromptEvent event
= new QuestsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
}
if (context.getForWhom() instanceof Player) {
final Set<UUID> selectingNpcs = plugin.getQuestFactory().getSelectingNpcs();
selectingNpcs.add(((Player) context.getForWhom()).getUniqueId());
plugin.getQuestFactory().setSelectingNpcs(selectingNpcs);
return ChatColor.YELLOW + Lang.get("questEditorClickNPCStart");
} else {
return ChatColor.YELLOW + getQueryText(context);
}
}
@Override
@SuppressWarnings("unchecked")
public Prompt acceptInput(final @NotNull ConversationContext context, final String input) {
if (input == null) {
return null;
}
if (!input.equalsIgnoreCase(Lang.get("cmdCancel")) && !input.equalsIgnoreCase(Lang.get("cmdClear"))) {
final String[] args = input.split(" ");
final LinkedList<Integer> npcs = new LinkedList<>();
final LinkedList<String> npcs = context.getSessionData(pref + CK.S_NPCS_TO_TALK_TO) != null
? (LinkedList<String>) context.getSessionData(pref + CK.S_NPCS_TO_TALK_TO) : new LinkedList<>();
for (final String s : args) {
try {
final int i = Integer.parseInt(s);
if (plugin.getDependencies().getCitizens().getNPCRegistry().getById(i) != null) {
npcs.add(i);
final UUID uuid = UUID.fromString(s);
if (plugin.getDependencies().getCitizens().getNPCRegistry().getByUniqueId(uuid) != null
&& npcs != null) {
npcs.add(uuid.toString());
} else {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + "" + i + ChatColor.RED + " "
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + "" + uuid + ChatColor.RED + " "
+ Lang.get("stageEditorInvalidNPC"));
return new NpcsIdsToTalkToPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfUniqueIds")
.replace("<data>", s));
return new NpcsIdsToTalkToPrompt(context);
}
}
@ -559,9 +593,9 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
context.setSessionData(pref + CK.S_NPCS_TO_TALK_TO, null);
}
if (context.getForWhom() instanceof Player) {
final Set<UUID> temp = plugin.getQuestFactory().getSelectingNpcs();
temp.remove(((Player) context.getForWhom()).getUniqueId());
plugin.getQuestFactory().setSelectingNpcs(temp);
final Set<UUID> selectingNpcs = plugin.getQuestFactory().getSelectingNpcs();
selectingNpcs.remove(((Player) context.getForWhom()).getUniqueId());
plugin.getQuestFactory().setSelectingNpcs(selectingNpcs);
}
return new StageMainPrompt(stageNum, context);
}
@ -604,7 +638,7 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
public String getSelectionText(final ConversationContext context, final int number) {
switch(number) {
case 1:
return ChatColor.YELLOW + Lang.get("stageEditorSetKillIds");
return ChatColor.YELLOW + Lang.get("stageEditorNPCUniqueIds");
case 2:
return ChatColor.YELLOW + Lang.get("stageEditorSetKillAmounts");
case 3:
@ -626,13 +660,13 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else {
final StringBuilder text = new StringBuilder();
final List<Integer> npcsToKill = (List<Integer>) context.getSessionData(pref + CK.S_NPCS_TO_KILL);
final List<String> npcsToKill = (List<String>) context.getSessionData(pref + CK.S_NPCS_TO_KILL);
if (npcsToKill != null) {
for (final Integer i : npcsToKill) {
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.AQUA)
for (final String s : npcsToKill) {
text.append("\n").append(ChatColor.GRAY).append(" - ").append(ChatColor.BLUE)
.append(plugin.getDependencies().getCitizens().getNPCRegistry()
.getById(i).getName()).append(ChatColor.DARK_AQUA).append(" (").append(i)
.append(")");
.getByUniqueId(UUID.fromString(s)).getName()).append(ChatColor.GRAY).append(" (")
.append(ChatColor.AQUA).append(s).append(ChatColor.GRAY).append(")");
}
}
return text.toString();
@ -695,7 +729,7 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
case 4:
final int one;
final int two;
final List<Integer> kill = (List<Integer>) context.getSessionData(pref + CK.S_NPCS_TO_KILL);
final List<UUID> kill = (List<UUID>) context.getSessionData(pref + CK.S_NPCS_TO_KILL);
final List<Integer> killAmounts
= (List<Integer>) context.getSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS);
if (kill != null) {
@ -733,46 +767,59 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
@Override
public String getQueryText(final ConversationContext context) {
return Lang.get("stageEditorNPCPrompt");
return Lang.get("enterNpcUniqueIds");
}
@Override
public @NotNull String getPromptText(final ConversationContext context) {
final Set<UUID> temp = plugin.getQuestFactory().getSelectingNpcs();
temp.add(((Player) context.getForWhom()).getUniqueId());
plugin.getQuestFactory().setSelectingNpcs(temp);
return ChatColor.YELLOW + getQueryText(context) + "\n" + ChatColor.GOLD + Lang.get("npcHint");
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
if (context.getPlugin() != null) {
final QuestsEditorPostOpenStringPromptEvent event
= new QuestsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
}
if (context.getForWhom() instanceof Player) {
final Set<UUID> selectingNpcs = plugin.getQuestFactory().getSelectingNpcs();
selectingNpcs.add(((Player) context.getForWhom()).getUniqueId());
plugin.getQuestFactory().setSelectingNpcs(selectingNpcs);
return ChatColor.YELLOW + Lang.get("questEditorClickNPCStart");
} else {
return ChatColor.YELLOW + getQueryText(context);
}
}
@Override
@SuppressWarnings("unchecked")
public Prompt acceptInput(final @NotNull ConversationContext context, final String input) {
if (input == null) {
return null;
}
if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
final String[] args = input.split(" ");
final LinkedList<Integer> npcs = new LinkedList<>();
final LinkedList<String> npcs = context.getSessionData(pref + CK.S_NPCS_TO_KILL) != null
? (LinkedList<String>) context.getSessionData(pref + CK.S_NPCS_TO_KILL) : new LinkedList<>();
for (final String s : args) {
try {
final int i = Integer.parseInt(s);
if (plugin.getDependencies().getCitizens().getNPCRegistry().getById(i) != null) {
npcs.add(i);
final UUID uuid = UUID.fromString(s);
if (plugin.getDependencies().getCitizens().getNPCRegistry().getByUniqueId(uuid) != null
&& npcs != null) {
npcs.add(uuid.toString());
} else {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + "" + i + ChatColor.RED + " "
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + "" + uuid + ChatColor.RED + " "
+ Lang.get("stageEditorInvalidNPC"));
return new NpcIdsToKillPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
} catch (final IllegalArgumentException e) {
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfUniqueIds")
.replace("<data>", s));
return new NpcIdsToKillPrompt(context);
}
}
context.setSessionData(pref + CK.S_NPCS_TO_KILL, npcs);
}
final Set<UUID> temp = plugin.getQuestFactory().getSelectingNpcs();
temp.remove(((Player) context.getForWhom()).getUniqueId());
plugin.getQuestFactory().setSelectingNpcs(temp);
final Set<UUID> selectingNpcs = plugin.getQuestFactory().getSelectingNpcs();
selectingNpcs.remove(((Player) context.getForWhom()).getUniqueId());
plugin.getQuestFactory().setSelectingNpcs(selectingNpcs);
return new NpcsKillListPrompt(context);
}
}
@ -795,6 +842,12 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
@Override
public @NotNull String getPromptText(final @NotNull ConversationContext context) {
if (context.getPlugin() != null) {
final QuestsEditorPostOpenStringPromptEvent event
= new QuestsEditorPostOpenStringPromptEvent(context, this);
plugin.getServer().getPluginManager().callEvent(event);
}
return ChatColor.YELLOW + getQueryText(context);
}
@ -816,8 +869,8 @@ public class NpcsPrompt extends QuestsEditorNumericPrompt {
return new NpcAmountsToKillPrompt(context);
}
} catch (final NumberFormatException e) {
context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + " " + ChatColor.RED
+ Lang.get("stageEditorNotListofNumbers"));
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorNotListOfUniqueIds")
.replace("<data>", s));
return new NpcAmountsToKillPrompt(context);
}
}

View File

@ -12,10 +12,10 @@
package me.blackvein.quests.listeners;
import me.blackvein.quests.quests.IQuest;
import me.blackvein.quests.player.IQuester;
import me.blackvein.quests.Quests;
import me.blackvein.quests.enums.ObjectiveType;
import me.blackvein.quests.player.IQuester;
import me.blackvein.quests.quests.IQuest;
import me.blackvein.quests.util.ItemUtil;
import me.blackvein.quests.util.Lang;
import net.citizensnpcs.api.event.NPCDeathEvent;
@ -42,6 +42,7 @@ import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.Set;
import java.util.UUID;
public class NpcListener implements Listener {
@ -58,10 +59,12 @@ public class NpcListener implements Listener {
return;
}
if (plugin.getQuestFactory().getSelectingNpcs().contains(evt.getClicker().getUniqueId())) {
evt.getClicker().sendMessage(ChatColor.GREEN + evt.getNPC().getName() + " " + ChatColor.DARK_GREEN
+ Lang.get("id") + ": " + evt.getNPC().getId());
if (evt.getNPC() == null) {
plugin.getLogger().severe("NPC was null while selecting by right-click");
return;
}
evt.getClicker().acceptConversationInput(String.valueOf(evt.getNPC().getUniqueId()));
}
if (!evt.getClicker().isConversing()) {
final Player player = evt.getClicker();
final IQuester quester = plugin.getQuester(player.getUniqueId());
@ -81,15 +84,15 @@ public class NpcListener implements Listener {
final NPC clicked = evt.getNPC();
if (!matches.isEmpty()) {
for (final Integer match : matches) {
final Integer id = quester.getCurrentStage(quest).getItemDeliveryTargets().get(match);
if (id.equals(clicked.getId())) {
final UUID uuid = quester.getCurrentStage(quest).getItemDeliveryTargets().get(match);
if (uuid.equals(clicked.getUniqueId())) {
quester.deliverToNPC(quest, clicked, hand);
return;
}
}
} else if (!hand.getType().equals(Material.AIR)) {
for (final Integer n : quester.getCurrentStage(quest).getItemDeliveryTargets()) {
if (n.equals(clicked.getId())) {
for (final UUID uuid : quester.getCurrentStage(quest).getItemDeliveryTargets()) {
if (uuid.equals(clicked.getUniqueId())) {
String text = "";
final boolean hasMeta = hand.getItemMeta() != null;
if (hasMeta) {
@ -189,10 +192,10 @@ public class NpcListener implements Listener {
boolean hasObjective = false;
for (final IQuest quest : quester.getCurrentQuestsTemp().keySet()) {
if (quester.getCurrentStage(quest).containsObjective(ObjectiveType.TALK_TO_NPC)) {
final int npcIndex
= quester.getCurrentStage(quest).getCitizensToInteract().indexOf(evt.getNPC().getId());
final int npcIndex = quester.getCurrentStage(quest).getNpcsToInteract().indexOf(evt.getNPC()
.getUniqueId());
if (quester.getQuestData(quest) != null && npcIndex > -1
&& !quester.getQuestData(quest).citizensInteracted.get(npcIndex)) {
&& !quester.getQuestData(quest).npcsInteracted.get(npcIndex)) {
hasObjective = true;
}
quester.interactWithNPC(quest, evt.getNPC());
@ -262,8 +265,11 @@ public class NpcListener implements Listener {
return;
}
if (plugin.getQuestFactory().getSelectingNpcs().contains(evt.getClicker().getUniqueId())) {
evt.getClicker().sendMessage(ChatColor.GREEN + evt.getNPC().getName() + " " + ChatColor.DARK_GREEN
+ Lang.get("id") + ": " + evt.getNPC().getId());
if (evt.getNPC() == null) {
plugin.getLogger().severe("NPC was null while selecting by left-click");
return;
}
evt.getClicker().acceptConversationInput(String.valueOf(evt.getNPC().getUniqueId()));
}
}

View File

@ -12,12 +12,12 @@
package me.blackvein.quests.quests;
import me.blackvein.quests.module.ICustomObjective;
import me.blackvein.quests.Quests;
import me.blackvein.quests.convo.quests.main.QuestMainPrompt;
import me.blackvein.quests.convo.quests.menu.QuestMenuPrompt;
import me.blackvein.quests.convo.quests.stages.StageMenuPrompt;
import me.blackvein.quests.interfaces.ReloadCallback;
import me.blackvein.quests.module.ICustomObjective;
import me.blackvein.quests.util.CK;
import me.blackvein.quests.util.ConfigUtil;
import me.blackvein.quests.util.FakeConversable;
@ -144,6 +144,7 @@ public class BukkitQuestFactory implements QuestFactory, ConversationAbandonedLi
@SuppressWarnings("deprecation")
public void loadQuest(final ConversationContext context, final IQuest q) {
try {
context.setSessionData(CK.ED_QUEST_EDIT, q.getName());
context.setSessionData(CK.Q_ID, q.getId());
context.setSessionData(CK.Q_NAME, q.getName());
@ -151,7 +152,7 @@ public class BukkitQuestFactory implements QuestFactory, ConversationAbandonedLi
context.setSessionData(CK.Q_FINISH_MESSAGE, q.getFinished());
if (plugin.getDependencies().getCitizens() != null) {
if (q.getNpcStart() != null) {
context.setSessionData(CK.Q_START_NPC, q.getNpcStart().getId());
context.setSessionData(CK.Q_START_NPC, q.getNpcStart().getUniqueId().toString());
}
}
context.setSessionData(CK.Q_START_BLOCK, q.getBlockStart());
@ -384,19 +385,28 @@ public class BukkitQuestFactory implements QuestFactory, ConversationAbandonedLi
}
if (!stage.getItemsToDeliver().isEmpty()) {
final LinkedList<ItemStack> items = new LinkedList<>(stage.getItemsToDeliver());
final LinkedList<Integer> npcs = new LinkedList<>(stage.getItemDeliveryTargets());
final LinkedList<String> npcs = new LinkedList<>();
for (UUID uuid : stage.getItemDeliveryTargets()) {
npcs.add(uuid.toString());
}
context.setSessionData(pref + CK.S_DELIVERY_ITEMS, items);
context.setSessionData(pref + CK.S_DELIVERY_NPCS, npcs);
context.setSessionData(pref + CK.S_DELIVERY_MESSAGES, stage.getDeliverMessages());
}
if (!stage.getCitizensToInteract().isEmpty()) {
final LinkedList<Integer> npcs = new LinkedList<>(stage.getCitizensToInteract());
if (!stage.getNpcsToInteract().isEmpty()) {
final LinkedList<String> npcs = new LinkedList<>();
for (UUID uuid : stage.getNpcsToInteract()) {
npcs.add(uuid.toString());
}
context.setSessionData(pref + CK.S_NPCS_TO_TALK_TO, npcs);
}
if (!stage.getCitizensToKill().isEmpty()) {
final LinkedList<Integer> npcs = new LinkedList<>(stage.getCitizensToKill());
if (!stage.getNpcsToKill().isEmpty()) {
final LinkedList<String> npcs = new LinkedList<>();
for (UUID uuid : stage.getNpcsToKill()) {
npcs.add(uuid.toString());
}
context.setSessionData(pref + CK.S_NPCS_TO_KILL, npcs);
context.setSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS, stage.getCitizenNumToKill());
context.setSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS, stage.getNpcNumToKill());
}
if (!stage.getMobsToKill().isEmpty()) {
final LinkedList<String> mobs = new LinkedList<>();
@ -516,6 +526,9 @@ public class BukkitQuestFactory implements QuestFactory, ConversationAbandonedLi
context.setSessionData(pref + CK.S_OVERRIDE_DISPLAY, stage.getObjectiveOverrides());
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
public void deleteQuest(final ConversationContext context) {
@ -585,7 +598,7 @@ public class BukkitQuestFactory implements QuestFactory, ConversationAbandonedLi
? context.getSessionData(CK.Q_ASK_MESSAGE) : null);
section.set("finish-message", context.getSessionData(CK.Q_FINISH_MESSAGE) != null
? context.getSessionData(CK.Q_FINISH_MESSAGE) : null);
section.set("npc-giver-id", context.getSessionData(CK.Q_START_NPC) != null
section.set("npc-giver-uuid", context.getSessionData(CK.Q_START_NPC) != null
? context.getSessionData(CK.Q_START_NPC) : null);
section.set("block-start", context.getSessionData(CK.Q_START_BLOCK) != null
? ConfigUtil.getLocationInfo((Location) Objects.requireNonNull(context
@ -710,13 +723,13 @@ public class BukkitQuestFactory implements QuestFactory, ConversationAbandonedLi
? context.getSessionData(pref + CK.S_PLAYER_KILL) : null);
stage.set("items-to-deliver", context.getSessionData(pref + CK.S_DELIVERY_ITEMS) != null
? context.getSessionData(pref + CK.S_DELIVERY_ITEMS) : null);
stage.set("npc-delivery-ids", context.getSessionData(pref + CK.S_DELIVERY_NPCS) != null
stage.set("npc-delivery-uuids", context.getSessionData(pref + CK.S_DELIVERY_NPCS) != null
? context.getSessionData(pref + CK.S_DELIVERY_NPCS) : null);
stage.set("delivery-messages", context.getSessionData(pref + CK.S_DELIVERY_MESSAGES) != null
? context.getSessionData(pref + CK.S_DELIVERY_MESSAGES) : null);
stage.set("npc-ids-to-talk-to", context.getSessionData(pref + CK.S_NPCS_TO_TALK_TO) != null
stage.set("npc-uuids-to-talk-to", context.getSessionData(pref + CK.S_NPCS_TO_TALK_TO) != null
? context.getSessionData(pref + CK.S_NPCS_TO_TALK_TO) : null);
stage.set("npc-ids-to-kill", context.getSessionData(pref + CK.S_NPCS_TO_KILL) != null
stage.set("npc-uuids-to-kill", context.getSessionData(pref + CK.S_NPCS_TO_KILL) != null
? context.getSessionData(pref + CK.S_NPCS_TO_KILL) : null);
stage.set("npc-kill-amounts", context.getSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS) != null
? context.getSessionData(pref + CK.S_NPCS_TO_KILL_AMOUNTS) : null);

View File

@ -314,14 +314,24 @@ public class SeparatedYamlStorage implements StorageImplementation {
}
if (questSec.contains("has-talked-to")) {
final List<Boolean> talkAmount = questSec.getBooleanList("has-talked-to");
quester.getQuestData(quest).setCitizensInteracted(new LinkedList<>(talkAmount));
quester.getQuestData(quest).setNpcsInteracted(new LinkedList<>(talkAmount));
}
if (questSec.contains("citizen-amounts-killed")) {
final List<Integer> citizensAmounts = questSec.getIntegerList("citizen-amounts-killed");
if (questSec.contains("npc-killed-amounts")) {
final List<Integer> npcAmounts = questSec.getIntegerList("npc-killed-amounts");
int index = 0;
for (final int amt : citizensAmounts) {
if (quester.getQuestData(quest).getCitizensNumKilled().size() > 0) {
quester.getQuestData(quest).citizensNumKilled.set(index, amt);
for (final int amt : npcAmounts) {
if (quester.getQuestData(quest).getNpcsNumKilled().size() > 0) {
quester.getQuestData(quest).npcsNumKilled.set(index, amt);
}
index++;
}
} else if (questSec.contains("citizen-amounts-killed")) {
// Legacy
final List<Integer> npcAmounts = questSec.getIntegerList("citizen-amounts-killed");
int index = 0;
for (final int amt : npcAmounts) {
if (quester.getQuestData(quest).getNpcsNumKilled().size() > 0) {
quester.getQuestData(quest).npcsNumKilled.set(index, amt);
}
index++;
}

View File

@ -371,8 +371,8 @@ public class SqlStorage implements StorageImplementation {
ps.setString(11, serializeItemStackProgress(entry.getValue().getItemsBrewed()));
ps.setString(12, serializeItemStackProgress(entry.getValue().getItemsConsumed()));
ps.setString(13, serializeItemStackProgress(entry.getValue().getItemsDelivered()));
ps.setString(14, serializeProgress(entry.getValue().getCitizensInteracted()));
ps.setString(15, serializeProgress(entry.getValue().getCitizensNumKilled()));
ps.setString(14, serializeProgress(entry.getValue().getNpcsInteracted()));
ps.setString(15, serializeProgress(entry.getValue().getNpcsNumKilled()));
ps.setString(16, serializeProgress(entry.getValue().getMobNumKilled()));
ps.setString(17, serializeProgress(entry.getValue().getMobsTamed()));
ps.setInt(18, entry.getValue().getFishCaught());
@ -483,8 +483,8 @@ public class SqlStorage implements StorageImplementation {
quester.getCurrentStage(quest).getItemsToConsume()));
data.itemsDelivered.addAll(deserializeItemStackProgress(rs.getString("items_delivered"),
quester.getCurrentStage(quest).getItemsToDeliver()));
data.citizensInteracted.addAll(deserializeBooleanProgress(rs.getString("npcs_interacted")));
data.citizensNumKilled.addAll(deserializeIntProgress(rs.getString("npcs_killed")));
data.npcsInteracted.addAll(deserializeBooleanProgress(rs.getString("npcs_interacted")));
data.npcsNumKilled.addAll(deserializeIntProgress(rs.getString("npcs_killed")));
data.mobNumKilled.addAll(deserializeIntProgress(rs.getString("mobs_killed")));
data.mobsTamed.addAll(deserializeIntProgress(rs.getString("mobs_tamed")));
data.setFishCaught(rs.getInt("fish_caught"));

View File

@ -69,7 +69,8 @@ questEditorDefaultFinishMessage: "Well done!"
questEditorEnterQuestName: "Enter quest name, <cancel>"
questEditorEnterAskMessage: "Enter ask message, <cancel>"
questEditorEnterFinishMessage: "Enter finish message, <cancel>"
questEditorEnterNPCStart: "Enter NPC ID, <clear>, <cancel>"
questEditorEnterNPCStart: "Enter NPC UUID, <clear>, <cancel>"
questEditorClickNPCStart: "Click on a NPC, <clear>, <cancel>"
questEditorEnterBlockStart: "Right-click on a block to use as a start point, <done>, <clear>, <cancel>"
questDungeonsCreate: "Players added to this group may perform quests together!"
questDungeonsDisband: "The quest group was disbanded."
@ -167,7 +168,6 @@ stageEditorSetEnchantAmounts: "Set enchant amounts"
stageEditorSetMobAmounts: "Set mob amounts"
stageEditorSetEnchantments: "Set enchantments"
stageEditorSetItemNames: "Set item names"
stageEditorSetKillIds: "Set NPC IDs"
stageEditorSetMobTypes: "Set mob types"
stageEditorSetKillLocations: "Set kill locations"
stageEditorSetKillLocationRadii: "Set kill location radii"
@ -199,8 +199,6 @@ stageEditorKillPlayerPrompt: "Enter number of players to kill, <clear>, <cancel>
stageEditorEnchantTypePrompt: "Enter enchantment names, <space>, <cancel>"
stageEditorEnchantAmountsPrompt: "Enter enchant amounts (numbers), <space>, <cancel>"
stageEditorItemNamesPrompt: "Enter item names, <space>, <cancel>"
stageEditorNPCPrompt: "Enter NPC IDs, <space>, <cancel>"
stageEditorNPCToTalkToPrompt: "Enter NPC IDs, <space>, <clear>, <cancel>"
stageEditorDeliveryMessagesPrompt: "Enter delivery messages, <semicolon>, <cancel>"
stageEditorKillNPCsPrompt: "Enter kill amounts (numbers), <space>, <cancel>"
stageEditorMobsPrompt: "Enter mob names, <space>, <cancel>"
@ -227,12 +225,12 @@ stageEditorCompleteMessagePrompt: "Enter complete message, <clear>, <cancel>"
stageEditorPasswordDisplayPrompt: "Enter password hints, <semicolon>, <cancel>"
stageEditorPasswordPhrasePrompt: "Enter password phrases, <semicolon>, <cancel>"
stageEditorDeliveryAddItem: "Add item"
stageEditorDeliveryNPCs: "Set NPC IDs"
stageEditorNPCUniqueIds: "Add NPC UUIDs"
stageEditorDeliveryMessages: "Set partial delivery messages"
stageEditorNotSolid: "is not a solid block!"
stageEditorInvalidBlockName: "is not a valid block name!"
stageEditorInvalidEnchantment: "is not a valid enchantment name!"
stageEditorInvalidNPC: "is not a valid NPC ID!"
stageEditorInvalidNPC: "is not a valid NPC UUID!"
stageEditorInvalidMob: "is not a valid mob name!"
stageEditorInvalidItemName: "is not a valid item name!"
stageEditorInvalidDye: "is not a valid dye color!"
@ -243,7 +241,8 @@ stageEditorInvalidScript: "Denizen script not found!"
stageEditorNoCitizens: "Citizens is not installed!"
stageEditorNoDenizen: "Denizen is not installed!"
stageEditorPositiveAmount: "You must enter a positive number!"
stageEditorNotListofNumbers: "is not a list of numbers!"
stageEditorNotListOfNumbers: "<data> is not a list of numbers!"
stageEditorNotListOfUniqueIds: "<data> is not a list of valid UUIDs!"
stageEditorNoDelaySet: "You must set a delay first!"
stageEditorNoItems: "You must add items first!"
stageEditorNoDeliveryMessage: "You must set at least one delivery message!"
@ -404,7 +403,6 @@ conditionEditorRideNPC: "Ride NPC"
conditionEditorEntitiesTitle: "- Entities -"
conditionEditorEntitiesPrompt: "Enter entity names, <space>, <cancel>"
conditionEditorNpcsTitle: "- NPCs -"
conditionEditorNpcsPrompt: "Enter NPC IDs, <space>, <cancel>"
conditionEditorPermissions: "Own permission"
conditionEditorPermissionsPrompt: "Enter permission nodes, <space>, <cancel>"
conditionEditorItemsInMainHand: "Hold in main hand"
@ -467,6 +465,7 @@ reqHeroesNotSecondary: "The <class> class is not secondary!"
reqHeroesSecondaryCleared: "Heroes Secondary Class requirement cleared."
reqHeroesClassNotFound: "Class not found!"
reqNotANumber: "<input> is not a number!"
reqNotAUniqueId: "<input> is not a valid UUID!"
reqMustAddItem: "You must add at least one item first!"
reqNoMessage: "You must set a fail requirements message!"
plnStart: "Set start date"
@ -774,7 +773,8 @@ noIdsSet: "No IDs set"
noNamesSet: "No names set"
worlds: "Worlds"
points: "points"
npcHint: "Note: You can click on NPCs to get their ID."
enterNpcUniqueIds: "Enter NPC UUIDs, <space>, <cancel>"
enterOrClearNpcUniqueIds: "Enter NPC UUIDs, <space>, <clear>, <cancel>"
listsNotSameSize: "All required lists must have the same number of entries!"
listDuplicate: "List contains duplicates!"
id: "ID"

2
dist/pom.xml vendored
View File

@ -5,7 +5,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>4.3.1</version>
<version>4.4.0</version>
</parent>
<artifactId>quests-dist</artifactId>
<packaging>pom</packaging>

View File

@ -6,12 +6,12 @@
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>4.3.1</version>
<version>4.4.0</version>
<name>quests</name>
<url>https://github.com/PikaMug/Quests/</url>
<properties>
<revision>4.3.1</revision>
<revision>4.4.0</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>4.3.1</version>
<version>4.4.0</version>
</parent>
<properties>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>4.3.1</version>
<version>4.4.0</version>
</parent>
<properties>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>me.blackvein.quests</groupId>
<artifactId>quests-parent</artifactId>
<version>4.3.1</version>
<version>4.4.0</version>
</parent>
<properties>