mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-23 11:05:38 +01:00
Add debug messages for #800
This commit is contained in:
parent
98c76468db
commit
3801c675be
@ -368,8 +368,14 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
public Prompt acceptInput(ConversationContext context, String s) {
|
public Prompt acceptInput(ConversationContext context, String s) {
|
||||||
Player player = (Player) context.getForWhom();
|
Player player = (Player) context.getForWhom();
|
||||||
if (s.equalsIgnoreCase(Lang.get(player, "yesWord"))) {
|
if (s.equalsIgnoreCase(Lang.get(player, "yesWord"))) {
|
||||||
|
String questToTake = getQuester(player.getUniqueId()).questToTake;
|
||||||
try {
|
try {
|
||||||
getQuester(player.getUniqueId()).takeQuest(getQuest(getQuester(player.getUniqueId()).questToTake), false);
|
if (getQuest(questToTake) == null) {
|
||||||
|
getLogger().info(player.getName() + " attempted to take quest \"" + questToTake + "\" but something went wrong");
|
||||||
|
player.sendMessage(ChatColor.RED + "Something went wrong! Please report issue to an administrator.");
|
||||||
|
} else {
|
||||||
|
getQuester(player.getUniqueId()).takeQuest(getQuest(questToTake), false);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -3160,7 +3166,13 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a Quest by name
|
||||||
|
*
|
||||||
|
* @param name Name of the quest
|
||||||
|
* @return Quest or null if not found
|
||||||
|
*/
|
||||||
public Quest getQuest(String name) {
|
public Quest getQuest(String name) {
|
||||||
for (Quest q : quests) {
|
for (Quest q : quests) {
|
||||||
if (q.getName().equalsIgnoreCase(name)) {
|
if (q.getName().equalsIgnoreCase(name)) {
|
||||||
@ -3171,7 +3183,31 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get an Action by name
|
||||||
|
*
|
||||||
|
* @param name Name of the action
|
||||||
|
* @return Action or null if not found
|
||||||
|
*/
|
||||||
|
public Action getAction(String name) {
|
||||||
|
for (Action e : events) {
|
||||||
|
if (e.getName().equalsIgnoreCase(name)){
|
||||||
|
return e;
|
||||||
|
} else if (e.getName().toLowerCase().startsWith(name.toLowerCase())) {
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get an Action by name
|
||||||
|
*
|
||||||
|
* @param name Name of the action
|
||||||
|
* @return Action or null if not found
|
||||||
|
* @deprecated Use getAction()
|
||||||
|
*/
|
||||||
public Action getEvent(String name) {
|
public Action getEvent(String name) {
|
||||||
for (Action e : events) {
|
for (Action e : events) {
|
||||||
if (e.getName().equalsIgnoreCase(name)){
|
if (e.getName().equalsIgnoreCase(name)){
|
||||||
|
Loading…
Reference in New Issue
Block a user