mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-12 13:43:57 +01:00
Better solution for 62ccaa1d4a
This commit is contained in:
parent
62ccaa1d4a
commit
b10e55a266
@ -654,10 +654,6 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
} else {
|
} else {
|
||||||
String text = "\n";
|
String text = "\n";
|
||||||
for (final ItemStack is : (List<ItemStack>) context.getSessionData(CK.REQ_ITEMS)) {
|
for (final ItemStack is : (List<ItemStack>) context.getSessionData(CK.REQ_ITEMS)) {
|
||||||
if (is == null) {
|
|
||||||
// TODO - Find out why this happens after first setting GUI Display
|
|
||||||
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
|
|
||||||
}
|
|
||||||
text += ChatColor.GRAY + " - " + ItemUtil.getDisplayString(is) + "\n";
|
text += ChatColor.GRAY + " - " + ItemUtil.getDisplayString(is) + "\n";
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
@ -692,11 +688,17 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
|
|||||||
if (context.getSessionData("newItem") != null) {
|
if (context.getSessionData("newItem") != null) {
|
||||||
if (context.getSessionData(CK.REQ_ITEMS) != null) {
|
if (context.getSessionData(CK.REQ_ITEMS) != null) {
|
||||||
final List<ItemStack> itemReqs = (List<ItemStack>) context.getSessionData(CK.REQ_ITEMS);
|
final List<ItemStack> itemReqs = (List<ItemStack>) context.getSessionData(CK.REQ_ITEMS);
|
||||||
|
final ItemStack i = (ItemStack) context.getSessionData("tempStack");
|
||||||
|
if (i != null) {
|
||||||
itemReqs.add((ItemStack) context.getSessionData("tempStack"));
|
itemReqs.add((ItemStack) context.getSessionData("tempStack"));
|
||||||
|
}
|
||||||
context.setSessionData(CK.REQ_ITEMS, itemReqs);
|
context.setSessionData(CK.REQ_ITEMS, itemReqs);
|
||||||
} else {
|
} else {
|
||||||
final LinkedList<ItemStack> itemReqs = new LinkedList<ItemStack>();
|
final LinkedList<ItemStack> itemReqs = new LinkedList<ItemStack>();
|
||||||
|
final ItemStack i = (ItemStack) context.getSessionData("tempStack");
|
||||||
|
if (i != null) {
|
||||||
itemReqs.add((ItemStack) context.getSessionData("tempStack"));
|
itemReqs.add((ItemStack) context.getSessionData("tempStack"));
|
||||||
|
}
|
||||||
context.setSessionData(CK.REQ_ITEMS, itemReqs);
|
context.setSessionData(CK.REQ_ITEMS, itemReqs);
|
||||||
}
|
}
|
||||||
context.setSessionData("newItem", null);
|
context.setSessionData("newItem", null);
|
||||||
|
Loading…
Reference in New Issue
Block a user