From 3dc397921ca578d5435896b9c3ef537b3d62331e Mon Sep 17 00:00:00 2001 From: BuildTools Date: Tue, 5 Feb 2019 13:48:26 -0500 Subject: [PATCH] Allow duplicate material types per obj pending results, fixes #680 --- .../quests/prompts/BlocksPrompt.java | 34 +++++++++---------- .../blackvein/quests/prompts/ItemsPrompt.java | 6 ++-- src/main/resources/strings.yml | 1 - 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/main/java/me/blackvein/quests/prompts/BlocksPrompt.java b/src/main/java/me/blackvein/quests/prompts/BlocksPrompt.java index 4c648aa83..281a4f81e 100644 --- a/src/main/java/me/blackvein/quests/prompts/BlocksPrompt.java +++ b/src/main/java/me/blackvein/quests/prompts/BlocksPrompt.java @@ -256,12 +256,12 @@ public class BlocksPrompt extends FixedSetPrompt { for (String s : args) { try { if (Material.matchMaterial(s) != null) { - if (names.contains(s) == false) { + //if (names.contains(s) == false) { names.add(s); - } else { - context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorContainsDuplicates")); + /*} else { + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorListContainsDuplicates")); return new BreakBlockNamesPrompt(); - } + }*/ } else { context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditorInvalidBlockName")); return new BreakBlockNamesPrompt(); @@ -473,12 +473,12 @@ public class BlocksPrompt extends FixedSetPrompt { for (String s : args) { try { if (Material.matchMaterial(s) != null) { - if (names.contains(s) == false) { + //if (names.contains(s) == false) { names.add(s); - } else { + /*} else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorListContainsDuplicates")); return new DamageBlockNamesPrompt(); - } + }*/ } else { context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditorInvalidBlockName")); return new DamageBlockNamesPrompt(); @@ -690,12 +690,12 @@ public class BlocksPrompt extends FixedSetPrompt { for (String s : args) { try { if (Material.matchMaterial(s) != null) { - if (names.contains(s) == false) { + //if (names.contains(s) == false) { names.add(s); - } else { + /*} else { context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("stageEditorListContainsDuplicates")); return new PlaceBlockNamesPrompt(); - } + }*/ } else { context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + Lang.get("stageEditorInvalidBlockName")); return new PlaceBlockNamesPrompt(); @@ -907,12 +907,12 @@ public class BlocksPrompt extends FixedSetPrompt { for (String s : args) { try { if (Material.matchMaterial(s) != null) { - if (names.contains(s) == false) { + //if (names.contains(s) == false) { names.add(s); - } else { - context.getForWhom().sendRawMessage(ChatColor.RED + " " + Lang.get("stageEditorContainsDuplicates")); + /*} else { + context.getForWhom().sendRawMessage(ChatColor.RED + " " + Lang.get("stageEditorListContainsDuplicates")); return new UseBlockNamesPrompt(); - } + }*/ } else { context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditorInvalidBlockName")); return new UseBlockNamesPrompt(); @@ -1124,12 +1124,12 @@ public class BlocksPrompt extends FixedSetPrompt { for (String s : args) { try { if (Material.matchMaterial(s) != null) { - if (names.contains(s) == false) { + //if (names.contains(s) == false) { names.add(s); - } else { + /*} else { context.getForWhom().sendRawMessage(ChatColor.RED + " " + Lang.get("stageEditorListContainsDuplicates")); return new CutBlockNamesPrompt(); - } + }*/ } else { context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditorInvalidBlockName")); return new CutBlockNamesPrompt(); diff --git a/src/main/java/me/blackvein/quests/prompts/ItemsPrompt.java b/src/main/java/me/blackvein/quests/prompts/ItemsPrompt.java index b549cac02..d9262b04c 100644 --- a/src/main/java/me/blackvein/quests/prompts/ItemsPrompt.java +++ b/src/main/java/me/blackvein/quests/prompts/ItemsPrompt.java @@ -283,12 +283,12 @@ public class ItemsPrompt extends FixedSetPrompt { for (String s : args) { try { if (Material.matchMaterial(s) != null) { - if (names.contains(s) == false) { + //if (names.contains(s) == false) { names.add(s); - } else { + /*} else { context.getForWhom().sendRawMessage(ChatColor.RED + " " + Lang.get("stageEditorListContainsDuplicates")); return new EnchantItemsPrompt(); - } + }*/ } else { context.getForWhom().sendRawMessage(ChatColor.LIGHT_PURPLE + s + ChatColor.RED + " " + Lang.get("stageEditorInvalidItemName")); return new EnchantItemsPrompt(); diff --git a/src/main/resources/strings.yml b/src/main/resources/strings.yml index 5c46c1fb5..230e6285b 100644 --- a/src/main/resources/strings.yml +++ b/src/main/resources/strings.yml @@ -237,7 +237,6 @@ stageEditorObjectiveOverrideCleared: "Objective display override cleared." stageEditorDeliveryAddItem: "Add item" stageEditorDeliveryNPCs: "Set NPC IDs" stageEditorDeliveryMessages: "Set delivery messages" -stageEditorContainsDuplicates: "List contains duplicates!" stageEditorInvalidBlockName: "is not a valid block name!" stageEditorInvalidEnchantment: "is not a valid enchantment name!" stageEditorInvalidNPC: "is not a valid NPC ID!"