mirror of
https://github.com/PikaMug/Quests.git
synced 2025-01-13 03:40:37 +01:00
Correct string replacement, part 2
This commit is contained in:
parent
c7cfa9aaa5
commit
8a218031cf
@ -12,12 +12,12 @@
|
||||
|
||||
package me.blackvein.quests.convo.generic;
|
||||
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
|
||||
import me.blackvein.quests.convo.quests.QuestsEditorStringPrompt;
|
||||
import me.blackvein.quests.events.editor.quests.QuestsEditorPostOpenStringPromptEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class OverridePrompt extends QuestsEditorStringPrompt {
|
||||
@ -60,8 +60,15 @@ public class OverridePrompt extends QuestsEditorStringPrompt {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Prompt acceptInput(final ConversationContext context, final String input) {
|
||||
context.setSessionData(classPrefix + "-override", input);
|
||||
public Prompt acceptInput(final @NotNull ConversationContext context, final String input) {
|
||||
if (input != null) {
|
||||
if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.getForWhom().sendRawMessage(ChatColor.YELLOW + Lang.get("stageEditorMessageCleared"));
|
||||
context.setSessionData(classPrefix + "-override", Lang.get("cmdClear"));
|
||||
} else if (!input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
context.setSessionData(classPrefix + "-override", input);
|
||||
}
|
||||
}
|
||||
return oldPrompt;
|
||||
}
|
||||
|
||||
|
@ -436,8 +436,8 @@ public class StageMainPrompt extends QuestsEditorNumericPrompt {
|
||||
@Override
|
||||
public @NotNull String getBasicPromptText(final ConversationContext context) {
|
||||
final String input = (String) context.getSessionData(classPrefix + "-override");
|
||||
if (input != null && !input.equalsIgnoreCase(Lang.get("cancel"))) {
|
||||
if (input.equalsIgnoreCase(Lang.get("clear"))) {
|
||||
if (input != null && !input.equalsIgnoreCase(Lang.get("cmdCancel"))) {
|
||||
if (input.equalsIgnoreCase(Lang.get("cmdClear"))) {
|
||||
context.setSessionData(stagePrefix + CK.S_OVERRIDE_DISPLAY, null);
|
||||
} else {
|
||||
final LinkedList<String> overrides = new LinkedList<>();
|
||||
|
Loading…
Reference in New Issue
Block a user