mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 10:36:09 +01:00
Fixed chat-event functionality
This commit is contained in:
parent
da4452009f
commit
8bbf21f0b5
@ -172,6 +172,7 @@ public class PlayerListener implements Listener {
|
|||||||
if (plugin.checkQuester(evt.getPlayer().getName()) == false) {
|
if (plugin.checkQuester(evt.getPlayer().getName()) == false) {
|
||||||
|
|
||||||
Quester quester = plugin.getQuester(evt.getPlayer().getName());
|
Quester quester = plugin.getQuester(evt.getPlayer().getName());
|
||||||
|
|
||||||
if (quester.currentStage != null) {
|
if (quester.currentStage != null) {
|
||||||
|
|
||||||
if (quester.currentStage.chatEvents.isEmpty() == false) {
|
if (quester.currentStage.chatEvents.isEmpty() == false) {
|
||||||
@ -181,7 +182,7 @@ public class PlayerListener implements Listener {
|
|||||||
|
|
||||||
if (s.equalsIgnoreCase(chat)) {
|
if (s.equalsIgnoreCase(chat)) {
|
||||||
|
|
||||||
if (quester.eventFired.get(s) == false) {
|
if (quester.eventFired.get(s) == null || quester.eventFired.get(s) == false) {
|
||||||
|
|
||||||
quester.currentStage.chatEvents.get(s).fire(quester);
|
quester.currentStage.chatEvents.get(s).fire(quester);
|
||||||
quester.eventFired.put(s, true);
|
quester.eventFired.put(s, true);
|
||||||
|
@ -1773,6 +1773,10 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
|
|
||||||
public void loadQuests() {
|
public void loadQuests() {
|
||||||
|
|
||||||
|
boolean failedToLoad = false;
|
||||||
|
totalQuestPoints = 0;
|
||||||
|
boolean needsSaving = false;
|
||||||
|
|
||||||
FileConfiguration config = new YamlConfiguration();
|
FileConfiguration config = new YamlConfiguration();
|
||||||
File file = new File(this.getDataFolder(), "quests.yml");
|
File file = new File(this.getDataFolder(), "quests.yml");
|
||||||
|
|
||||||
@ -1786,10 +1790,15 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigurationSection section1 = config.getConfigurationSection("quests");
|
ConfigurationSection section1;
|
||||||
boolean failedToLoad = false;
|
if(config.contains("quests"))
|
||||||
totalQuestPoints = 0;
|
section1 = config.getConfigurationSection("quests");
|
||||||
boolean needsSaving = false;
|
else{
|
||||||
|
section1 = config.createSection("quests");
|
||||||
|
needsSaving = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for (String s : section1.getKeys(false)) {
|
for (String s : section1.getKeys(false)) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -97,9 +97,9 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil {
|
|||||||
|
|
||||||
|
|
||||||
if (context.getSessionData(pref + CK.S_USE_IDS) == null) {
|
if (context.getSessionData(pref + CK.S_USE_IDS) == null) {
|
||||||
text += PINK + "" + BOLD + "4 " + RESET + PURPLE + "- " + Lang.get("stageEditorPlaceBlocks") + GRAY + " (" + Lang.get("noneSet") + ")\n";
|
text += PINK + "" + BOLD + "4 " + RESET + PURPLE + "- " + Lang.get("stageEditorUseBlocks") + GRAY + " (" + Lang.get("noneSet") + ")\n";
|
||||||
} else {
|
} else {
|
||||||
text += PINK + "" + BOLD + "4 " + RESET + PURPLE + "- " + Lang.get("stageEditorPlaceBlocks") + "\n";
|
text += PINK + "" + BOLD + "4 " + RESET + PURPLE + "- " + Lang.get("stageEditorUseBlocks") + "\n";
|
||||||
|
|
||||||
LinkedList<Integer> ids = (LinkedList<Integer>) context.getSessionData(pref + CK.S_USE_IDS);
|
LinkedList<Integer> ids = (LinkedList<Integer>) context.getSessionData(pref + CK.S_USE_IDS);
|
||||||
LinkedList<Integer> amnts = (LinkedList<Integer>) context.getSessionData(pref + CK.S_USE_AMOUNTS);
|
LinkedList<Integer> amnts = (LinkedList<Integer>) context.getSessionData(pref + CK.S_USE_AMOUNTS);
|
||||||
|
Loading…
Reference in New Issue
Block a user