Disallow periods in quest names, fixes #87

This commit is contained in:
HappyPikachu 2016-06-15 12:03:09 -04:00
parent a3efc78fe8
commit 7dd2b006ad
5 changed files with 7 additions and 7 deletions

View File

@ -3,7 +3,7 @@
<groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId>
<version>2.6.2</version>
<version>2.6.3</version>
<name>quests</name>
<url>https://github.com/FlyingPikachu/Quests/</url>
<packaging>jar</packaging>

View File

@ -491,8 +491,8 @@ public class PlayerListener implements Listener, ColorUtil {
if (quester.hasObjective(quest, "breakBlock")) {
if (evt.getPlayer().getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH) == false && evt.isCancelled() == false) {
quester.breakBlock(quest, evt.getBlock().getType());
if (evt.getPlayer().getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH) == false && evt.isCancelled() == false) {
quester.breakBlock(quest, evt.getBlock().getType());
}
}

View File

@ -523,7 +523,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil {
}
if (input.contains(",")) {
if (input.contains(".") || input.contains(",")) {
context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorInvalidQuestName"));
return new QuestNamePrompt();

View File

@ -2085,11 +2085,11 @@ public class Quester {
ConfigurationSection dataSec = data.createSection("questData");
for (Quest quest : currentQuests.keySet()) {
ConfigurationSection questSec = dataSec.createSection(quest.name);
QuestData questData = getQuestData(quest);
if (questData == null) continue;
if (questData.blocksDamaged.isEmpty() == false) {
LinkedList<String> blockNames = new LinkedList<String>();

View File

@ -225,7 +225,7 @@ public class Lang {
//Quest create menu errors
langMap.put("questEditorNameExists", "A Quest with that name already exists!");
langMap.put("questEditorBeingEdited", "Someone is creating/editing a Quest with that name!");
langMap.put("questEditorInvalidQuestName", "Name may not contain commas!");
langMap.put("questEditorInvalidQuestName", "Name may not contain periods or commas!");
langMap.put("questEditorInvalidEventName", "is not a valid event name!");
langMap.put("questEditorInvalidNPC", "No NPC exists with that id!");
langMap.put("questEditorNoStartBlockSelected", "You must select a block first.");