mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-25 10:38:21 +01:00
Only allow one editor instance per player
This commit is contained in:
parent
2360f68eda
commit
f8456a66fc
@ -436,7 +436,12 @@ public class CmdExecutor implements CommandExecutor {
|
|||||||
private boolean questsActions(final CommandSender cs) {
|
private boolean questsActions(final CommandSender cs) {
|
||||||
if (cs.hasPermission("quests.events.*") || cs.hasPermission("quests.actions.*")
|
if (cs.hasPermission("quests.events.*") || cs.hasPermission("quests.actions.*")
|
||||||
|| cs.hasPermission("quests.actions.editor") || cs.hasPermission("quests.events.editor")) {
|
|| cs.hasPermission("quests.actions.editor") || cs.hasPermission("quests.events.editor")) {
|
||||||
plugin.getEventFactory().getConversationFactory().buildConversation((Conversable) cs).begin();
|
Conversable c = (Conversable) cs;
|
||||||
|
if (!c.isConversing()) {
|
||||||
|
plugin.getEventFactory().getConversationFactory().buildConversation(c).begin();
|
||||||
|
} else {
|
||||||
|
cs.sendMessage(ChatColor.RED + Lang.get("duplicateEditor"));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
cs.sendMessage(ChatColor.RED + Lang.get("NoPermission"));
|
cs.sendMessage(ChatColor.RED + Lang.get("NoPermission"));
|
||||||
}
|
}
|
||||||
@ -445,7 +450,12 @@ public class CmdExecutor implements CommandExecutor {
|
|||||||
|
|
||||||
private boolean questsEditor(final CommandSender cs) {
|
private boolean questsEditor(final CommandSender cs) {
|
||||||
if (cs.hasPermission("quests.editor.*") || cs.hasPermission("quests.editor.editor")) {
|
if (cs.hasPermission("quests.editor.*") || cs.hasPermission("quests.editor.editor")) {
|
||||||
plugin.getQuestFactory().getConversationFactory().buildConversation((Conversable) cs).begin();
|
Conversable c = (Conversable) cs;
|
||||||
|
if (!c.isConversing()) {
|
||||||
|
plugin.getQuestFactory().getConversationFactory().buildConversation(c).begin();
|
||||||
|
} else {
|
||||||
|
cs.sendMessage(ChatColor.RED + Lang.get("duplicateEditor"));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
cs.sendMessage(ChatColor.RED + Lang.get("NoPermission"));
|
cs.sendMessage(ChatColor.RED + Lang.get("NoPermission"));
|
||||||
}
|
}
|
||||||
|
@ -863,4 +863,5 @@ timerStart: "%green%You have%red% <time> seconds%green% to finish this quest/sta
|
|||||||
questErrorReadingFile: "Error reading Quests file."
|
questErrorReadingFile: "Error reading Quests file."
|
||||||
questSaveError: "An error occurred while saving."
|
questSaveError: "An error occurred while saving."
|
||||||
noPermission: "You do not have permission to do that."
|
noPermission: "You do not have permission to do that."
|
||||||
|
duplicateEditor: "You are already using an editor!"
|
||||||
difference: "The difference is '<data>'."
|
difference: "The difference is '<data>'."
|
Loading…
Reference in New Issue
Block a user