From 148ae5ea9987013ce39e46e742fa3fe7c91dbaee Mon Sep 17 00:00:00 2001 From: Zino Date: Fri, 9 Aug 2013 12:52:11 +0200 Subject: [PATCH] * Fix for Citizens * Fix language mistakes --- .../me/blackvein/quests/NpcEffectThread.java | 16 +++++----- .../me/blackvein/quests/QuestFactory.java | 32 +++++++++---------- .../quests/prompts/CreateStagePrompt.java | 4 +-- .../java/me/blackvein/quests/util/Lang.java | 4 +-- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/main/java/me/blackvein/quests/NpcEffectThread.java b/src/main/java/me/blackvein/quests/NpcEffectThread.java index 5ccb7b22b..dd0a5c0e6 100644 --- a/src/main/java/me/blackvein/quests/NpcEffectThread.java +++ b/src/main/java/me/blackvein/quests/NpcEffectThread.java @@ -26,14 +26,14 @@ public class NpcEffectThread implements Runnable{ if(nearby.isEmpty() == false){ for(Entity e : nearby){ - - if(plugin.citizens.getNPCRegistry().isNPC(e)){ - - NPC npc = plugin.citizens.getNPCRegistry().getNPC(e); - if(plugin.hasQuest(npc, quester)) - showEffect(player, npc); - - } + if(plugin.citizens != null) + if(plugin.citizens.getNPCRegistry().isNPC(e)){ + + NPC npc = plugin.citizens.getNPCRegistry().getNPC(e); + if(plugin.hasQuest(npc, quester)) + showEffect(player, npc); + + } } diff --git a/src/main/java/me/blackvein/quests/QuestFactory.java b/src/main/java/me/blackvein/quests/QuestFactory.java index 676864255..06b25c05c 100644 --- a/src/main/java/me/blackvein/quests/QuestFactory.java +++ b/src/main/java/me/blackvein/quests/QuestFactory.java @@ -430,8 +430,8 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - String text = GOLD + "- " + Lang.get("questCreateHeader") + " -\n"; - text += AQUA + Lang.get("questCreateNew") + " " + GOLD + "- " + Lang.get("enterQuestName"); + String text = GOLD + "- " + Lang.get("questEditorHeader") + " -\n"; + text += AQUA + Lang.get("questEditorCreate") + " " + GOLD + "- " + Lang.get("questEditorEnterQuestName"); return text; @@ -446,7 +446,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (q.name.equalsIgnoreCase(input)) { - context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questNameExists")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorNameExists")); return new QuestNamePrompt(); } @@ -455,14 +455,14 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (names.contains(input)) { - context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questBeingEdited")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorBeingEdited")); return new QuestNamePrompt(); } if (input.contains(",")) { - context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questNameContainsCommas")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorInvalidQuestName")); return new QuestNamePrompt(); } @@ -485,7 +485,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return ChatColor.YELLOW + Lang.get("enterNPCStart"); + return ChatColor.YELLOW + Lang.get("questEditorEnterQuestName"); } @@ -495,7 +495,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { if (input.intValue() > -1) { if (CitizensAPI.getNPCRegistry().getById(input.intValue()) == null) { - context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("npcNonExistant")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorInvalidNPC")); return new SetNpcStartPrompt(); } @@ -508,7 +508,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } else if (input.intValue() == -2) { return new CreateMenuPrompt(); } else { - context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("npcNonExistant")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorInvalidNPC")); return new SetNpcStartPrompt(); } @@ -520,7 +520,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return ChatColor.YELLOW + Lang.get("enterBlockStart"); + return ChatColor.YELLOW + Lang.get("questEditorEnterBlockStart"); } @@ -538,7 +538,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { context.setSessionData(CK.Q_START_BLOCK, loc); selectedBlockStarts.remove(player); } else { - player.sendMessage(ChatColor.RED + Lang.get("blockNotSelected")); + player.sendMessage(ChatColor.RED + Lang.get("questEditorNoStartBlockSelected")); return new BlockStartPrompt(); } @@ -567,7 +567,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return ChatColor.YELLOW + Lang.get("enterQuestName"); + return ChatColor.YELLOW + Lang.get("questEditorEnterQuestName"); } @@ -585,7 +585,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } if (s != null && s.equalsIgnoreCase(input) == false) { - context.getForWhom().sendRawMessage(RED + Lang.get("questNameExists")); + context.getForWhom().sendRawMessage(RED + Lang.get("questEditorNameExists")); return new SetNamePrompt(); } } @@ -593,13 +593,13 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { } if (names.contains(input)) { - context.getForWhom().sendRawMessage(RED + Lang.get("questBeingEdited")); + context.getForWhom().sendRawMessage(RED + Lang.get("questEditorBeingEdited")); return new SetNamePrompt(); } if (input.contains(",")) { - context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questNameContainsCommas")); + context.getForWhom().sendRawMessage(ChatColor.RED + Lang.get("questEditorInvalidQuestName")); return new QuestNamePrompt(); } @@ -620,7 +620,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return ChatColor.YELLOW + Lang.get("enterAskMessage"); + return ChatColor.YELLOW + Lang.get("questEditorEnterAskMessage"); } @@ -647,7 +647,7 @@ public class QuestFactory implements ConversationAbandonedListener, ColorUtil { @Override public String getPromptText(ConversationContext context) { - return ChatColor.YELLOW + Lang.get("enterFinishMessage"); + return ChatColor.YELLOW + Lang.get("questEditorEnterFinishMessage"); } diff --git a/src/main/java/me/blackvein/quests/prompts/CreateStagePrompt.java b/src/main/java/me/blackvein/quests/prompts/CreateStagePrompt.java index 1881e4340..d4412aca0 100644 --- a/src/main/java/me/blackvein/quests/prompts/CreateStagePrompt.java +++ b/src/main/java/me/blackvein/quests/prompts/CreateStagePrompt.java @@ -3788,7 +3788,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { player.sendMessage(YELLOW + "Start message cleared."); return new CreateStagePrompt(stageNum, questFactory, citizens); } else { - return new StartMessagePrompt(); + return new CreateStagePrompt(stageNum, questFactory, citizens); } } @@ -3817,7 +3817,7 @@ public class CreateStagePrompt extends FixedSetPrompt implements ColorUtil { player.sendMessage(YELLOW + "Complete message cleared."); return new CreateStagePrompt(stageNum, questFactory, citizens); } else { - return new CompleteMessagePrompt(); + return new CreateStagePrompt(stageNum, questFactory, citizens); } } diff --git a/src/main/java/me/blackvein/quests/util/Lang.java b/src/main/java/me/blackvein/quests/util/Lang.java index 9fed44770..695ea6b9d 100644 --- a/src/main/java/me/blackvein/quests/util/Lang.java +++ b/src/main/java/me/blackvein/quests/util/Lang.java @@ -45,7 +45,7 @@ public class Lang { en.put("questEditorBlockStart", "Set Block start"); en.put("questEditorInitialEvent", "Set initial Event"); en.put("questEditorReqs", "Edit Requirements"); - en.put("questEditorStages", "Edit Stage"); + en.put("questEditorStages", "Edit Stages"); en.put("questEditorRews", "Edit Rewards"); en.put("questEditorEnterQuestName", "Enter Quest name (or \"cancel\" to return)"); @@ -255,7 +255,7 @@ public class Lang { //Misc en.put("event", "Event"); - en.put("save", "save"); + en.put("save", "Save"); en.put("exit", "Exit"); en.put("exited", "Exited."); en.put("yes", "Yes");