Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7606

API layer for new data driven ItemPredicates

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • Snapshot-24w12a
    • Yes

      Since the last snapshot we have extensive, data-driven predicates for items now.

      `RecipeChoice.ExactChoice` implements `Predicate<ItemStack>` but the API doesnt allow custom Predicate implementations as recipe choices, because it might lead to memory leaks when plugins register recipes with them.

      How much sense would it make to have an API layer for item predicates, like an actual `ItemPredicate` class.
      Since items will now be completely composed of components, the implementation shouldnt be too hard.

      This would allow for recipe choices like `*[damage~\{durability:{min:3}}]` => any item which has at least 3 uses left

      And even for custom data predicates (since that is also just a component now).

      I would first have to look into nms and see what they serialize those predicates into, before making a more concrete suggestion or even implementation. I just wanted to write this down somewhere.

            Unassigned Unassigned
            7smile7 Florian Beck
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: