use of org.bukkit.inventory.meta.KnowledgeBookMeta in project Denizen-For-Bukkit by DenizenScript.
the class ItemKnowledgeBookRecipes method adjust.
@Override
public void adjust(Mechanism mechanism) {
// -->
if (mechanism.matches("knowledge_book_recipes")) {
KnowledgeBookMeta meta = (KnowledgeBookMeta) item.getItemMeta();
List<NamespacedKey> recipes = new ArrayList<>();
ListTag newRecipes = mechanism.valueAsType(ListTag.class);
for (String str : newRecipes) {
recipes.add(Utilities.parseNamespacedKey(str));
}
meta.setRecipes(recipes);
item.setItemMeta(meta);
}
}
Aggregations