Skip to content

Commit

Permalink
recipe_ids: don't show non-Denizen recipes for script items
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 18, 2019
1 parent 8d3f08a commit 0036144
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -969,6 +969,7 @@ public ObjectTag run(Attribute attribute, ObjectTag object) {
public ObjectTag run(Attribute attribute, ObjectTag object) {
String type = attribute.hasContext(1) ? CoreUtilities.toLowerCase(attribute.getContext(1)) : null;
ItemTag item = (ItemTag) object;
boolean isScripted = item.isItemscript();
ListTag list = new ListTag();
for (Recipe recipe : Bukkit.getRecipesFor(item.getItemStack())) {
if (type != null && (
Expand All @@ -984,6 +985,9 @@ public ObjectTag run(Attribute attribute, ObjectTag object) {
continue;
}
if (recipe instanceof Keyed) {
if (isScripted && !((Keyed) recipe).getKey().getKey().equalsIgnoreCase("denizen")) {
continue;
}
list.add(((Keyed) recipe).getKey().toString());
}
}
Expand Down

0 comments on commit 0036144

Please sign in to comment.