mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-14 14:45:41 +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) {
|
||||
|
||||
Quester quester = plugin.getQuester(evt.getPlayer().getName());
|
||||
|
||||
if (quester.currentStage != null) {
|
||||
|
||||
if (quester.currentStage.chatEvents.isEmpty() == false) {
|
||||
@ -181,7 +182,7 @@ public class PlayerListener implements Listener {
|
||||
|
||||
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.eventFired.put(s, true);
|
||||
|
@ -1773,6 +1773,10 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
|
||||
public void loadQuests() {
|
||||
|
||||
boolean failedToLoad = false;
|
||||
totalQuestPoints = 0;
|
||||
boolean needsSaving = false;
|
||||
|
||||
FileConfiguration config = new YamlConfiguration();
|
||||
File file = new File(this.getDataFolder(), "quests.yml");
|
||||
|
||||
@ -1786,10 +1790,15 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
ConfigurationSection section1 = config.getConfigurationSection("quests");
|
||||
boolean failedToLoad = false;
|
||||
totalQuestPoints = 0;
|
||||
boolean needsSaving = false;
|
||||
ConfigurationSection section1;
|
||||
if(config.contains("quests"))
|
||||
section1 = config.getConfigurationSection("quests");
|
||||
else{
|
||||
section1 = config.createSection("quests");
|
||||
needsSaving = true;
|
||||
}
|
||||
|
||||
|
||||
for (String s : section1.getKeys(false)) {
|
||||
|
||||
try {
|
||||
|
@ -97,9 +97,9 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil {
|
||||
|
||||
|
||||
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 {
|
||||
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> amnts = (LinkedList<Integer>) context.getSessionData(pref + CK.S_USE_AMOUNTS);
|
||||
|
Loading…
Reference in New Issue
Block a user