mirror of
https://github.com/PikaMug/Quests.git
synced 2025-01-09 18:08:20 +01:00
Parties 3.0.0 support (#1555)
* Updated Parties support * Fixed multiplayer everything * Add missing space for legacy string, fixes #1516 * Address formatting problems in initial menu prompts * Do not proceed on invalid entity type, fixes #1520 * Click to register NPC listener if Citizens link failed at startup * Populate objective goals when retrieving fresh quest data, fixes #1515 * Fixed typo in quest points log * Added new Parties options for offline players and distance * Added Parties experience reward * Fix error on last stage completion * Fixed Parties distance calculation * Reworked how multiplayer sharing 1 works and require same quest * Properly store repeat/cooldown values greater than max int, fixes #1523 * New Crowdin updates (#1524) * New translations strings.yml (Thai) * New translations strings.yml (Estonian) * New translations strings.yml (Thai) * New translations strings.yml (Thai) * New translations strings.yml (Thai) * Update quest main prompt strings * Update quest main prompt strings, part 2 * Update quest main prompt strings, part 3 * New Crowdin updates (#1525) * New translations strings.yml (Pirate English) * New translations strings.yml (Hindi) * New translations strings.yml (Serbian (Latin)) * New translations strings.yml (Estonian) * New translations strings.yml (Norwegian Bokmal) * New translations strings.yml (English) * New translations strings.yml (Arabic) * New translations strings.yml (Serbian (Cyrillic)) * New translations strings.yml (Sinhala) * New translations strings.yml (Pirate English) * New translations strings.yml (Hindi) * New translations strings.yml (Serbian (Latin)) * New translations strings.yml (Estonian) * New translations strings.yml (Norwegian Bokmal) * New translations strings.yml (English) * New translations strings.yml (Arabic) * New translations strings.yml (Serbian (Cyrillic)) * New translations strings.yml (Sinhala) * Update README.md * NEW load shared quests to memory via /import folder * Provide additional context for failed requirement quests, fixes #1530 * Use quest IDs instead of names for YAML implementation of quester data * Remove initial action from main quests prompt, functional as legacy only * New Crowdin updates (#1533) * New translations strings.yml (Polish) * New translations strings.yml (Pirate English) * New translations strings.yml (Vietnamese) * New translations strings.yml (Portuguese, Brazilian) * New translations strings.yml (Indonesian) * New translations strings.yml (Thai) * New translations strings.yml (Croatian) * New translations strings.yml (Hindi) * New translations strings.yml (Filipino) * New translations strings.yml (Chinese Simplified) * New translations strings.yml (Serbian (Latin)) * New translations strings.yml (LOLCAT) * New translations strings.yml (Spanish) * New translations strings.yml (Chinese Traditional) * New translations strings.yml (Estonian) * New translations strings.yml (Norwegian Bokmal) * New translations strings.yml (English) * New translations strings.yml (Turkish) * New translations strings.yml (Romanian) * New translations strings.yml (Hungarian) * New translations strings.yml (French) * New translations strings.yml (Arabic) * New translations strings.yml (Czech) * New translations strings.yml (Danish) * New translations strings.yml (German) * New translations strings.yml (Finnish) * New translations strings.yml (Italian) * New translations strings.yml (Swedish) * New translations strings.yml (Japanese) * New translations strings.yml (Korean) * New translations strings.yml (Dutch) * New translations strings.yml (Portuguese) * New translations strings.yml (Russian) * New translations strings.yml (Serbian (Cyrillic)) * New translations strings.yml (Sinhala) * New translations strings.yml (English) * New translations strings.yml (Pirate English) * Call password objective event on sync to prevent exception * Address certain objectives not progressing, fixes #1535 * Update quest completion messages to adhere to modern strings * Correct erroneous enchantment string functionality, fixes #1538 * New Crowdin updates (#1543) * New translations strings.yml (Thai) * New translations strings.yml (Croatian) * New translations strings.yml (Hindi) * New translations strings.yml (Serbian (Latin)) * New translations strings.yml (Estonian) * New translations strings.yml (Norwegian Bokmal) * New translations strings.yml (Romanian) * New translations strings.yml (Arabic) * New translations strings.yml (Finnish) * New translations strings.yml (Swedish) * New translations strings.yml (Japanese) * New translations strings.yml (Portuguese) * New translations strings.yml (Serbian (Cyrillic)) * New translations strings.yml (Sinhala) * New Crowdin updates (#1544) * New translations strings.yml (Polish) * New translations strings.yml (Pirate English) * New translations strings.yml (Vietnamese) * New translations strings.yml (Portuguese, Brazilian) * New translations strings.yml (Indonesian) * New translations strings.yml (Filipino) * New translations strings.yml (Chinese Simplified) * New translations strings.yml (LOLCAT) * New translations strings.yml (Spanish) * New translations strings.yml (Chinese Traditional) * New translations strings.yml (English) * New translations strings.yml (Turkish) * New translations strings.yml (Hungarian) * New translations strings.yml (French) * New translations strings.yml (Czech) * New translations strings.yml (Danish) * New translations strings.yml (German) * New translations strings.yml (Italian) * New translations strings.yml (Korean) * New translations strings.yml (Dutch) * New translations strings.yml (Russian) * Bump version * Add missing disable-command-feedback config check (#1547) * Translate quest item reward name if applicable, fixes #1548 * Prevent sending of most empty quester strings, fixes #1545 * New Crowdin updates (#1551) * New translations strings.yml (Polish) * New translations strings.yml (Pirate English) * New translations strings.yml (Vietnamese) * New translations strings.yml (Portuguese, Brazilian) * New translations strings.yml (Indonesian) * New translations strings.yml (Thai) * New translations strings.yml (Croatian) * New translations strings.yml (Hindi) * New translations strings.yml (Filipino) * New translations strings.yml (Chinese Simplified) * New translations strings.yml (Serbian (Latin)) * New translations strings.yml (LOLCAT) * New translations strings.yml (Spanish) * New translations strings.yml (Chinese Traditional) * New translations strings.yml (Estonian) * New translations strings.yml (Norwegian Bokmal) * New translations strings.yml (English) * New translations strings.yml (Turkish) * New translations strings.yml (Romanian) * New translations strings.yml (Hungarian) * New translations strings.yml (French) * New translations strings.yml (Arabic) * New translations strings.yml (Czech) * New translations strings.yml (Danish) * New translations strings.yml (German) * New translations strings.yml (Finnish) * New translations strings.yml (Italian) * New translations strings.yml (Swedish) * New translations strings.yml (Japanese) * New translations strings.yml (Korean) * New translations strings.yml (Dutch) * New translations strings.yml (Portuguese) * New translations strings.yml (Russian) * New translations strings.yml (Serbian (Cyrillic)) * New translations strings.yml (Sinhala) * New translations strings.yml (Polish) * New translations strings.yml (Vietnamese) * New translations strings.yml (Portuguese, Brazilian) * New translations strings.yml (Indonesian) * New translations strings.yml (Thai) * New translations strings.yml (Filipino) * New translations strings.yml (Chinese Simplified) * New translations strings.yml (LOLCAT) * New translations strings.yml (Spanish) * New translations strings.yml (Chinese Traditional) * New translations strings.yml (Estonian) * New translations strings.yml (Turkish) * New translations strings.yml (Hungarian) * New translations strings.yml (French) * New translations strings.yml (Czech) * New translations strings.yml (Danish) * New translations strings.yml (German) * New translations strings.yml (Italian) * New translations strings.yml (Korean) * New translations strings.yml (Dutch) * New translations strings.yml (Russian) * Fixed multiplayer everything * Reworked how multiplayer sharing 1 works and require same quest * Updated Parties dependency * Improved Parties messages on join/leave * Further fixes about multiplayer sharing * Wrong method fix * Fixed documentation about deprecated method Co-authored-by: PikaMug <2267126+PikaMug@users.noreply.github.com> Co-authored-by: datatags <datatags@users.noreply.github.com>
This commit is contained in:
parent
5d29779bc8
commit
733aa326da
12
main/pom.xml
12
main/pom.xml
@ -18,11 +18,6 @@
|
|||||||
<id>jitpack.io</id>
|
<id>jitpack.io</id>
|
||||||
<url>https://jitpack.io</url>
|
<url>https://jitpack.io</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
|
||||||
<!-- Parties -->
|
|
||||||
<id>codemc-repo</id>
|
|
||||||
<url>https://repo.codemc.org/repository/maven-public/</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>spigot-repo</id>
|
<id>spigot-repo</id>
|
||||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||||
@ -35,6 +30,11 @@
|
|||||||
<id>sk89q-repo</id>
|
<id>sk89q-repo</id>
|
||||||
<url>http://maven.sk89q.com/repo/</url>
|
<url>http://maven.sk89q.com/repo/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<!-- Parties -->
|
||||||
|
<id>alessiodp-repo</id>
|
||||||
|
<url>https://repo.alessiodp.com/releases/</url>
|
||||||
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>placeholderapi</id>
|
<id>placeholderapi</id>
|
||||||
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||||
@ -119,7 +119,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alessiodp.parties</groupId>
|
<groupId>com.alessiodp.parties</groupId>
|
||||||
<artifactId>parties-api</artifactId>
|
<artifactId>parties-api</artifactId>
|
||||||
<version>2.6.3</version>
|
<version>3.0.0-rc.1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -18,8 +18,10 @@ public class Options {
|
|||||||
private boolean ignoreSilkTouch = true;
|
private boolean ignoreSilkTouch = true;
|
||||||
private boolean useDungeonsXLPlugin = false;
|
private boolean useDungeonsXLPlugin = false;
|
||||||
private boolean usePartiesPlugin = true;
|
private boolean usePartiesPlugin = true;
|
||||||
|
private boolean partiesHandleOfflinePlayers = false;
|
||||||
|
private long partiesDistance = 0;
|
||||||
private int shareProgressLevel = 1;
|
private int shareProgressLevel = 1;
|
||||||
private boolean requireSameQuest = true;
|
private boolean shareOnlySameQuest = true;
|
||||||
|
|
||||||
public boolean canAllowCommands() {
|
public boolean canAllowCommands() {
|
||||||
return allowCommands;
|
return allowCommands;
|
||||||
@ -61,6 +63,22 @@ public class Options {
|
|||||||
this.usePartiesPlugin = usePartiesPlugin;
|
this.usePartiesPlugin = usePartiesPlugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean canPartiesHandleOfflinePlayers() {
|
||||||
|
return partiesHandleOfflinePlayers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPartiesHandleOfflinePlayers(final boolean partiesHandleOfflinePlayers) {
|
||||||
|
this.partiesHandleOfflinePlayers = partiesHandleOfflinePlayers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getPartiesDistance() {
|
||||||
|
return partiesDistance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPartiesDistance(final long partiesDistance) {
|
||||||
|
this.partiesDistance = partiesDistance;
|
||||||
|
}
|
||||||
|
|
||||||
public int getShareProgressLevel() {
|
public int getShareProgressLevel() {
|
||||||
return shareProgressLevel;
|
return shareProgressLevel;
|
||||||
}
|
}
|
||||||
@ -69,11 +87,11 @@ public class Options {
|
|||||||
this.shareProgressLevel = shareProgressLevel;
|
this.shareProgressLevel = shareProgressLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canRequireSameQuest() {
|
public boolean canShareOnlySameQuest() {
|
||||||
return requireSameQuest;
|
return shareOnlySameQuest;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRequireSameQuest(final boolean requireSameQuest) {
|
public void setShareOnlySameQuest(final boolean shareOnlySameQuest) {
|
||||||
this.requireSameQuest = requireSameQuest;
|
this.shareOnlySameQuest = shareOnlySameQuest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,8 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import com.alessiodp.parties.api.interfaces.Party;
|
||||||
|
import com.alessiodp.parties.api.interfaces.PartyPlayer;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.DyeColor;
|
import org.bukkit.DyeColor;
|
||||||
@ -491,11 +493,21 @@ public class Quest implements Comparable<Quest> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Proceed to finish this quest, issuing applicable rewards
|
* Proceed to finish this quest, issuing applicable rewards
|
||||||
*
|
*
|
||||||
* @param q The quester finishing this quest
|
* @param q The quester finishing this quest
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public void completeQuest(final Quester q) {
|
public void completeQuest(final Quester q) {
|
||||||
|
completeQuest(q, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Proceed to finish this quest, issuing applicable rewards
|
||||||
|
*
|
||||||
|
* @param q The quester finishing this quest
|
||||||
|
* @param allowMultiplayer Allow multiplayer sharing
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public void completeQuest(final Quester q, boolean allowMultiplayer) {
|
||||||
final OfflinePlayer player = q.getOfflinePlayer();
|
final OfflinePlayer player = q.getOfflinePlayer();
|
||||||
if (player.isOnline()) {
|
if (player.isOnline()) {
|
||||||
final QuesterPreCompleteQuestEvent preEvent = new QuesterPreCompleteQuestEvent(q, this);
|
final QuesterPreCompleteQuestEvent preEvent = new QuesterPreCompleteQuestEvent(q, this);
|
||||||
@ -621,6 +633,19 @@ public class Quest implements Comparable<Quest> {
|
|||||||
issuedReward = true;
|
issuedReward = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (rews.getPartiesExperience() > 0 && plugin.getDependencies().getPartiesApi() != null) {
|
||||||
|
PartyPlayer partyPlayer = plugin.getDependencies().getPartiesApi().getPartyPlayer(player.getUniqueId());
|
||||||
|
if (partyPlayer != null && partyPlayer.getPartyId() != null) {
|
||||||
|
Party party = plugin.getDependencies().getPartiesApi().getParty(partyPlayer.getPartyId());
|
||||||
|
if (party != null) {
|
||||||
|
party.giveExperience(rews.getPartiesExperience());
|
||||||
|
issuedReward = true;
|
||||||
|
if (plugin.getSettings().getConsoleLogging() > 2) {
|
||||||
|
plugin.getLogger().info(player.getUniqueId() + " was rewarded " + rews.getPartiesExperience() + " party experience");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
final LinkedList<ItemStack> phatLootItems = new LinkedList<ItemStack>();
|
final LinkedList<ItemStack> phatLootItems = new LinkedList<ItemStack>();
|
||||||
int phatLootExp = 0;
|
int phatLootExp = 0;
|
||||||
final LinkedList<String> phatLootMessages = new LinkedList<String>();
|
final LinkedList<String> phatLootMessages = new LinkedList<String>();
|
||||||
@ -676,7 +701,7 @@ public class Quest implements Comparable<Quest> {
|
|||||||
if (rews.getQuestPoints() > 0) {
|
if (rews.getQuestPoints() > 0) {
|
||||||
q.questPoints += rews.getQuestPoints();
|
q.questPoints += rews.getQuestPoints();
|
||||||
if (plugin.getSettings().getConsoleLogging() > 2) {
|
if (plugin.getSettings().getConsoleLogging() > 2) {
|
||||||
plugin.getLogger().info(player.getUniqueId() + " was rewarded " + rews.getQuestPoints()
|
plugin.getLogger().info(player.getUniqueId() + " was rewarded " + rews.getQuestPoints() + " "
|
||||||
+ Lang.get("questPoints"));
|
+ Lang.get("questPoints"));
|
||||||
}
|
}
|
||||||
issuedReward = true;
|
issuedReward = true;
|
||||||
@ -863,6 +888,10 @@ public class Quest implements Comparable<Quest> {
|
|||||||
+ s + " " + Lang.get(p, "experience"));
|
+ s + " " + Lang.get(p, "experience"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (rews.getPartiesExperience() > 0) {
|
||||||
|
p.sendMessage("- " + ChatColor.DARK_GREEN + rews.getPartiesExperience() + ChatColor.DARK_PURPLE + " "
|
||||||
|
+ Lang.get(p, "partiesExperience"));
|
||||||
|
}
|
||||||
if (phatLootMessages.isEmpty() == false) {
|
if (phatLootMessages.isEmpty() == false) {
|
||||||
for (final String s : phatLootMessages) {
|
for (final String s : phatLootMessages) {
|
||||||
q.sendMessage("- " + s);
|
q.sendMessage("- " + s);
|
||||||
@ -908,11 +937,11 @@ public class Quest implements Comparable<Quest> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Multiplayer
|
// Multiplayer
|
||||||
if (opts.getShareProgressLevel() == 4) {
|
if (allowMultiplayer && opts.getShareProgressLevel() == 4) {
|
||||||
final List<Quester> mq = q.getMultiplayerQuesters(this);
|
final List<Quester> mq = q.getMultiplayerQuesters(this);
|
||||||
for (final Quester qq : mq) {
|
for (final Quester qq : mq) {
|
||||||
if (qq.getQuestData(this) != null) {
|
if (qq.getQuestData(this) != null) {
|
||||||
completeQuest(qq);
|
completeQuest(qq, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,6 +251,9 @@ public class QuestFactory implements ConversationAbandonedListener {
|
|||||||
context.setSessionData(CK.REW_HEROES_CLASSES, rews.getHeroesClasses());
|
context.setSessionData(CK.REW_HEROES_CLASSES, rews.getHeroesClasses());
|
||||||
context.setSessionData(CK.REW_HEROES_AMOUNTS, rews.getHeroesAmounts());
|
context.setSessionData(CK.REW_HEROES_AMOUNTS, rews.getHeroesAmounts());
|
||||||
}
|
}
|
||||||
|
if (rews.getPartiesExperience() != 0) {
|
||||||
|
context.setSessionData(CK.REW_PARTIES_EXPERIENCE, rews.getPhatLoots());
|
||||||
|
}
|
||||||
if (rews.getPhatLoots().isEmpty() == false) {
|
if (rews.getPhatLoots().isEmpty() == false) {
|
||||||
context.setSessionData(CK.REW_PHAT_LOOTS, rews.getPhatLoots());
|
context.setSessionData(CK.REW_PHAT_LOOTS, rews.getPhatLoots());
|
||||||
}
|
}
|
||||||
@ -282,7 +285,7 @@ public class QuestFactory implements ConversationAbandonedListener {
|
|||||||
context.setSessionData(CK.OPT_USE_DUNGEONSXL_PLUGIN, opt.canUseDungeonsXLPlugin());
|
context.setSessionData(CK.OPT_USE_DUNGEONSXL_PLUGIN, opt.canUseDungeonsXLPlugin());
|
||||||
context.setSessionData(CK.OPT_USE_PARTIES_PLUGIN, opt.canUsePartiesPlugin());
|
context.setSessionData(CK.OPT_USE_PARTIES_PLUGIN, opt.canUsePartiesPlugin());
|
||||||
context.setSessionData(CK.OPT_SHARE_PROGRESS_LEVEL, opt.getShareProgressLevel());
|
context.setSessionData(CK.OPT_SHARE_PROGRESS_LEVEL, opt.getShareProgressLevel());
|
||||||
context.setSessionData(CK.OPT_REQUIRE_SAME_QUEST, opt.canRequireSameQuest());
|
context.setSessionData(CK.OPT_SHARE_ONLY_SAME_QUEST, opt.canShareOnlySameQuest());
|
||||||
// Stages (Objectives)
|
// Stages (Objectives)
|
||||||
int index = 1;
|
int index = 1;
|
||||||
for (final Stage stage : q.getStages()) {
|
for (final Stage stage : q.getStages()) {
|
||||||
@ -892,6 +895,8 @@ public class QuestFactory implements ConversationAbandonedListener {
|
|||||||
? (List<String>) context.getSessionData(CK.REW_HEROES_CLASSES) : null);
|
? (List<String>) context.getSessionData(CK.REW_HEROES_CLASSES) : null);
|
||||||
rews.set("heroes-exp-amounts", context.getSessionData(CK.REW_HEROES_AMOUNTS) != null
|
rews.set("heroes-exp-amounts", context.getSessionData(CK.REW_HEROES_AMOUNTS) != null
|
||||||
? (List<Double>) context.getSessionData(CK.REW_HEROES_AMOUNTS) : null);
|
? (List<Double>) context.getSessionData(CK.REW_HEROES_AMOUNTS) : null);
|
||||||
|
rews.set("parties-experience", context.getSessionData(CK.REW_PARTIES_EXPERIENCE) != null
|
||||||
|
? (Integer) context.getSessionData(CK.REW_PARTIES_EXPERIENCE) : null);
|
||||||
rews.set("phat-loots", context.getSessionData(CK.REW_PHAT_LOOTS) != null
|
rews.set("phat-loots", context.getSessionData(CK.REW_PHAT_LOOTS) != null
|
||||||
? (List<String>) context.getSessionData(CK.REW_PHAT_LOOTS) : null);
|
? (List<String>) context.getSessionData(CK.REW_PHAT_LOOTS) : null);
|
||||||
final LinkedList<String> customRews = context.getSessionData(CK.REW_CUSTOM) != null
|
final LinkedList<String> customRews = context.getSessionData(CK.REW_CUSTOM) != null
|
||||||
@ -944,8 +949,8 @@ public class QuestFactory implements ConversationAbandonedListener {
|
|||||||
? (Boolean) context.getSessionData(CK.OPT_USE_PARTIES_PLUGIN) : null);
|
? (Boolean) context.getSessionData(CK.OPT_USE_PARTIES_PLUGIN) : null);
|
||||||
opts.set("share-progress-level", context.getSessionData(CK.OPT_SHARE_PROGRESS_LEVEL) != null
|
opts.set("share-progress-level", context.getSessionData(CK.OPT_SHARE_PROGRESS_LEVEL) != null
|
||||||
? (Integer) context.getSessionData(CK.OPT_SHARE_PROGRESS_LEVEL) : null);
|
? (Integer) context.getSessionData(CK.OPT_SHARE_PROGRESS_LEVEL) : null);
|
||||||
opts.set("require-same-quest", context.getSessionData(CK.OPT_REQUIRE_SAME_QUEST) != null
|
opts.set("share-only-same-quest", context.getSessionData(CK.OPT_SHARE_ONLY_SAME_QUEST) != null
|
||||||
? (Boolean) context.getSessionData(CK.OPT_REQUIRE_SAME_QUEST) : null);
|
? (Boolean) context.getSessionData(CK.OPT_SHARE_ONLY_SAME_QUEST) : null);
|
||||||
if (opts.getKeys(false).isEmpty()) {
|
if (opts.getKeys(false).isEmpty()) {
|
||||||
section.set("options", null);
|
section.set("options", null);
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,11 @@ import java.util.Random;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentSkipListSet;
|
import java.util.concurrent.ConcurrentSkipListSet;
|
||||||
|
import java.util.function.BiFunction;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.alessiodp.parties.api.interfaces.PartyPlayer;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.DyeColor;
|
import org.bukkit.DyeColor;
|
||||||
@ -616,7 +618,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
for (final String e : c.getPermissions()) {
|
for (final String e : c.getPermissions()) {
|
||||||
msg += ChatColor.AQUA + "\n \u2515 " + e;
|
msg += ChatColor.AQUA + "\n \u2515 " + e;
|
||||||
}
|
}
|
||||||
sendMessage(ChatColor.YELLOW + msg);
|
sendMessage(ChatColor.YELLOW + msg);
|
||||||
} else if (!c.getItemsWhileHoldingMainHand().isEmpty()) {
|
} else if (!c.getItemsWhileHoldingMainHand().isEmpty()) {
|
||||||
String msg = "- " + Lang.get("conditionEditorItemsInMainHand");
|
String msg = "- " + Lang.get("conditionEditorItemsInMainHand");
|
||||||
for (final ItemStack is : c.getItemsWhileHoldingMainHand()) {
|
for (final ItemStack is : c.getItemsWhileHoldingMainHand()) {
|
||||||
@ -1422,7 +1424,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
||||||
q.getQuestData(quest).blocksBroken.set(getQuestData(quest).blocksBroken
|
q.getQuestData(quest).blocksBroken.set(getQuestData(quest).blocksBroken
|
||||||
.indexOf(finalBroken), newBroken);
|
.indexOf(finalBroken), newBroken);
|
||||||
q.finishObjective(quest, new Objective(type, m, finalToBreak), null, null, null, null, null,
|
q.finishObjective(quest, new Objective(type, m, finalToBreak), null, null, null, null, null,
|
||||||
null, null);
|
null, null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
@ -1510,7 +1512,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
||||||
q.getQuestData(quest).blocksDamaged.set(getQuestData(quest).blocksDamaged
|
q.getQuestData(quest).blocksDamaged.set(getQuestData(quest).blocksDamaged
|
||||||
.indexOf(finalDamaged), newDamaged);
|
.indexOf(finalDamaged), newDamaged);
|
||||||
q.finishObjective(quest, new Objective(type, m, finalToDamage), null, null, null, null, null,
|
q.finishObjective(quest, new Objective(type, m, finalToDamage), null, null, null, null, null,
|
||||||
null, null);
|
null, null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
@ -1597,7 +1599,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
||||||
q.getQuestData(quest).blocksPlaced.set(getQuestData(quest).blocksPlaced
|
q.getQuestData(quest).blocksPlaced.set(getQuestData(quest).blocksPlaced
|
||||||
.indexOf(finalPlaced), newPlaced);
|
.indexOf(finalPlaced), newPlaced);
|
||||||
q.finishObjective(quest, new Objective(type, m, finalToPlace), null, null, null, null, null,
|
q.finishObjective(quest, new Objective(type, m, finalToPlace), null, null, null, null, null,
|
||||||
null, null);
|
null, null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
@ -1684,7 +1686,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
||||||
q.getQuestData(quest).blocksUsed.set(getQuestData(quest).blocksUsed
|
q.getQuestData(quest).blocksUsed.set(getQuestData(quest).blocksUsed
|
||||||
.indexOf(finalUsed), newUsed);
|
.indexOf(finalUsed), newUsed);
|
||||||
q.finishObjective(quest, new Objective(type, m, finalToUse), null, null, null, null, null, null,
|
q.finishObjective(quest, new Objective(type, m, finalToUse), null, null, null, null, null, null,
|
||||||
null);
|
null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
@ -1770,7 +1772,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
final ItemStack finalToCut = toCut;
|
final ItemStack finalToCut = toCut;
|
||||||
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
||||||
q.getQuestData(quest).blocksCut.set(getQuestData(quest).blocksCut.indexOf(finalCut), newCut);
|
q.getQuestData(quest).blocksCut.set(getQuestData(quest).blocksCut.indexOf(finalCut), newCut);
|
||||||
q.finishObjective(quest, new Objective(type, m, finalToCut), null, null, null, null, null, null,
|
q.finishObjective(quest, new Objective(type, m, finalToCut), null, null, null, null, null, null,
|
||||||
null);
|
null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
@ -1823,14 +1825,14 @@ public class Quester implements Comparable<Quester> {
|
|||||||
final Material m = i.getType();
|
final Material m = i.getType();
|
||||||
if (newAmount >= req) {
|
if (newAmount >= req) {
|
||||||
getQuestData(quest).itemsCrafted.put(found, req);
|
getQuestData(quest).itemsCrafted.put(found, req);
|
||||||
finishObjective(quest, new Objective(type, new ItemStack(m, 1), found), null, null, null, null, null,
|
finishObjective(quest, new Objective(type, new ItemStack(m, 1), found), null, null, null, null, null,
|
||||||
null, null);
|
null, null);
|
||||||
|
|
||||||
// Multiplayer
|
// Multiplayer
|
||||||
final ItemStack finalFound = found;
|
final ItemStack finalFound = found;
|
||||||
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
||||||
q.getQuestData(quest).itemsCrafted.put(finalFound, req);
|
q.getQuestData(quest).itemsCrafted.put(finalFound, req);
|
||||||
q.finishObjective(quest, new Objective(type, new ItemStack(m, 1), finalFound), null, null, null,
|
q.finishObjective(quest, new Objective(type, new ItemStack(m, 1), finalFound), null, null, null,
|
||||||
null, null, null, null);
|
null, null, null, null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
@ -1883,14 +1885,14 @@ public class Quester implements Comparable<Quester> {
|
|||||||
final Material m = i.getType();
|
final Material m = i.getType();
|
||||||
if (newAmount >= req) {
|
if (newAmount >= req) {
|
||||||
getQuestData(quest).itemsSmelted.put(found, req);
|
getQuestData(quest).itemsSmelted.put(found, req);
|
||||||
finishObjective(quest, new Objective(type, new ItemStack(m, 1), found), null, null, null, null, null,
|
finishObjective(quest, new Objective(type, new ItemStack(m, 1), found), null, null, null, null, null,
|
||||||
null, null);
|
null, null);
|
||||||
|
|
||||||
// Multiplayer
|
// Multiplayer
|
||||||
final ItemStack finalFound = found;
|
final ItemStack finalFound = found;
|
||||||
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
||||||
q.getQuestData(quest).itemsSmelted.put(finalFound, req);
|
q.getQuestData(quest).itemsSmelted.put(finalFound, req);
|
||||||
q.finishObjective(quest, new Objective(type, new ItemStack(m, 1), finalFound), null, null, null,
|
q.finishObjective(quest, new Objective(type, new ItemStack(m, 1), finalFound), null, null, null,
|
||||||
null, null, null, null);
|
null, null, null, null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
@ -1950,14 +1952,14 @@ public class Quester implements Comparable<Quester> {
|
|||||||
final Material m = i.getType();
|
final Material m = i.getType();
|
||||||
if (newAmount >= req) {
|
if (newAmount >= req) {
|
||||||
getQuestData(quest).itemsEnchanted.put(found, req);
|
getQuestData(quest).itemsEnchanted.put(found, req);
|
||||||
finishObjective(quest, new Objective(type, new ItemStack(m, 1), found), null, null, null, null, null,
|
finishObjective(quest, new Objective(type, new ItemStack(m, 1), found), null, null, null, null, null,
|
||||||
null, null);
|
null, null);
|
||||||
|
|
||||||
// Multiplayer
|
// Multiplayer
|
||||||
final ItemStack finalFound = found;
|
final ItemStack finalFound = found;
|
||||||
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
||||||
q.getQuestData(quest).itemsEnchanted.put(finalFound, req);
|
q.getQuestData(quest).itemsEnchanted.put(finalFound, req);
|
||||||
q.finishObjective(quest, new Objective(type, new ItemStack(m, 1), finalFound), null, null, null,
|
q.finishObjective(quest, new Objective(type, new ItemStack(m, 1), finalFound), null, null, null,
|
||||||
null, null, null, null);
|
null, null, null, null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
@ -2010,14 +2012,14 @@ public class Quester implements Comparable<Quester> {
|
|||||||
final Material m = i.getType();
|
final Material m = i.getType();
|
||||||
if (newAmount >= req) {
|
if (newAmount >= req) {
|
||||||
getQuestData(quest).itemsBrewed.put(found, req);
|
getQuestData(quest).itemsBrewed.put(found, req);
|
||||||
finishObjective(quest, new Objective(type, new ItemStack(m, 1), found), null, null, null, null, null,
|
finishObjective(quest, new Objective(type, new ItemStack(m, 1), found), null, null, null, null, null,
|
||||||
null, null);
|
null, null);
|
||||||
|
|
||||||
// Multiplayer
|
// Multiplayer
|
||||||
final ItemStack finalFound = found;
|
final ItemStack finalFound = found;
|
||||||
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
||||||
q.getQuestData(quest).itemsBrewed.put(finalFound, req);
|
q.getQuestData(quest).itemsBrewed.put(finalFound, req);
|
||||||
q.finishObjective(quest, new Objective(type, new ItemStack(m, 1), finalFound), null, null, null,
|
q.finishObjective(quest, new Objective(type, new ItemStack(m, 1), finalFound), null, null, null,
|
||||||
null, null, null, null);
|
null, null, null, null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
@ -2070,14 +2072,14 @@ public class Quester implements Comparable<Quester> {
|
|||||||
final Material m = i.getType();
|
final Material m = i.getType();
|
||||||
if (newAmount >= req) {
|
if (newAmount >= req) {
|
||||||
getQuestData(quest).itemsConsumed.put(found, req);
|
getQuestData(quest).itemsConsumed.put(found, req);
|
||||||
finishObjective(quest, new Objective(type, new ItemStack(m, 1), found), null, null, null, null, null,
|
finishObjective(quest, new Objective(type, new ItemStack(m, 1), found), null, null, null, null, null,
|
||||||
null, null);
|
null, null);
|
||||||
|
|
||||||
// Multiplayer
|
// Multiplayer
|
||||||
final ItemStack finalFound = found;
|
final ItemStack finalFound = found;
|
||||||
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
||||||
q.getQuestData(quest).itemsConsumed.put(finalFound, req);
|
q.getQuestData(quest).itemsConsumed.put(finalFound, req);
|
||||||
q.finishObjective(quest, new Objective(type, new ItemStack(m, 1), finalFound), null, null, null,
|
q.finishObjective(quest, new Objective(type, new ItemStack(m, 1), finalFound), null, null, null,
|
||||||
null, null, null, null);
|
null, null, null, null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
@ -2332,13 +2334,13 @@ public class Quester implements Comparable<Quester> {
|
|||||||
player.getInventory().setItem(index, null);
|
player.getInventory().setItem(index, null);
|
||||||
}
|
}
|
||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
finishObjective(quest, new Objective(type, new ItemStack(m, 1), found), null, null, null, null,
|
finishObjective(quest, new Objective(type, new ItemStack(m, 1), found), null, null, null, null,
|
||||||
null, null, null);
|
null, null, null);
|
||||||
|
|
||||||
// Multiplayer
|
// Multiplayer
|
||||||
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
||||||
q.getQuestData(quest).itemsDelivered.set(items.indexOf(found), newStack);
|
q.getQuestData(quest).itemsDelivered.set(items.indexOf(found), newStack);
|
||||||
q.finishObjective(quest, new Objective(type, new ItemStack(m, 1), found), null, null, null,
|
q.finishObjective(quest, new Objective(type, new ItemStack(m, 1), found), null, null, null,
|
||||||
null, null, null, null);
|
null, null, null, null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
@ -2484,7 +2486,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
if (locationsReached <= index) {
|
if (locationsReached <= index) {
|
||||||
getQuestData(quest).hasReached.add(true);
|
getQuestData(quest).hasReached.add(true);
|
||||||
finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
||||||
new ItemStack(Material.AIR, 1)), null, null, null, location, null, null,
|
new ItemStack(Material.AIR, 1)), null, null, null, location, null, null,
|
||||||
null);
|
null);
|
||||||
} else if (getQuestData(quest).hasReached.get(index) == false) {
|
} else if (getQuestData(quest).hasReached.get(index) == false) {
|
||||||
getQuestData(quest).hasReached.set(index, true);
|
getQuestData(quest).hasReached.set(index, true);
|
||||||
@ -2499,12 +2501,12 @@ public class Quester implements Comparable<Quester> {
|
|||||||
if (finalIndex >= getQuestData(quest).hasReached.size()) {
|
if (finalIndex >= getQuestData(quest).hasReached.size()) {
|
||||||
q.getQuestData(quest).hasReached.add(true);
|
q.getQuestData(quest).hasReached.add(true);
|
||||||
q.finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
q.finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
||||||
new ItemStack(Material.AIR, 1)), null, null, null, location, null,
|
new ItemStack(Material.AIR, 1)), null, null, null, location, null,
|
||||||
null, null);
|
null, null);
|
||||||
} else {
|
} else {
|
||||||
q.getQuestData(quest).hasReached.set(finalIndex, true);
|
q.getQuestData(quest).hasReached.set(finalIndex, true);
|
||||||
q.finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
q.finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
||||||
new ItemStack(Material.AIR, 1)), null, null, null, location, null,
|
new ItemStack(Material.AIR, 1)), null, null, null, location, null,
|
||||||
null, null);
|
null, null);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -2552,13 +2554,13 @@ public class Quester implements Comparable<Quester> {
|
|||||||
if (mobsTamed < mobsToTame) {
|
if (mobsTamed < mobsToTame) {
|
||||||
getQuestData(quest).mobsTamed.put(entity, newMobsToTame);
|
getQuestData(quest).mobsTamed.put(entity, newMobsToTame);
|
||||||
if (newMobsToTame >= mobsToTame) {
|
if (newMobsToTame >= mobsToTame) {
|
||||||
finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
||||||
new ItemStack(Material.AIR, mobsToTame)), entity, null, null, null, null, null, null);
|
new ItemStack(Material.AIR, mobsToTame)), entity, null, null, null, null, null, null);
|
||||||
|
|
||||||
// Multiplayer
|
// Multiplayer
|
||||||
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
||||||
q.getQuestData(quest).mobsTamed.put(entity, getQuestData(quest).mobsTamed.get(entity));
|
q.getQuestData(quest).mobsTamed.put(entity, getQuestData(quest).mobsTamed.get(entity));
|
||||||
q.finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
q.finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
||||||
new ItemStack(Material.AIR, mobsToTame)), entity, null, null, null, null, null, null);
|
new ItemStack(Material.AIR, mobsToTame)), entity, null, null, null, null, null, null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
@ -2592,13 +2594,13 @@ public class Quester implements Comparable<Quester> {
|
|||||||
if (sheepSheared < sheepToShear) {
|
if (sheepSheared < sheepToShear) {
|
||||||
getQuestData(quest).sheepSheared.put(color, newSheepSheared);
|
getQuestData(quest).sheepSheared.put(color, newSheepSheared);
|
||||||
if (newSheepSheared >= sheepToShear) {
|
if (newSheepSheared >= sheepToShear) {
|
||||||
finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
||||||
new ItemStack(Material.AIR, sheepToShear)), null, null, null, null, color, null, null);
|
new ItemStack(Material.AIR, sheepToShear)), null, null, null, null, color, null, null);
|
||||||
|
|
||||||
// Multiplayer
|
// Multiplayer
|
||||||
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
||||||
q.getQuestData(quest).sheepSheared.put(color, getQuestData(quest).sheepSheared.get(color));
|
q.getQuestData(quest).sheepSheared.put(color, getQuestData(quest).sheepSheared.get(color));
|
||||||
q.finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
q.finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
||||||
new ItemStack(Material.AIR, sheepToShear)), null, null, null, null, color, null, null);
|
new ItemStack(Material.AIR, sheepToShear)), null, null, null, null, color, null, null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
@ -2619,7 +2621,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
public void sayPassword(final Quest quest, final AsyncPlayerChatEvent evt) {
|
public void sayPassword(final Quest quest, final AsyncPlayerChatEvent evt) {
|
||||||
final ObjectiveType type = ObjectiveType.PASSWORD;
|
final ObjectiveType type = ObjectiveType.PASSWORD;
|
||||||
plugin.getServer().getScheduler().runTask(plugin, () -> {
|
plugin.getServer().getScheduler().runTask(plugin, () -> {
|
||||||
final QuesterPreUpdateObjectiveEvent preEvent = new QuesterPreUpdateObjectiveEvent(this, quest,
|
final QuesterPreUpdateObjectiveEvent preEvent = new QuesterPreUpdateObjectiveEvent(this, quest,
|
||||||
new Objective(type, 1, 1));
|
new Objective(type, 1, 1));
|
||||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||||
|
|
||||||
@ -2634,13 +2636,13 @@ public class Quester implements Comparable<Quester> {
|
|||||||
getQuestData(quest).passwordsSaid.put(display, true);
|
getQuestData(quest).passwordsSaid.put(display, true);
|
||||||
done = true;
|
done = true;
|
||||||
plugin.getServer().getScheduler().runTask(plugin, () -> {
|
plugin.getServer().getScheduler().runTask(plugin, () -> {
|
||||||
finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
||||||
new ItemStack(Material.AIR, 1)), null, null, null, null, null, display, null);
|
new ItemStack(Material.AIR, 1)), null, null, null, null, null, display, null);
|
||||||
|
|
||||||
// Multiplayer
|
// Multiplayer
|
||||||
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
dispatchMultiplayerObjectives(quest, getCurrentStage(quest), (final Quester q) -> {
|
||||||
q.getQuestData(quest).passwordsSaid.put(display, true);
|
q.getQuestData(quest).passwordsSaid.put(display, true);
|
||||||
q.finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
q.finishObjective(quest, new Objective(type, new ItemStack(Material.AIR, 1),
|
||||||
new ItemStack(Material.AIR, 1)), null, null, null, null, null, display, null);
|
new ItemStack(Material.AIR, 1)), null, null, null, null, null, display, null);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
@ -2654,7 +2656,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (done) {
|
if (done) {
|
||||||
final QuesterPostUpdateObjectiveEvent postEvent = new QuesterPostUpdateObjectiveEvent(this, quest,
|
final QuesterPostUpdateObjectiveEvent postEvent = new QuesterPostUpdateObjectiveEvent(this, quest,
|
||||||
new Objective(type, 1, 1));
|
new Objective(type, 1, 1));
|
||||||
plugin.getServer().getPluginManager().callEvent(postEvent);
|
plugin.getServer().getPluginManager().callEvent(postEvent);
|
||||||
}
|
}
|
||||||
@ -2814,12 +2816,12 @@ public class Quester implements Comparable<Quester> {
|
|||||||
}
|
}
|
||||||
if (plugin.getSettings().canTranslateNames() && is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
|
if (plugin.getSettings().canTranslateNames() && is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
|
||||||
// Bukkit version is 1.9+
|
// Bukkit version is 1.9+
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(),
|
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(),
|
||||||
goal.getEnchantments(), goal.getItemMeta());
|
goal.getEnchantments(), goal.getItemMeta());
|
||||||
} else if (plugin.getSettings().canTranslateNames() && !is.hasItemMeta()
|
} else if (plugin.getSettings().canTranslateNames() && !is.hasItemMeta()
|
||||||
&& Material.getMaterial("LINGERING_POTION") == null) {
|
&& Material.getMaterial("LINGERING_POTION") == null) {
|
||||||
// Bukkit version is below 1.9
|
// Bukkit version is below 1.9
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(),
|
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(),
|
||||||
goal.getEnchantments());
|
goal.getEnchantments());
|
||||||
} else {
|
} else {
|
||||||
for (final Entry<Enchantment, Integer> e : is.getEnchantments().entrySet()) {
|
for (final Entry<Enchantment, Integer> e : is.getEnchantments().entrySet()) {
|
||||||
@ -2839,12 +2841,12 @@ public class Quester implements Comparable<Quester> {
|
|||||||
}
|
}
|
||||||
if (plugin.getSettings().canTranslateNames() && is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
|
if (plugin.getSettings().canTranslateNames() && is.hasItemMeta() && !is.getItemMeta().hasDisplayName()) {
|
||||||
// Bukkit version is 1.9+
|
// Bukkit version is 1.9+
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(),
|
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(),
|
||||||
goal.getEnchantments(), goal.getItemMeta());
|
goal.getEnchantments(), goal.getItemMeta());
|
||||||
} else if (plugin.getSettings().canTranslateNames() && !is.hasItemMeta()
|
} else if (plugin.getSettings().canTranslateNames() && !is.hasItemMeta()
|
||||||
&& Material.getMaterial("LINGERING_POTION") == null) {
|
&& Material.getMaterial("LINGERING_POTION") == null) {
|
||||||
// Bukkit version is below 1.9
|
// Bukkit version is below 1.9
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(),
|
plugin.getLocaleQuery().sendMessage(p, message, goal.getType(), goal.getDurability(),
|
||||||
goal.getEnchantments());
|
goal.getEnchantments());
|
||||||
} else {
|
} else {
|
||||||
sendMessage(message.replace("<item>", ItemUtil.getName(is)));
|
sendMessage(message.replace("<item>", ItemUtil.getName(is)));
|
||||||
@ -2877,7 +2879,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
// Legacy
|
// Legacy
|
||||||
message += ChatColor.GREEN + ": " + is.getAmount() + "/" + is.getAmount();
|
message += ChatColor.GREEN + ": " + is.getAmount() + "/" + is.getAmount();
|
||||||
}
|
}
|
||||||
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
if (plugin.getSettings().canTranslateNames() && !goal.hasItemMeta()
|
||||||
&& !goal.getItemMeta().hasDisplayName()) {
|
&& !goal.getItemMeta().hasDisplayName()) {
|
||||||
plugin.getLocaleQuery().sendMessage(p, message, is.getType(), is.getDurability(), null);
|
plugin.getLocaleQuery().sendMessage(p, message, is.getType(), is.getDurability(), null);
|
||||||
} else {
|
} else {
|
||||||
@ -2907,7 +2909,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
||||||
} else {
|
} else {
|
||||||
// Legacy
|
// Legacy
|
||||||
message += ChatColor.AQUA + " <mob>" + ChatColor.GREEN + ": " + goal.getAmount() + "/"
|
message += ChatColor.AQUA + " <mob>" + ChatColor.GREEN + ": " + goal.getAmount() + "/"
|
||||||
+ goal.getAmount();
|
+ goal.getAmount();
|
||||||
}
|
}
|
||||||
if (plugin.getSettings().canTranslateNames()) {
|
if (plugin.getSettings().canTranslateNames()) {
|
||||||
@ -2934,7 +2936,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
message = message.replace("<count>", "" + ChatColor.GREEN + goal.getAmount() + "/" + goal.getAmount());
|
||||||
} else {
|
} else {
|
||||||
// Legacy
|
// Legacy
|
||||||
message += ChatColor.AQUA + " <mob>" + ChatColor.GREEN + ": " + goal.getAmount() + "/"
|
message += ChatColor.AQUA + " <mob>" + ChatColor.GREEN + ": " + goal.getAmount() + "/"
|
||||||
+ goal.getAmount();
|
+ goal.getAmount();
|
||||||
}
|
}
|
||||||
sendMessage(message.replace("<mob>", plugin.getDependencies().getNPCName(npc.getId())));
|
sendMessage(message.replace("<mob>", plugin.getDependencies().getNPCName(npc.getId())));
|
||||||
@ -3008,7 +3010,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
/**
|
/**
|
||||||
* Complete quest objective
|
* Complete quest objective
|
||||||
*
|
*
|
||||||
* @deprecated Use {@link #finishObjective(Quest, ObjectiveType, ItemStack, ItemStack, Enchantment, EntityType,
|
* @deprecated Use {@link #finishObjective(Quest, Objective, EntityType,
|
||||||
* String, NPC, Location, DyeColor, String, CustomObjective)}
|
* String, NPC, Location, DyeColor, String, CustomObjective)}
|
||||||
*
|
*
|
||||||
* @param quest
|
* @param quest
|
||||||
@ -3040,7 +3042,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
public void finishObjective(final Quest quest, final String objective, final ItemStack increment,
|
public void finishObjective(final Quest quest, final String objective, final ItemStack increment,
|
||||||
final ItemStack goal, final Enchantment enchantment, final EntityType mob, final String extra,
|
final ItemStack goal, final Enchantment enchantment, final EntityType mob, final String extra,
|
||||||
final NPC npc, final Location location, final DyeColor color, final String pass, final CustomObjective co) {
|
final NPC npc, final Location location, final DyeColor color, final String pass, final CustomObjective co) {
|
||||||
finishObjective(quest, new Objective(ObjectiveType.fromName(objective), increment, goal), mob, extra, npc,
|
finishObjective(quest, new Objective(ObjectiveType.fromName(objective), increment, goal), mob, extra, npc,
|
||||||
location, color, pass, co);
|
location, color, pass, co);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3954,13 +3956,13 @@ public class Quester implements Comparable<Quester> {
|
|||||||
* milkCow, catchFish, killMob, deliverItem, killPlayer, talkToNPC,
|
* milkCow, catchFish, killMob, deliverItem, killPlayer, talkToNPC,
|
||||||
* killNPC, tameMob, shearSheep, password, reachLocation
|
* killNPC, tameMob, shearSheep, password, reachLocation
|
||||||
*
|
*
|
||||||
* @deprecated Use {@link #dispatchMultiplayerEverything(Quest, ObjectiveType, Function)}
|
* @deprecated Use {@link #dispatchMultiplayerEverything(Quest, ObjectiveType, BiFunction)}
|
||||||
*
|
*
|
||||||
* @param objectiveType The type of objective to progress
|
* @param objectiveType The type of objective to progress
|
||||||
* @param fun The function to execute, the event call
|
* @param fun The function to execute, the event call
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void dispatchMultiplayerEverything(final Quest quest, final String objectiveType, final Function<Quester, Void> fun) {
|
public void dispatchMultiplayerEverything(final Quest quest, final String objectiveType, final BiFunction<Quester, Quest, Void> fun) {
|
||||||
dispatchMultiplayerEverything(quest, ObjectiveType.fromName(objectiveType), fun);
|
dispatchMultiplayerEverything(quest, ObjectiveType.fromName(objectiveType), fun);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3970,7 +3972,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
* @param type The type of objective to progress
|
* @param type The type of objective to progress
|
||||||
* @param fun The function to execute, the event call
|
* @param fun The function to execute, the event call
|
||||||
*/
|
*/
|
||||||
public void dispatchMultiplayerEverything(final Quest quest, final ObjectiveType type, final Function<Quester, Void> fun) {
|
public void dispatchMultiplayerEverything(final Quest quest, final ObjectiveType type, final BiFunction<Quester, Quest, Void> fun) {
|
||||||
if (quest == null) {
|
if (quest == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3982,19 +3984,18 @@ public class Quester implements Comparable<Quester> {
|
|||||||
}
|
}
|
||||||
for (final Quester q : mq) {
|
for (final Quester q : mq) {
|
||||||
if (q == null) {
|
if (q == null) {
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
if (q.getCurrentStage(quest) == null) {
|
if (quest.getOptions().canShareOnlySameQuest()) {
|
||||||
return;
|
if (q.getCurrentStage(quest) != null) {
|
||||||
}
|
fun.apply(q, quest);
|
||||||
if (q.getCurrentStage(quest).containsObjective(type)) {
|
|
||||||
if (this.getCurrentStage(quest) == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (this.getCurrentStage(quest).containsObjective(type)
|
|
||||||
|| !quest.getOptions().canRequireSameQuest()) {
|
|
||||||
fun.apply(q);
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
q.getCurrentQuests().forEach((otherQuest, i) -> {
|
||||||
|
if (otherQuest.getStage(i).containsObjective(type)) {
|
||||||
|
fun.apply(q, otherQuest);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4024,8 +4025,9 @@ public class Quester implements Comparable<Quester> {
|
|||||||
if (q == null) {
|
if (q == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((q.getCurrentQuests().containsKey(quest) && currentStage.equals(q.getCurrentStage(quest)))
|
// Share only same quest is not necessary here
|
||||||
|| !quest.getOptions().canRequireSameQuest()) {
|
// The function must be applied to the same quest
|
||||||
|
if ((q.getCurrentQuests().containsKey(quest) && currentStage.equals(q.getCurrentStage(quest)))) {
|
||||||
fun.apply(q);
|
fun.apply(q);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4045,15 +4047,34 @@ public class Quester implements Comparable<Quester> {
|
|||||||
final List<Quester> mq = new LinkedList<Quester>();
|
final List<Quester> mq = new LinkedList<Quester>();
|
||||||
if (plugin.getDependencies().getPartiesApi() != null) {
|
if (plugin.getDependencies().getPartiesApi() != null) {
|
||||||
if (quest.getOptions().canUsePartiesPlugin()) {
|
if (quest.getOptions().canUsePartiesPlugin()) {
|
||||||
final Party party = plugin.getDependencies().getPartiesApi().getParty(plugin.getDependencies()
|
final PartyPlayer partyPlayer = plugin.getDependencies().getPartiesApi().getPartyPlayer(getUUID());
|
||||||
.getPartiesApi().getPartyPlayer(getUUID()).getPartyName());
|
if (partyPlayer != null && partyPlayer.getPartyId() != null) {
|
||||||
if (party != null) {
|
final Party party = plugin.getDependencies().getPartiesApi().getParty(partyPlayer.getPartyId());
|
||||||
for (final UUID id : party.getMembers()) {
|
if (party != null) {
|
||||||
if (!id.equals(getUUID())) {
|
long distanceSquared = quest.getOptions().getPartiesDistance() * quest.getOptions().getPartiesDistance();
|
||||||
mq.add(plugin.getQuester(id));
|
boolean offlinePlayers = quest.getOptions().canPartiesHandleOfflinePlayers();
|
||||||
|
if (offlinePlayers) {
|
||||||
|
for (final UUID id : party.getMembers()) {
|
||||||
|
if (!id.equals(getUUID())) {
|
||||||
|
mq.add(plugin.getQuester(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (final PartyPlayer pp : party.getOnlineMembers(true)) {
|
||||||
|
if (!pp.getPlayerUUID().equals(getUUID())) {
|
||||||
|
if (distanceSquared > 0) {
|
||||||
|
Player player = Bukkit.getPlayer(pp.getPlayerUUID());
|
||||||
|
if (player != null && distanceSquared >= getPlayer().getLocation().distanceSquared(player.getLocation())) {
|
||||||
|
mq.add(plugin.getQuester(pp.getPlayerUUID()));
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
mq.add(plugin.getQuester(pp.getPlayerUUID()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return mq;
|
||||||
}
|
}
|
||||||
return mq;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1876,6 +1876,15 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (depends.isPluginAvailable("Parties")) {
|
||||||
|
if (config.contains("quests." + questKey + ".rewards.parties-experience")) {
|
||||||
|
if (config.getInt("quests." + questKey + ".rewards.parties-experience", -999) != -999) {
|
||||||
|
rews.setPartiesExperience(config.getInt("quests." + questKey + ".rewards.parties-experience"));
|
||||||
|
} else {
|
||||||
|
throw new QuestFormatException("Reward Parties experience is not a number", questKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (depends.isPluginAvailable("PhatLoots")) {
|
if (depends.isPluginAvailable("PhatLoots")) {
|
||||||
if (config.contains("quests." + questKey + ".rewards.phat-loots")) {
|
if (config.contains("quests." + questKey + ".rewards.phat-loots")) {
|
||||||
if (ConfigUtil.checkList(config.getList("quests." + questKey + ".rewards.phat-loots"), String.class)) {
|
if (ConfigUtil.checkList(config.getList("quests." + questKey + ".rewards.phat-loots"), String.class)) {
|
||||||
@ -2159,11 +2168,17 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
if (config.contains("quests." + questKey + ".options.use-parties-plugin")) {
|
if (config.contains("quests." + questKey + ".options.use-parties-plugin")) {
|
||||||
opts.setUsePartiesPlugin(config.getBoolean("quests." + questKey + ".options.use-parties-plugin"));
|
opts.setUsePartiesPlugin(config.getBoolean("quests." + questKey + ".options.use-parties-plugin"));
|
||||||
}
|
}
|
||||||
|
if (config.contains("quests." + questKey + ".options.parties.handle-offline-players")) {
|
||||||
|
opts.setPartiesHandleOfflinePlayers(config.getBoolean("quests." + questKey + ".options.parties.handle-offline-players"));
|
||||||
|
}
|
||||||
|
if (config.contains("quests." + questKey + ".options.parties.distance")) {
|
||||||
|
opts.setPartiesDistance(config.getLong("quests." + questKey + ".options.parties.distance"));
|
||||||
|
}
|
||||||
if (config.contains("quests." + questKey + ".options.share-progress-level")) {
|
if (config.contains("quests." + questKey + ".options.share-progress-level")) {
|
||||||
opts.setShareProgressLevel(config.getInt("quests." + questKey + ".options.share-progress-level"));
|
opts.setShareProgressLevel(config.getInt("quests." + questKey + ".options.share-progress-level"));
|
||||||
}
|
}
|
||||||
if (config.contains("quests." + questKey + ".options.require-same-quest")) {
|
if (config.contains("quests." + questKey + ".options.share-only-same-quest")) {
|
||||||
opts.setRequireSameQuest(config.getBoolean("quests." + questKey + ".options.require-same-quest"));
|
opts.setShareOnlySameQuest(config.getBoolean("quests." + questKey + ".options.share-only-same-quest"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ public class Rewards {
|
|||||||
private List<Integer> mcmmoAmounts = new LinkedList<Integer>();
|
private List<Integer> mcmmoAmounts = new LinkedList<Integer>();
|
||||||
private List<String> heroesClasses = new LinkedList<String>();
|
private List<String> heroesClasses = new LinkedList<String>();
|
||||||
private List<Double> heroesAmounts = new LinkedList<Double>();
|
private List<Double> heroesAmounts = new LinkedList<Double>();
|
||||||
|
private int partiesExperience = 0;
|
||||||
private List<String> phatLoots = new LinkedList<String>();
|
private List<String> phatLoots = new LinkedList<String>();
|
||||||
private Map<String, Map<String, Object>> customRewards = new HashMap<String, Map<String, Object>>();
|
private Map<String, Map<String, Object>> customRewards = new HashMap<String, Map<String, Object>>();
|
||||||
private List<String> detailsOverride = new LinkedList<String>();
|
private List<String> detailsOverride = new LinkedList<String>();
|
||||||
@ -108,6 +109,12 @@ public class Rewards {
|
|||||||
public void setHeroesAmounts(final List<Double> heroesAmounts) {
|
public void setHeroesAmounts(final List<Double> heroesAmounts) {
|
||||||
this.heroesAmounts = heroesAmounts;
|
this.heroesAmounts = heroesAmounts;
|
||||||
}
|
}
|
||||||
|
public int getPartiesExperience() {
|
||||||
|
return partiesExperience;
|
||||||
|
}
|
||||||
|
public void setPartiesExperience(int partiesExperience) {
|
||||||
|
this.partiesExperience = partiesExperience;
|
||||||
|
}
|
||||||
public List<String> getPhatLoots() {
|
public List<String> getPhatLoots() {
|
||||||
return phatLoots;
|
return phatLoots;
|
||||||
}
|
}
|
||||||
|
@ -458,7 +458,7 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
case 3:
|
case 3:
|
||||||
return ChatColor.YELLOW + Lang.get("optShareProgressLevel");
|
return ChatColor.YELLOW + Lang.get("optShareProgressLevel");
|
||||||
case 4:
|
case 4:
|
||||||
return ChatColor.YELLOW + Lang.get("optRequireSameQuest");
|
return ChatColor.YELLOW + Lang.get("optShareOnlySameQuest");
|
||||||
case 5:
|
case 5:
|
||||||
return ChatColor.YELLOW + Lang.get("done");
|
return ChatColor.YELLOW + Lang.get("done");
|
||||||
default:
|
default:
|
||||||
@ -502,13 +502,13 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + String.valueOf(shareOpt) + ChatColor.GRAY + ")";
|
return ChatColor.GRAY + "(" + ChatColor.AQUA + String.valueOf(shareOpt) + ChatColor.GRAY + ")";
|
||||||
}
|
}
|
||||||
case 4:
|
case 4:
|
||||||
if (context.getSessionData(CK.OPT_REQUIRE_SAME_QUEST) == null) {
|
if (context.getSessionData(CK.OPT_SHARE_ONLY_SAME_QUEST) == null) {
|
||||||
final boolean defaultOpt = new Options().canRequireSameQuest();
|
final boolean defaultOpt = new Options().canShareOnlySameQuest();
|
||||||
return ChatColor.GRAY + "(" + (defaultOpt ? ChatColor.GREEN
|
return ChatColor.GRAY + "(" + (defaultOpt ? ChatColor.GREEN
|
||||||
+ Lang.get(String.valueOf(defaultOpt)) : ChatColor.RED
|
+ Lang.get(String.valueOf(defaultOpt)) : ChatColor.RED
|
||||||
+ Lang.get(String.valueOf(defaultOpt))) + ChatColor.GRAY + ")";
|
+ Lang.get(String.valueOf(defaultOpt))) + ChatColor.GRAY + ")";
|
||||||
} else {
|
} else {
|
||||||
final boolean requireOpt = (Boolean) context.getSessionData(CK.OPT_REQUIRE_SAME_QUEST);
|
final boolean requireOpt = (Boolean) context.getSessionData(CK.OPT_SHARE_ONLY_SAME_QUEST);
|
||||||
return ChatColor.GRAY + "(" + (requireOpt ? ChatColor.GREEN
|
return ChatColor.GRAY + "(" + (requireOpt ? ChatColor.GREEN
|
||||||
+ Lang.get(String.valueOf(requireOpt)) : ChatColor.RED
|
+ Lang.get(String.valueOf(requireOpt)) : ChatColor.RED
|
||||||
+ Lang.get(String.valueOf(requireOpt))) + ChatColor.GRAY + ")";
|
+ Lang.get(String.valueOf(requireOpt))) + ChatColor.GRAY + ")";
|
||||||
@ -549,7 +549,7 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
tempPrompt = new OptionsMultiplayerPrompt(context);
|
tempPrompt = new OptionsMultiplayerPrompt(context);
|
||||||
return new OptionsLevelPrompt(context);
|
return new OptionsLevelPrompt(context);
|
||||||
case 4:
|
case 4:
|
||||||
tempKey = CK.OPT_REQUIRE_SAME_QUEST;
|
tempKey = CK.OPT_SHARE_ONLY_SAME_QUEST;
|
||||||
tempPrompt = new OptionsMultiplayerPrompt(context);
|
tempPrompt = new OptionsMultiplayerPrompt(context);
|
||||||
return new OptionsTrueFalsePrompt(context);
|
return new OptionsTrueFalsePrompt(context);
|
||||||
case 5:
|
case 5:
|
||||||
|
@ -47,7 +47,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
private final Quests plugin;
|
private final Quests plugin;
|
||||||
private final String classPrefix;
|
private final String classPrefix;
|
||||||
private boolean hasReward = false;
|
private boolean hasReward = false;
|
||||||
private final int size = 12;
|
private final int size = 13;
|
||||||
|
|
||||||
public RewardsPrompt(final ConversationContext context) {
|
public RewardsPrompt(final ConversationContext context) {
|
||||||
super(context);
|
super(context);
|
||||||
@ -93,14 +93,20 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
return ChatColor.GRAY;
|
return ChatColor.GRAY;
|
||||||
}
|
}
|
||||||
case 9:
|
case 9:
|
||||||
if (plugin.getDependencies().getPhatLoots() != null) {
|
if (plugin.getDependencies().getPartiesApi() != null) {
|
||||||
return ChatColor.BLUE;
|
return ChatColor.BLUE;
|
||||||
} else {
|
} else {
|
||||||
return ChatColor.GRAY;
|
return ChatColor.GRAY;
|
||||||
}
|
}
|
||||||
case 10:
|
case 10:
|
||||||
return ChatColor.BLUE;
|
if (plugin.getDependencies().getPhatLoots() != null) {
|
||||||
|
return ChatColor.BLUE;
|
||||||
|
} else {
|
||||||
|
return ChatColor.GRAY;
|
||||||
|
}
|
||||||
case 11:
|
case 11:
|
||||||
|
return ChatColor.BLUE;
|
||||||
|
case 12:
|
||||||
if (context.getSessionData(CK.REW_DETAILS_OVERRIDE) == null) {
|
if (context.getSessionData(CK.REW_DETAILS_OVERRIDE) == null) {
|
||||||
if (!hasReward) {
|
if (!hasReward) {
|
||||||
return ChatColor.GRAY;
|
return ChatColor.GRAY;
|
||||||
@ -110,7 +116,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
} else {
|
} else {
|
||||||
return ChatColor.BLUE;
|
return ChatColor.BLUE;
|
||||||
}
|
}
|
||||||
case 12:
|
case 13:
|
||||||
return ChatColor.GREEN;
|
return ChatColor.GREEN;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
@ -149,20 +155,26 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
return ChatColor.GRAY + Lang.get("rewSetHeroes");
|
return ChatColor.GRAY + Lang.get("rewSetHeroes");
|
||||||
}
|
}
|
||||||
case 9:
|
case 9:
|
||||||
|
if (plugin.getDependencies().getPartiesApi() != null) {
|
||||||
|
return ChatColor.YELLOW + Lang.get("rewSetPartiesExperience");
|
||||||
|
} else {
|
||||||
|
return ChatColor.GRAY + Lang.get("rewSetPartiesExperience");
|
||||||
|
}
|
||||||
|
case 10:
|
||||||
if (plugin.getDependencies().getPhatLoots() != null) {
|
if (plugin.getDependencies().getPhatLoots() != null) {
|
||||||
return ChatColor.YELLOW + Lang.get("rewSetPhat");
|
return ChatColor.YELLOW + Lang.get("rewSetPhat");
|
||||||
} else {
|
} else {
|
||||||
return ChatColor.GRAY + Lang.get("rewSetPhat");
|
return ChatColor.GRAY + Lang.get("rewSetPhat");
|
||||||
}
|
}
|
||||||
case 10:
|
|
||||||
return ChatColor.DARK_PURPLE + Lang.get("rewSetCustom");
|
|
||||||
case 11:
|
case 11:
|
||||||
|
return ChatColor.DARK_PURPLE + Lang.get("rewSetCustom");
|
||||||
|
case 12:
|
||||||
if (!hasReward) {
|
if (!hasReward) {
|
||||||
return ChatColor.GRAY + Lang.get("overrideCreateSet");
|
return ChatColor.GRAY + Lang.get("overrideCreateSet");
|
||||||
} else {
|
} else {
|
||||||
return ChatColor.YELLOW + Lang.get("overrideCreateSet");
|
return ChatColor.YELLOW + Lang.get("overrideCreateSet");
|
||||||
}
|
}
|
||||||
case 12:
|
case 13:
|
||||||
return ChatColor.YELLOW + Lang.get("done");
|
return ChatColor.YELLOW + Lang.get("done");
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
@ -296,6 +308,13 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||||
}
|
}
|
||||||
case 9:
|
case 9:
|
||||||
|
if (context.getSessionData(CK.REW_PARTIES_EXPERIENCE) == null) {
|
||||||
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
|
} else {
|
||||||
|
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.REW_PARTIES_EXPERIENCE) + " "
|
||||||
|
+ Lang.get("points") + ChatColor.DARK_GRAY + ")";
|
||||||
|
}
|
||||||
|
case 10:
|
||||||
if (plugin.getDependencies().getPhatLoots() != null) {
|
if (plugin.getDependencies().getPhatLoots() != null) {
|
||||||
if (context.getSessionData(CK.REW_PHAT_LOOTS) == null) {
|
if (context.getSessionData(CK.REW_PHAT_LOOTS) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
@ -310,7 +329,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
} else {
|
} else {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("notInstalled") + ")";
|
||||||
}
|
}
|
||||||
case 10:
|
case 11:
|
||||||
if (context.getSessionData(CK.REW_CUSTOM) == null) {
|
if (context.getSessionData(CK.REW_CUSTOM) == null) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
||||||
} else {
|
} else {
|
||||||
@ -322,7 +341,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
case 11:
|
case 12:
|
||||||
if (context.getSessionData(CK.REW_DETAILS_OVERRIDE) == null) {
|
if (context.getSessionData(CK.REW_DETAILS_OVERRIDE) == null) {
|
||||||
if (!hasReward) {
|
if (!hasReward) {
|
||||||
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
return ChatColor.GRAY + "(" + Lang.get("stageEditorOptional") + ")";
|
||||||
@ -338,7 +357,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
case 12:
|
case 13:
|
||||||
return "";
|
return "";
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
@ -409,14 +428,16 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
return new RewardsPrompt(context);
|
return new RewardsPrompt(context);
|
||||||
}
|
}
|
||||||
case 9:
|
case 9:
|
||||||
|
return new RewardsPartiesExperiencePrompt(context);
|
||||||
|
case 10:
|
||||||
if (plugin.getDependencies().getPhatLoots() != null) {
|
if (plugin.getDependencies().getPhatLoots() != null) {
|
||||||
return new RewardsPhatLootsPrompt(context);
|
return new RewardsPhatLootsPrompt(context);
|
||||||
} else {
|
} else {
|
||||||
return new RewardsPrompt(context);
|
return new RewardsPrompt(context);
|
||||||
}
|
}
|
||||||
case 10:
|
|
||||||
return new CustomRewardsPrompt(context);
|
|
||||||
case 11:
|
case 11:
|
||||||
|
return new CustomRewardsPrompt(context);
|
||||||
|
case 12:
|
||||||
if (hasReward) {
|
if (hasReward) {
|
||||||
return new OverridePrompt.Builder()
|
return new OverridePrompt.Builder()
|
||||||
.source(this)
|
.source(this)
|
||||||
@ -426,7 +447,7 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("invalidOption"));
|
||||||
return new RewardsPrompt(context);
|
return new RewardsPrompt(context);
|
||||||
}
|
}
|
||||||
case 12:
|
case 13:
|
||||||
return plugin.getQuestFactory().returnToMenu(context);
|
return plugin.getQuestFactory().returnToMenu(context);
|
||||||
default:
|
default:
|
||||||
return new RewardsPrompt(context);
|
return new RewardsPrompt(context);
|
||||||
@ -441,7 +462,8 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
|| context.getSessionData(CK.REW_COMMAND) != null
|
|| context.getSessionData(CK.REW_COMMAND) != null
|
||||||
|| context.getSessionData(CK.REW_PERMISSION) != null
|
|| context.getSessionData(CK.REW_PERMISSION) != null
|
||||||
|| context.getSessionData(CK.REW_MCMMO_SKILLS) != null
|
|| context.getSessionData(CK.REW_MCMMO_SKILLS) != null
|
||||||
|| context.getSessionData(CK.REW_HEROES_CLASSES) != null
|
|| context.getSessionData(CK.REW_HEROES_CLASSES) != null
|
||||||
|
|| context.getSessionData(CK.REW_PARTIES_EXPERIENCE) != null
|
||||||
|| context.getSessionData(CK.REW_PHAT_LOOTS) != null
|
|| context.getSessionData(CK.REW_PHAT_LOOTS) != null
|
||||||
|| context.getSessionData(CK.REW_CUSTOM) != null) {
|
|| context.getSessionData(CK.REW_CUSTOM) != null) {
|
||||||
hasReward = true;
|
hasReward = true;
|
||||||
@ -1484,6 +1506,55 @@ public class RewardsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class RewardsPartiesExperiencePrompt extends QuestsEditorStringPrompt {
|
||||||
|
|
||||||
|
public RewardsPartiesExperiencePrompt(final ConversationContext context) {
|
||||||
|
super(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTitle(final ConversationContext context) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getQueryText(final ConversationContext context) {
|
||||||
|
return Lang.get("rewPartiesExperiencePrompt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPromptText(final ConversationContext context) {
|
||||||
|
final QuestsEditorPostOpenStringPromptEvent event = new QuestsEditorPostOpenStringPromptEvent(context, this);
|
||||||
|
context.getPlugin().getServer().getPluginManager().callEvent(event);
|
||||||
|
|
||||||
|
return ChatColor.YELLOW + getQueryText(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Prompt acceptInput(final ConversationContext context, final String input) {
|
||||||
|
if (input.equalsIgnoreCase(Lang.get("cmdCancel")) == false
|
||||||
|
&& input.equalsIgnoreCase(Lang.get("cmdClear")) == false) {
|
||||||
|
try {
|
||||||
|
final int i = Integer.parseInt(input);
|
||||||
|
if (i > 0) {
|
||||||
|
context.setSessionData(CK.REW_PARTIES_EXPERIENCE, i);
|
||||||
|
} else {
|
||||||
|
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("inputPosNum"));
|
||||||
|
return new RewardsPartiesExperiencePrompt(context);
|
||||||
|
}
|
||||||
|
} catch (final NumberFormatException e) {
|
||||||
|
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("reqNotANumber")
|
||||||
|
.replace("<input>", input));
|
||||||
|
return new RewardsPartiesExperiencePrompt(context);
|
||||||
|
}
|
||||||
|
} else if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||||
|
context.setSessionData(CK.REW_PARTIES_EXPERIENCE, null);
|
||||||
|
return new RewardsPrompt(context);
|
||||||
|
}
|
||||||
|
return new RewardsPrompt(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class RewardsPhatLootsPrompt extends QuestsEditorStringPrompt {
|
public class RewardsPhatLootsPrompt extends QuestsEditorStringPrompt {
|
||||||
|
|
||||||
|
@ -1,252 +1,254 @@
|
|||||||
/*******************************************************************************************************
|
/*******************************************************************************************************
|
||||||
|
|
||||||
* Continued by PikaMug (formerly HappyPikachu) with permission from _Blackvein_. All rights reserved.
|
* Continued by PikaMug (formerly HappyPikachu) with permission from _Blackvein_. All rights reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*******************************************************************************************************/
|
*******************************************************************************************************/
|
||||||
|
|
||||||
package me.blackvein.quests.listeners;
|
package me.blackvein.quests.listeners;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
import org.bukkit.event.block.BlockDamageEvent;
|
import org.bukkit.event.block.BlockDamageEvent;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.inventory.EquipmentSlot;
|
import org.bukkit.inventory.EquipmentSlot;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import me.blackvein.quests.Objective;
|
import me.blackvein.quests.Objective;
|
||||||
import me.blackvein.quests.Quest;
|
import me.blackvein.quests.Quest;
|
||||||
import me.blackvein.quests.Quester;
|
import me.blackvein.quests.Quester;
|
||||||
import me.blackvein.quests.Quests;
|
import me.blackvein.quests.Quests;
|
||||||
import me.blackvein.quests.enums.ObjectiveType;
|
import me.blackvein.quests.enums.ObjectiveType;
|
||||||
import me.blackvein.quests.events.quester.QuesterPostUpdateObjectiveEvent;
|
import me.blackvein.quests.events.quester.QuesterPostUpdateObjectiveEvent;
|
||||||
import me.blackvein.quests.events.quester.QuesterPreUpdateObjectiveEvent;
|
import me.blackvein.quests.events.quester.QuesterPreUpdateObjectiveEvent;
|
||||||
import me.blackvein.quests.util.ItemUtil;
|
import me.blackvein.quests.util.ItemUtil;
|
||||||
import me.blackvein.quests.util.Lang;
|
import me.blackvein.quests.util.Lang;
|
||||||
|
|
||||||
public class BlockListener implements Listener {
|
public class BlockListener implements Listener {
|
||||||
|
|
||||||
private final Quests plugin;
|
private final Quests plugin;
|
||||||
|
|
||||||
public BlockListener(final Quests plugin) {
|
public BlockListener(final Quests plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@EventHandler(priority = EventPriority.HIGH) // Because HIGHEST conflicts with AutoSell by extendedclip
|
@EventHandler(priority = EventPriority.HIGH) // Because HIGHEST conflicts with AutoSell by extendedclip
|
||||||
public void onBlockBreak(final BlockBreakEvent evt) {
|
public void onBlockBreak(final BlockBreakEvent evt) {
|
||||||
final Player player = evt.getPlayer();
|
final Player player = evt.getPlayer();
|
||||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
if (plugin.canUseQuests(player.getUniqueId())) {
|
||||||
final ItemStack blockItemStack = new ItemStack(evt.getBlock().getType(), 1, evt.getBlock().getState()
|
final ItemStack blockItemStack = new ItemStack(evt.getBlock().getType(), 1, evt.getBlock().getState()
|
||||||
.getData().toItemStack().getDurability());
|
.getData().toItemStack().getDurability());
|
||||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||||
final ObjectiveType breakType = ObjectiveType.BREAK_BLOCK;
|
final ObjectiveType breakType = ObjectiveType.BREAK_BLOCK;
|
||||||
final ObjectiveType placeType = ObjectiveType.PLACE_BLOCK;
|
final ObjectiveType placeType = ObjectiveType.PLACE_BLOCK;
|
||||||
final ObjectiveType cutType = ObjectiveType.CUT_BLOCK;
|
final ObjectiveType cutType = ObjectiveType.CUT_BLOCK;
|
||||||
for (final Quest quest : plugin.getQuests()) {
|
for (final Quest quest : plugin.getQuests()) {
|
||||||
if (evt.isCancelled() == false) {
|
if (evt.isCancelled() == false) {
|
||||||
if (!quester.meetsCondition(quest, true)) {
|
if (!quester.meetsCondition(quest, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (quester.getCurrentQuests().containsKey(quest)
|
if (quester.getCurrentQuests().containsKey(quest)
|
||||||
&& quester.getCurrentStage(quest).containsObjective(breakType)) {
|
&& quester.getCurrentStage(quest).containsObjective(breakType)) {
|
||||||
if (quest.getOptions().canIgnoreSilkTouch()
|
if (quest.getOptions().canIgnoreSilkTouch()
|
||||||
&& player.getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH)) {
|
&& player.getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH)) {
|
||||||
player.sendMessage(ChatColor.RED + Lang.get(player, "optionSilkTouchFail")
|
player.sendMessage(ChatColor.RED + Lang.get(player, "optionSilkTouchFail")
|
||||||
.replace("<quest>", quest.getName()));
|
.replace("<quest>", quest.getName()));
|
||||||
} else {
|
} else {
|
||||||
quester.breakBlock(quest, blockItemStack);
|
quester.breakBlock(quest, blockItemStack);
|
||||||
|
|
||||||
quester.dispatchMultiplayerEverything(quest, breakType, (final Quester q) -> {
|
// Multiplayer
|
||||||
q.breakBlock(quest, blockItemStack);
|
quester.dispatchMultiplayerEverything(quest, breakType, (final Quester q, final Quest cq) -> {
|
||||||
return null;
|
q.breakBlock(cq, blockItemStack);
|
||||||
});
|
return null;
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
if (quester.getCurrentQuests().containsKey(quest)
|
}
|
||||||
&& quester.getCurrentStage(quest).containsObjective(placeType)) {
|
|
||||||
for (final ItemStack is : quester.getQuestData(quest).blocksPlaced) {
|
if (quester.getCurrentQuests().containsKey(quest)
|
||||||
if (evt.getBlock().getType().equals(is.getType()) && is.getAmount() > 0) {
|
&& quester.getCurrentStage(quest).containsObjective(placeType)) {
|
||||||
ItemStack toPlace = new ItemStack(is.getType(), 64);
|
for (final ItemStack is : quester.getQuestData(quest).blocksPlaced) {
|
||||||
for (final ItemStack stack : quester.getCurrentStage(quest).getBlocksToPlace()) {
|
if (evt.getBlock().getType().equals(is.getType()) && is.getAmount() > 0) {
|
||||||
if (ItemUtil.compareItems(is, stack, true) == 0) {
|
ItemStack toPlace = new ItemStack(is.getType(), 64);
|
||||||
toPlace = stack;
|
for (final ItemStack stack : quester.getCurrentStage(quest).getBlocksToPlace()) {
|
||||||
}
|
if (ItemUtil.compareItems(is, stack, true) == 0) {
|
||||||
}
|
toPlace = stack;
|
||||||
|
}
|
||||||
final ObjectiveType type = ObjectiveType.PLACE_BLOCK;
|
}
|
||||||
final QuesterPreUpdateObjectiveEvent preEvent
|
|
||||||
= new QuesterPreUpdateObjectiveEvent(quester, quest,
|
final ObjectiveType type = ObjectiveType.PLACE_BLOCK;
|
||||||
new Objective(type, is.getAmount(), toPlace.getAmount()));
|
final QuesterPreUpdateObjectiveEvent preEvent
|
||||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
= new QuesterPreUpdateObjectiveEvent(quester, quest,
|
||||||
|
new Objective(type, is.getAmount(), toPlace.getAmount()));
|
||||||
final int index = quester.getQuestData(quest).blocksPlaced.indexOf(is);
|
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||||
final int newAmount = is.getAmount() - 1;
|
|
||||||
is.setAmount(newAmount);
|
final int index = quester.getQuestData(quest).blocksPlaced.indexOf(is);
|
||||||
quester.getQuestData(quest).blocksPlaced.set(index, is);
|
final int newAmount = is.getAmount() - 1;
|
||||||
|
is.setAmount(newAmount);
|
||||||
final QuesterPostUpdateObjectiveEvent postEvent
|
quester.getQuestData(quest).blocksPlaced.set(index, is);
|
||||||
= new QuesterPostUpdateObjectiveEvent(quester, quest,
|
|
||||||
new Objective(type, newAmount, toPlace.getAmount()));
|
final QuesterPostUpdateObjectiveEvent postEvent
|
||||||
plugin.getServer().getPluginManager().callEvent(postEvent);
|
= new QuesterPostUpdateObjectiveEvent(quester, quest,
|
||||||
}
|
new Objective(type, newAmount, toPlace.getAmount()));
|
||||||
}
|
plugin.getServer().getPluginManager().callEvent(postEvent);
|
||||||
}
|
}
|
||||||
quester.dispatchMultiplayerEverything(quest, placeType, (final Quester q) -> {
|
}
|
||||||
for (final ItemStack is : q.getQuestData(quest).blocksPlaced) {
|
}
|
||||||
if (evt.getBlock().getType().equals(is.getType()) && is.getAmount() > 0) {
|
quester.dispatchMultiplayerEverything(quest, placeType, (final Quester q, final Quest cq) -> {
|
||||||
ItemStack toPlace = new ItemStack(is.getType(), 64);
|
for (final ItemStack is : q.getQuestData(cq).blocksPlaced) {
|
||||||
for (final ItemStack stack : q.getCurrentStage(quest).getBlocksToPlace()) {
|
if (evt.getBlock().getType().equals(is.getType()) && is.getAmount() > 0) {
|
||||||
if (ItemUtil.compareItems(is, stack, true) == 0) {
|
ItemStack toPlace = new ItemStack(is.getType(), 64);
|
||||||
toPlace = stack;
|
for (final ItemStack stack : quester.getCurrentStage(cq).getBlocksToPlace()) {
|
||||||
}
|
if (ItemUtil.compareItems(is, stack, true) == 0) {
|
||||||
}
|
toPlace = stack;
|
||||||
|
}
|
||||||
final ObjectiveType type = ObjectiveType.PLACE_BLOCK;
|
}
|
||||||
final QuesterPreUpdateObjectiveEvent preEvent
|
|
||||||
= new QuesterPreUpdateObjectiveEvent(q, quest,
|
final ObjectiveType type = ObjectiveType.PLACE_BLOCK;
|
||||||
new Objective(type, is.getAmount(), toPlace.getAmount()));
|
final QuesterPreUpdateObjectiveEvent preEvent
|
||||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
= new QuesterPreUpdateObjectiveEvent(q, cq,
|
||||||
|
new Objective(type, is.getAmount(), toPlace.getAmount()));
|
||||||
final int index = q.getQuestData(quest).blocksPlaced.indexOf(is);
|
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||||
final int newAmount = is.getAmount() - 1;
|
|
||||||
is.setAmount(newAmount);
|
final int index = q.getQuestData(cq).blocksPlaced.indexOf(is);
|
||||||
q.getQuestData(quest).blocksPlaced.set(index, is);
|
final int newAmount = is.getAmount() - 1;
|
||||||
|
is.setAmount(newAmount);
|
||||||
final QuesterPostUpdateObjectiveEvent postEvent
|
q.getQuestData(cq).blocksPlaced.set(index, is);
|
||||||
= new QuesterPostUpdateObjectiveEvent(q, quest,
|
|
||||||
new Objective(type, newAmount, toPlace.getAmount()));
|
final QuesterPostUpdateObjectiveEvent postEvent
|
||||||
plugin.getServer().getPluginManager().callEvent(postEvent);
|
= new QuesterPostUpdateObjectiveEvent(q, cq,
|
||||||
}
|
new Objective(type, newAmount, toPlace.getAmount()));
|
||||||
}
|
plugin.getServer().getPluginManager().callEvent(postEvent);
|
||||||
return null;
|
}
|
||||||
});
|
}
|
||||||
if (quester.getCurrentQuests().containsKey(quest)
|
return null;
|
||||||
&& quester.getCurrentStage(quest).containsObjective(cutType)) {
|
});
|
||||||
if (player.getItemInHand().getType().equals(Material.SHEARS)) {
|
if (quester.getCurrentQuests().containsKey(quest)
|
||||||
quester.cutBlock(quest, blockItemStack);
|
&& quester.getCurrentStage(quest).containsObjective(cutType)) {
|
||||||
}
|
if (player.getItemInHand().getType().equals(Material.SHEARS)) {
|
||||||
}
|
quester.cutBlock(quest, blockItemStack);
|
||||||
quester.dispatchMultiplayerEverything(quest, cutType, (final Quester q) -> {
|
}
|
||||||
if (player.getItemInHand().getType().equals(Material.SHEARS)) {
|
}
|
||||||
q.cutBlock(quest, blockItemStack);
|
quester.dispatchMultiplayerEverything(quest, cutType, (final Quester q, final Quest cq) -> {
|
||||||
}
|
if (player.getItemInHand().getType().equals(Material.SHEARS)) {
|
||||||
return null;
|
q.cutBlock(cq, blockItemStack);
|
||||||
});
|
}
|
||||||
}
|
return null;
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@SuppressWarnings("deprecation") // since 1.13
|
}
|
||||||
@EventHandler
|
|
||||||
public void onBlockDamage(final BlockDamageEvent evt) {
|
@SuppressWarnings("deprecation") // since 1.13
|
||||||
final Player player = evt.getPlayer();
|
@EventHandler
|
||||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
public void onBlockDamage(final BlockDamageEvent evt) {
|
||||||
final ItemStack blockItemStack = new ItemStack(evt.getBlock().getType(), 1, evt.getBlock().getState()
|
final Player player = evt.getPlayer();
|
||||||
.getData().toItemStack().getDurability());
|
if (plugin.canUseQuests(player.getUniqueId())) {
|
||||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
final ItemStack blockItemStack = new ItemStack(evt.getBlock().getType(), 1, evt.getBlock().getState()
|
||||||
final ObjectiveType type = ObjectiveType.DAMAGE_BLOCK;
|
.getData().toItemStack().getDurability());
|
||||||
for (final Quest quest : plugin.getQuests()) {
|
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||||
if (!quester.meetsCondition(quest, true)) {
|
final ObjectiveType type = ObjectiveType.DAMAGE_BLOCK;
|
||||||
return;
|
for (final Quest quest : plugin.getQuests()) {
|
||||||
}
|
if (!quester.meetsCondition(quest, true)) {
|
||||||
|
return;
|
||||||
if (quester.getCurrentQuests().containsKey(quest)
|
}
|
||||||
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
|
||||||
quester.damageBlock(quest, blockItemStack);
|
if (quester.getCurrentQuests().containsKey(quest)
|
||||||
}
|
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
||||||
|
quester.damageBlock(quest, blockItemStack);
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
}
|
||||||
q.placeBlock(quest, blockItemStack);
|
|
||||||
return null;
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
});
|
q.placeBlock(cq, blockItemStack);
|
||||||
}
|
return null;
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@SuppressWarnings("deprecation") // since 1.13
|
}
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
|
||||||
public void onBlockPlace(final BlockPlaceEvent evt) {
|
@SuppressWarnings("deprecation") // since 1.13
|
||||||
final Player player = evt.getPlayer();
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
public void onBlockPlace(final BlockPlaceEvent evt) {
|
||||||
final ItemStack blockItemStack = new ItemStack(evt.getBlock().getType(), 1, evt.getBlock().getState()
|
final Player player = evt.getPlayer();
|
||||||
.getData().toItemStack().getDurability());
|
if (plugin.canUseQuests(player.getUniqueId())) {
|
||||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
final ItemStack blockItemStack = new ItemStack(evt.getBlock().getType(), 1, evt.getBlock().getState()
|
||||||
final ObjectiveType type = ObjectiveType.PLACE_BLOCK;
|
.getData().toItemStack().getDurability());
|
||||||
for (final Quest quest : plugin.getQuests()) {
|
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||||
if (evt.isCancelled() == false) {
|
final ObjectiveType type = ObjectiveType.PLACE_BLOCK;
|
||||||
if (!quester.meetsCondition(quest, true)) {
|
for (final Quest quest : plugin.getQuests()) {
|
||||||
return;
|
if (evt.isCancelled() == false) {
|
||||||
}
|
if (!quester.meetsCondition(quest, true)) {
|
||||||
|
return;
|
||||||
if (quester.getCurrentQuests().containsKey(quest)
|
}
|
||||||
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
|
||||||
quester.placeBlock(quest, blockItemStack);
|
if (quester.getCurrentQuests().containsKey(quest)
|
||||||
}
|
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
||||||
|
quester.placeBlock(quest, blockItemStack);
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
}
|
||||||
q.placeBlock(quest, blockItemStack);
|
|
||||||
return null;
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
});
|
q.placeBlock(cq, blockItemStack);
|
||||||
}
|
return null;
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@SuppressWarnings("deprecation") // since 1.13
|
}
|
||||||
@EventHandler
|
|
||||||
public void onBlockUse(final PlayerInteractEvent evt) {
|
@SuppressWarnings("deprecation") // since 1.13
|
||||||
EquipmentSlot e = null;
|
@EventHandler
|
||||||
try {
|
public void onBlockUse(final PlayerInteractEvent evt) {
|
||||||
e = evt.getHand();
|
EquipmentSlot e = null;
|
||||||
} catch (final NoSuchMethodError err) {
|
try {
|
||||||
// Do nothing, getHand() not present pre-1.9
|
e = evt.getHand();
|
||||||
}
|
} catch (final NoSuchMethodError err) {
|
||||||
if (e == null || e.equals(EquipmentSlot.HAND)) { //If the event is fired by HAND (main hand)
|
// Do nothing, getHand() not present pre-1.9
|
||||||
final Player player = evt.getPlayer();
|
}
|
||||||
if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
|
if (e == null || e.equals(EquipmentSlot.HAND)) { //If the event is fired by HAND (main hand)
|
||||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
final Player player = evt.getPlayer();
|
||||||
if (quester.isSelectingBlock()) {
|
if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
|
||||||
return;
|
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||||
}
|
if (quester.isSelectingBlock()) {
|
||||||
if (evt.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
|
return;
|
||||||
if (evt.isCancelled() == false) {
|
}
|
||||||
final ItemStack blockItemStack = new ItemStack(evt.getClickedBlock().getType(), 1, evt
|
if (evt.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
|
||||||
.getClickedBlock().getState().getData().toItemStack().getDurability());
|
if (evt.isCancelled() == false) {
|
||||||
final ObjectiveType type = ObjectiveType.USE_BLOCK;
|
final ItemStack blockItemStack = new ItemStack(evt.getClickedBlock().getType(), 1, evt
|
||||||
for (final Quest quest : plugin.getQuests()) {
|
.getClickedBlock().getState().getData().toItemStack().getDurability());
|
||||||
if (!quester.meetsCondition(quest, true)) {
|
final ObjectiveType type = ObjectiveType.USE_BLOCK;
|
||||||
return;
|
for (final Quest quest : plugin.getQuests()) {
|
||||||
}
|
if (!quester.meetsCondition(quest, true)) {
|
||||||
|
return;
|
||||||
if (quester.getCurrentQuests().containsKey(quest)
|
}
|
||||||
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
|
||||||
quester.useBlock(quest, blockItemStack);
|
if (quester.getCurrentQuests().containsKey(quest)
|
||||||
}
|
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
||||||
|
quester.useBlock(quest, blockItemStack);
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
}
|
||||||
q.useBlock(quest, blockItemStack);
|
|
||||||
return null;
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
});
|
q.useBlock(cq, blockItemStack);
|
||||||
}
|
return null;
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,189 +1,189 @@
|
|||||||
/*******************************************************************************************************
|
/*******************************************************************************************************
|
||||||
|
|
||||||
* Continued by PikaMug (formerly HappyPikachu) with permission from _Blackvein_. All rights reserved.
|
* Continued by PikaMug (formerly HappyPikachu) with permission from _Blackvein_. All rights reserved.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
|
||||||
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*******************************************************************************************************/
|
*******************************************************************************************************/
|
||||||
|
|
||||||
package me.blackvein.quests.listeners;
|
package me.blackvein.quests.listeners;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.enchantment.EnchantItemEvent;
|
import org.bukkit.event.enchantment.EnchantItemEvent;
|
||||||
import org.bukkit.event.inventory.CraftItemEvent;
|
import org.bukkit.event.inventory.CraftItemEvent;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.inventory.InventoryType;
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
import org.bukkit.event.inventory.InventoryType.SlotType;
|
import org.bukkit.event.inventory.InventoryType.SlotType;
|
||||||
import org.bukkit.event.player.PlayerItemConsumeEvent;
|
import org.bukkit.event.player.PlayerItemConsumeEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import me.blackvein.quests.Quest;
|
import me.blackvein.quests.Quest;
|
||||||
import me.blackvein.quests.Quester;
|
import me.blackvein.quests.Quester;
|
||||||
import me.blackvein.quests.Quests;
|
import me.blackvein.quests.Quests;
|
||||||
import me.blackvein.quests.enums.ObjectiveType;
|
import me.blackvein.quests.enums.ObjectiveType;
|
||||||
|
|
||||||
public class ItemListener implements Listener {
|
public class ItemListener implements Listener {
|
||||||
|
|
||||||
private final Quests plugin;
|
private final Quests plugin;
|
||||||
|
|
||||||
public ItemListener(final Quests plugin) {
|
public ItemListener(final Quests plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onCraftItem(final CraftItemEvent evt) {
|
public void onCraftItem(final CraftItemEvent evt) {
|
||||||
if (evt.getWhoClicked() instanceof Player) {
|
if (evt.getWhoClicked() instanceof Player) {
|
||||||
final Player player = (Player) evt.getWhoClicked();
|
final Player player = (Player) evt.getWhoClicked();
|
||||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
if (plugin.canUseQuests(player.getUniqueId())) {
|
||||||
final ItemStack craftedItem = getCraftedItem(evt);
|
final ItemStack craftedItem = getCraftedItem(evt);
|
||||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||||
final ObjectiveType type = ObjectiveType.CRAFT_ITEM;
|
final ObjectiveType type = ObjectiveType.CRAFT_ITEM;
|
||||||
for (final Quest quest : plugin.getQuests()) {
|
for (final Quest quest : plugin.getQuests()) {
|
||||||
if (!quester.meetsCondition(quest, true)) {
|
if (!quester.meetsCondition(quest, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quester.getCurrentQuests().containsKey(quest)
|
if (quester.getCurrentQuests().containsKey(quest)
|
||||||
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
||||||
quester.craftItem(quest, craftedItem);
|
quester.craftItem(quest, craftedItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
q.craftItem(quest, craftedItem);
|
q.craftItem(cq, craftedItem);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private ItemStack getCraftedItem(final CraftItemEvent evt) {
|
private ItemStack getCraftedItem(final CraftItemEvent evt) {
|
||||||
if (evt.isShiftClick()) {
|
if (evt.isShiftClick()) {
|
||||||
final ItemStack recipeResult = evt.getRecipe().getResult();
|
final ItemStack recipeResult = evt.getRecipe().getResult();
|
||||||
final int resultAmt = recipeResult.getAmount(); // Bread = 1, Cookie = 8, etc.
|
final int resultAmt = recipeResult.getAmount(); // Bread = 1, Cookie = 8, etc.
|
||||||
int leastIngredient = 1;
|
int leastIngredient = 1;
|
||||||
for (final ItemStack item : evt.getInventory().getMatrix()) {
|
for (final ItemStack item : evt.getInventory().getMatrix()) {
|
||||||
if (item != null && !item.getType().equals(Material.AIR)) {
|
if (item != null && !item.getType().equals(Material.AIR)) {
|
||||||
leastIngredient = item.getAmount() * resultAmt;
|
leastIngredient = item.getAmount() * resultAmt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new ItemStack(recipeResult.getType(), leastIngredient, recipeResult.getDurability());
|
return new ItemStack(recipeResult.getType(), leastIngredient, recipeResult.getDurability());
|
||||||
}
|
}
|
||||||
return evt.getCurrentItem();
|
return evt.getCurrentItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onInventoryClick(final InventoryClickEvent evt) {
|
public void onInventoryClick(final InventoryClickEvent evt) {
|
||||||
if (evt.getWhoClicked() instanceof Player) {
|
if (evt.getWhoClicked() instanceof Player) {
|
||||||
final Player player = (Player) evt.getWhoClicked();
|
final Player player = (Player) evt.getWhoClicked();
|
||||||
if (evt.getInventory().getType() == InventoryType.FURNACE
|
if (evt.getInventory().getType() == InventoryType.FURNACE
|
||||||
|| evt.getInventory().getType().name().equals("BLAST_FURNACE")
|
|| evt.getInventory().getType().name().equals("BLAST_FURNACE")
|
||||||
|| evt.getInventory().getType().name().equals("SMOKER")) {
|
|| evt.getInventory().getType().name().equals("SMOKER")) {
|
||||||
if (evt.getSlotType() == SlotType.RESULT) {
|
if (evt.getSlotType() == SlotType.RESULT) {
|
||||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||||
final ObjectiveType type = ObjectiveType.SMELT_ITEM;
|
final ObjectiveType type = ObjectiveType.SMELT_ITEM;
|
||||||
for (final Quest quest : plugin.getQuests()) {
|
for (final Quest quest : plugin.getQuests()) {
|
||||||
if (!quester.meetsCondition(quest, true)) {
|
if (!quester.meetsCondition(quest, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quester.getCurrentQuests().containsKey(quest)
|
if (quester.getCurrentQuests().containsKey(quest)
|
||||||
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
||||||
quester.smeltItem(quest, evt.getCurrentItem());
|
quester.smeltItem(quest, evt.getCurrentItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
q.smeltItem(quest, evt.getCurrentItem());
|
q.smeltItem(cq, evt.getCurrentItem());
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (evt.getInventory().getType() == InventoryType.BREWING) {
|
} else if (evt.getInventory().getType() == InventoryType.BREWING) {
|
||||||
if (evt.getSlotType() == SlotType.CRAFTING) {
|
if (evt.getSlotType() == SlotType.CRAFTING) {
|
||||||
final Quester quester = plugin.getQuester(player.getUniqueId());
|
final Quester quester = plugin.getQuester(player.getUniqueId());
|
||||||
final ObjectiveType type = ObjectiveType.BREW_ITEM;
|
final ObjectiveType type = ObjectiveType.BREW_ITEM;
|
||||||
for (final Quest quest : plugin.getQuests()) {
|
for (final Quest quest : plugin.getQuests()) {
|
||||||
if (!quester.meetsCondition(quest, true)) {
|
if (!quester.meetsCondition(quest, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quester.getCurrentQuests().containsKey(quest)
|
if (quester.getCurrentQuests().containsKey(quest)
|
||||||
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
||||||
quester.brewItem(quest, evt.getCurrentItem());
|
quester.brewItem(quest, evt.getCurrentItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
q.brewItem(quest, evt.getCurrentItem());
|
q.brewItem(cq, evt.getCurrentItem());
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onEnchantItem(final EnchantItemEvent evt) {
|
public void onEnchantItem(final EnchantItemEvent evt) {
|
||||||
if (plugin.canUseQuests(evt.getEnchanter().getUniqueId())) {
|
if (plugin.canUseQuests(evt.getEnchanter().getUniqueId())) {
|
||||||
final ItemStack enchantedItem = evt.getItem().clone();
|
final ItemStack enchantedItem = evt.getItem().clone();
|
||||||
enchantedItem.setAmount(1);
|
enchantedItem.setAmount(1);
|
||||||
try {
|
try {
|
||||||
enchantedItem.addEnchantments(evt.getEnchantsToAdd());
|
enchantedItem.addEnchantments(evt.getEnchantsToAdd());
|
||||||
} catch (final IllegalArgumentException e) {
|
} catch (final IllegalArgumentException e) {
|
||||||
// Ignore
|
// Ignore
|
||||||
}
|
}
|
||||||
final Quester quester = plugin.getQuester(evt.getEnchanter().getUniqueId());
|
final Quester quester = plugin.getQuester(evt.getEnchanter().getUniqueId());
|
||||||
final ObjectiveType type = ObjectiveType.ENCHANT_ITEM;
|
final ObjectiveType type = ObjectiveType.ENCHANT_ITEM;
|
||||||
for (final Quest quest : plugin.getQuests()) {
|
for (final Quest quest : plugin.getQuests()) {
|
||||||
if (!quester.meetsCondition(quest, true)) {
|
if (!quester.meetsCondition(quest, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quester.getCurrentQuests().containsKey(quest)
|
if (quester.getCurrentQuests().containsKey(quest)
|
||||||
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
||||||
quester.enchantItem(quest, enchantedItem);
|
quester.enchantItem(quest, enchantedItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
q.enchantItem(quest, enchantedItem);
|
q.enchantItem(cq, enchantedItem);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onConsumeItem(final PlayerItemConsumeEvent evt) {
|
public void onConsumeItem(final PlayerItemConsumeEvent evt) {
|
||||||
if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
|
if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
|
||||||
final ItemStack consumedItem = evt.getItem().clone();
|
final ItemStack consumedItem = evt.getItem().clone();
|
||||||
consumedItem.setAmount(1);
|
consumedItem.setAmount(1);
|
||||||
final Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
final Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
|
||||||
final ObjectiveType type = ObjectiveType.CONSUME_ITEM;
|
final ObjectiveType type = ObjectiveType.CONSUME_ITEM;
|
||||||
for (final Quest quest : plugin.getQuests()) {
|
for (final Quest quest : plugin.getQuests()) {
|
||||||
if (!quester.meetsCondition(quest, true)) {
|
if (!quester.meetsCondition(quest, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quester.getCurrentQuests().containsKey(quest)
|
if (quester.getCurrentQuests().containsKey(quest)
|
||||||
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
&& quester.getCurrentStage(quest).containsObjective(type)) {
|
||||||
quester.consumeItem(quest, consumedItem);
|
quester.consumeItem(quest, consumedItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
q.consumeItem(quest, consumedItem);
|
q.consumeItem(cq, consumedItem);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
import com.alessiodp.parties.api.events.bukkit.party.BukkitPartiesPartyPostCreateEvent;
|
import com.alessiodp.parties.api.events.bukkit.party.BukkitPartiesPartyPostCreateEvent;
|
||||||
import com.alessiodp.parties.api.events.bukkit.party.BukkitPartiesPartyPostDeleteEvent;
|
|
||||||
import com.alessiodp.parties.api.events.bukkit.player.BukkitPartiesPlayerPostJoinEvent;
|
import com.alessiodp.parties.api.events.bukkit.player.BukkitPartiesPlayerPostJoinEvent;
|
||||||
import com.alessiodp.parties.api.events.bukkit.player.BukkitPartiesPlayerPostLeaveEvent;
|
import com.alessiodp.parties.api.events.bukkit.player.BukkitPartiesPlayerPostLeaveEvent;
|
||||||
|
|
||||||
@ -39,51 +38,21 @@ public class PartiesListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onPartyDeleteEvent(final BukkitPartiesPartyPostDeleteEvent event) {
|
|
||||||
if (event.getCommandSender() != null) {
|
|
||||||
final Player p = Bukkit.getServer().getPlayer(event.getCommandSender().getPlayerUUID());
|
|
||||||
if (p != null) {
|
|
||||||
if (Lang.get("questPartiesDelete").length() > 0) {
|
|
||||||
p.sendMessage(ChatColor.RED + Lang.get("questPartiesDelete"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerJoinEvent(final BukkitPartiesPlayerPostJoinEvent event) {
|
public void onPlayerJoinEvent(final BukkitPartiesPlayerPostJoinEvent event) {
|
||||||
if (event.isInvited() && event.getInviter() != null) {
|
|
||||||
final Player i = Bukkit.getServer().getPlayer(event.getInviter());
|
|
||||||
if (i != null) {
|
|
||||||
if (Lang.get("questPartiesInvite").length() > 0) {
|
|
||||||
i.sendMessage(ChatColor.GREEN + Lang.get(i, "questPartiesInvite").replace("<player>", i.getName()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
final Player p = Bukkit.getServer().getPlayer(event.getPartyPlayer().getPlayerUUID());
|
final Player p = Bukkit.getServer().getPlayer(event.getPartyPlayer().getPlayerUUID());
|
||||||
if (p != null) {
|
if (p != null && Lang.get("questPartiesLeave").length() > 0) {
|
||||||
if (Lang.get("questPartiesJoin").length() > 0) {
|
p.sendMessage(ChatColor.GREEN + Lang.get(p, "questPartiesJoin"));
|
||||||
p.sendMessage(ChatColor.GREEN + Lang.get(p, "questPartiesJoin").replace("<player>", p.getName()));
|
event.getParty().broadcastMessage(ChatColor.GREEN + Lang.get("questPartiesJoinBroadcast").replace("<player>", event.getPartyPlayer().getName()), event.getPartyPlayer());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerLeaveEvent(final BukkitPartiesPlayerPostLeaveEvent event) {
|
public void onPlayerLeaveEvent(final BukkitPartiesPlayerPostLeaveEvent event) {
|
||||||
if (event.isKicked() && event.getKicker() != null) {
|
|
||||||
final Player k = Bukkit.getServer().getPlayer(event.getKicker().getPlayerUUID());
|
|
||||||
if (k != null) {
|
|
||||||
if (Lang.get("questPartiesKicked").length() > 0) {
|
|
||||||
k.sendMessage(ChatColor.RED + Lang.get(k, "questPartiesKicked").replace("<player>", k.getName()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
final Player p = Bukkit.getServer().getPlayer(event.getPartyPlayer().getPlayerUUID());
|
final Player p = Bukkit.getServer().getPlayer(event.getPartyPlayer().getPlayerUUID());
|
||||||
if (p != null) {
|
if (p != null && Lang.get("questPartiesLeave").length() > 0) {
|
||||||
if (Lang.get("questPartiesLeave").length() > 0) {
|
p.sendMessage(ChatColor.RED + Lang.get(p, "questPartiesLeave"));
|
||||||
p.sendMessage(ChatColor.RED + Lang.get(p, "questPartiesLeave").replace("<player>", p.getName()));
|
event.getParty().broadcastMessage(ChatColor.RED + Lang.get("questPartiesLeaveBroadcast").replace("<player>", event.getPartyPlayer().getName()), event.getPartyPlayer());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -404,8 +404,8 @@ public class PlayerListener implements Listener {
|
|||||||
quester.milkCow(quest);
|
quester.milkCow(quest);
|
||||||
}
|
}
|
||||||
|
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
q.milkCow(quest);
|
q.milkCow(cq);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -452,8 +452,8 @@ public class PlayerListener implements Listener {
|
|||||||
quester.sayPassword(quest, evt);
|
quester.sayPassword(quest, evt);
|
||||||
}
|
}
|
||||||
|
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
q.sayPassword(quest, evt);
|
q.sayPassword(cq, evt);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -519,8 +519,8 @@ public class PlayerListener implements Listener {
|
|||||||
quester.shearSheep(quest, sheep.getColor());
|
quester.shearSheep(quest, sheep.getColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
q.shearSheep(quest, sheep.getColor());
|
q.shearSheep(cq, sheep.getColor());
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -545,8 +545,8 @@ public class PlayerListener implements Listener {
|
|||||||
quester.tameMob(quest, evt.getEntityType());
|
quester.tameMob(quest, evt.getEntityType());
|
||||||
}
|
}
|
||||||
|
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
q.tameMob(quest, evt.getEntityType());
|
q.tameMob(cq, evt.getEntityType());
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -612,8 +612,8 @@ public class PlayerListener implements Listener {
|
|||||||
quester.killNPC(quest, CitizensAPI.getNPCRegistry().getNPC(target));
|
quester.killNPC(quest, CitizensAPI.getNPCRegistry().getNPC(target));
|
||||||
}
|
}
|
||||||
|
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
q.killNPC(quest, CitizensAPI.getNPCRegistry().getNPC(target));
|
q.killNPC(cq, CitizensAPI.getNPCRegistry().getNPC(target));
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -629,8 +629,8 @@ public class PlayerListener implements Listener {
|
|||||||
quester.killMob(quest, target.getLocation(), target.getType());
|
quester.killMob(quest, target.getLocation(), target.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
q.killMob(quest, target.getLocation(), target.getType());
|
q.killMob(cq, target.getLocation(), target.getType());
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -731,8 +731,8 @@ public class PlayerListener implements Listener {
|
|||||||
quester.killPlayer(quest, (Player)target);
|
quester.killPlayer(quest, (Player)target);
|
||||||
}
|
}
|
||||||
|
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
q.killPlayer(quest, (Player)target);
|
q.killPlayer(cq, (Player)target);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -756,8 +756,8 @@ public class PlayerListener implements Listener {
|
|||||||
quester.catchFish(quest);
|
quester.catchFish(quest);
|
||||||
}
|
}
|
||||||
|
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
q.catchFish(quest);
|
q.catchFish(cq);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -933,11 +933,11 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
quester.dispatchMultiplayerEverything(quest, type, (final Quester q) -> {
|
quester.dispatchMultiplayerEverything(quest, type, (final Quester q, final Quest cq) -> {
|
||||||
plugin.getServer().getScheduler().runTask(plugin, new Runnable() {
|
plugin.getServer().getScheduler().runTask(plugin, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
q.reachLocation(quest, location);
|
q.reachLocation(cq, location);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return null;
|
return null;
|
||||||
|
@ -129,6 +129,7 @@ public class CK {
|
|||||||
public static final String REW_MCMMO_AMOUNTS = "mcMMOSkillAmounts";
|
public static final String REW_MCMMO_AMOUNTS = "mcMMOSkillAmounts";
|
||||||
public static final String REW_HEROES_CLASSES = "heroesClassRews";
|
public static final String REW_HEROES_CLASSES = "heroesClassRews";
|
||||||
public static final String REW_HEROES_AMOUNTS = "heroesAmountRews";
|
public static final String REW_HEROES_AMOUNTS = "heroesAmountRews";
|
||||||
|
public static final String REW_PARTIES_EXPERIENCE = "partiesExperienceRews";
|
||||||
public static final String REW_PHAT_LOOTS = "phatLootRews";
|
public static final String REW_PHAT_LOOTS = "phatLootRews";
|
||||||
public static final String REW_CUSTOM = "customRews";
|
public static final String REW_CUSTOM = "customRews";
|
||||||
public static final String REW_CUSTOM_DATA = "customRewData";
|
public static final String REW_CUSTOM_DATA = "customRewData";
|
||||||
@ -148,7 +149,7 @@ public class CK {
|
|||||||
public static final String OPT_USE_DUNGEONSXL_PLUGIN = "useDungeonsXLPluginOpt";
|
public static final String OPT_USE_DUNGEONSXL_PLUGIN = "useDungeonsXLPluginOpt";
|
||||||
public static final String OPT_USE_PARTIES_PLUGIN = "usePartiesPluginOpt";
|
public static final String OPT_USE_PARTIES_PLUGIN = "usePartiesPluginOpt";
|
||||||
public static final String OPT_SHARE_PROGRESS_LEVEL = "shareProgressLevelOpt";
|
public static final String OPT_SHARE_PROGRESS_LEVEL = "shareProgressLevelOpt";
|
||||||
public static final String OPT_REQUIRE_SAME_QUEST = "requireSameQuestOpt";
|
public static final String OPT_SHARE_ONLY_SAME_QUEST = "shareOnlySameQuestOpt";
|
||||||
// Actions
|
// Actions
|
||||||
public static final String E_OLD_EVENT = "oldEvent";
|
public static final String E_OLD_EVENT = "oldEvent";
|
||||||
public static final String E_NAME = "evtName";
|
public static final String E_NAME = "evtName";
|
||||||
|
@ -79,10 +79,10 @@ questDungeonsKicked: "<player> can no longer perform quests with you."
|
|||||||
questDungeonsLeave: "You can no longer perform quests with Leader <player>."
|
questDungeonsLeave: "You can no longer perform quests with Leader <player>."
|
||||||
questPartiesCreate: "Players added to this party may perform quests together!"
|
questPartiesCreate: "Players added to this party may perform quests together!"
|
||||||
questPartiesDelete: "The quest party was disbanded."
|
questPartiesDelete: "The quest party was disbanded."
|
||||||
questPartiesInvite: "<player> can now perform quests with you!"
|
questPartiesJoin: "You can now perform quests with the party."
|
||||||
questPartiesJoin: "You can now perform quests with <player>."
|
questPartiesJoinBroadcast: "<player> can now perform quests with the party!"
|
||||||
questPartiesKicked: "<player> can no longer perform quests with you."
|
questPartiesLeave: "You can no longer perform quests with the party."
|
||||||
questPartiesLeave: "You can no longer perform quests with <player>."
|
questPartiesLeaveBroadcast: "<player> can no longer perform quests with you."
|
||||||
questWGSetRegion: "Set region start"
|
questWGSetRegion: "Set region start"
|
||||||
questWGPrompt: "Enter WorldGuard region, <clear>, <cancel>"
|
questWGPrompt: "Enter WorldGuard region, <clear>, <cancel>"
|
||||||
questWGInvalidRegion: "<region> is not a valid WorldGuard region!"
|
questWGInvalidRegion: "<region> is not a valid WorldGuard region!"
|
||||||
@ -490,7 +490,7 @@ optCommandsDenied: "You cannot use commands during <quest>."
|
|||||||
optUseDungeonsXLPlugin: "Use DungeonsXL plugin"
|
optUseDungeonsXLPlugin: "Use DungeonsXL plugin"
|
||||||
optUsePartiesPlugin: "Use Parties plugin"
|
optUsePartiesPlugin: "Use Parties plugin"
|
||||||
optShareProgressLevel: "Level of progress sharing"
|
optShareProgressLevel: "Level of progress sharing"
|
||||||
optRequireSameQuest: "Require same quest"
|
optShareOnlySameQuest: "Share only with the same quest"
|
||||||
rewSetMoney: "Set money reward"
|
rewSetMoney: "Set money reward"
|
||||||
rewSetQuestPoints: "Set <points> reward"
|
rewSetQuestPoints: "Set <points> reward"
|
||||||
rewSetItems: "Set item rewards"
|
rewSetItems: "Set item rewards"
|
||||||
@ -504,6 +504,7 @@ rewSetPermissionWorlds: "Set permission worlds"
|
|||||||
rewPermissionsCleared: "Permission rewards cleared."
|
rewPermissionsCleared: "Permission rewards cleared."
|
||||||
rewSetMcMMO: "Set mcMMO Classic skill rewards"
|
rewSetMcMMO: "Set mcMMO Classic skill rewards"
|
||||||
rewSetHeroes: "Set Heroes experience rewards"
|
rewSetHeroes: "Set Heroes experience rewards"
|
||||||
|
rewSetPartiesExperience: "Set Parties experience reward"
|
||||||
rewSetPhat: "Set PhatLoot rewards"
|
rewSetPhat: "Set PhatLoot rewards"
|
||||||
rewSetCustom: "Set custom rewards"
|
rewSetCustom: "Set custom rewards"
|
||||||
rewSetHeroesClasses: "Set classes"
|
rewSetHeroesClasses: "Set classes"
|
||||||
@ -517,6 +518,7 @@ rewQuestPointsPrompt: "Enter amount of <points>, <clear>, <cancel>"
|
|||||||
rewMcMMOPrompt: "Enter mcMMO Classic skills (or enter 'All' for all skills), <space>, <cancel>"
|
rewMcMMOPrompt: "Enter mcMMO Classic skills (or enter 'All' for all skills), <space>, <cancel>"
|
||||||
rewHeroesClassesPrompt: "Enter Heroes classes, <space>, <cancel>"
|
rewHeroesClassesPrompt: "Enter Heroes classes, <space>, <cancel>"
|
||||||
rewHeroesExperiencePrompt: "Enter experience amounts (numbers, decimals are allowed), <space>, <cancel>"
|
rewHeroesExperiencePrompt: "Enter experience amounts (numbers, decimals are allowed), <space>, <cancel>"
|
||||||
|
rewPartiesExperiencePrompt: "Enter amount of Parties experience, <clear>, <cancel>"
|
||||||
rewPhatLootsPrompt: "Enter PhatLoots, <space>, <clear>, <cancel>"
|
rewPhatLootsPrompt: "Enter PhatLoots, <space>, <clear>, <cancel>"
|
||||||
rewCustomRewardPrompt: "Enter the name of a custom reward to add, <clear>, <cancel>"
|
rewCustomRewardPrompt: "Enter the name of a custom reward to add, <clear>, <cancel>"
|
||||||
rewItemsCleared: "Item rewards cleared."
|
rewItemsCleared: "Item rewards cleared."
|
||||||
@ -794,6 +796,7 @@ to: "to"
|
|||||||
blocksWithin: "within <amount> blocks of"
|
blocksWithin: "within <amount> blocks of"
|
||||||
valRequired: "Value required"
|
valRequired: "Value required"
|
||||||
experience: "Experience"
|
experience: "Experience"
|
||||||
|
partiesExperience: "Parties experience"
|
||||||
timePrompt: "Enter amount of time (in seconds), <clear>, <cancel>"
|
timePrompt: "Enter amount of time (in seconds), <clear>, <cancel>"
|
||||||
timerMessage: "Time left to finish the quest/stage: <time> seconds"
|
timerMessage: "Time left to finish the quest/stage: <time> seconds"
|
||||||
timerStart: "You have <time> seconds to finish this quest/stage"
|
timerStart: "You have <time> seconds to finish this quest/stage"
|
||||||
|
Loading…
Reference in New Issue
Block a user