Klasse ItemTemplates

java.lang.Object
de.delinkedde.mobarenareborn.item.ItemTemplates

public final class ItemTemplates extends Object
Named item templates with full NBT (enchantments, names, lore, components).

An admin saves the item in hand with /ma saveitem <name>; the stack is serialised natively into items.yml and survives restarts. Kits and rewards reference a template as item:<name>[:amount] wherever a plain material:amount spec is accepted - this is how enchanted kit weapons and reward items work.

  • Konstruktordetails

    • ItemTemplates

      public ItemTemplates(@NotNull @NotNull MobArenaPlugin plugin)
      Parameter:
      plugin - the owning plugin, for the data folder and logging
  • Methodendetails

    • load

      public void load()
      Loads (or reloads) all templates from items.yml.
    • put

      public void put(@NotNull @NotNull String name, @NotNull @NotNull ItemStack item)
      Saves an item as a named template.
      Parameter:
      name - the template name
      item - the item to store (cloned)
    • remove

      public boolean remove(@NotNull @NotNull String name)
      Deletes a template.
      Parameter:
      name - the template name
      Gibt zurück:
      true if it existed
    • resolve

      @Nullable public @Nullable ItemStack resolve(@NotNull @NotNull String name, int amount)
      Resolves a template to a fresh stack.
      Parameter:
      name - the template name
      amount - the desired stack size (<= 0 keeps the stored size)
      Gibt zurück:
      a cloned stack, or null when the template is unknown
    • names

      @NotNull public @NotNull Set<String> names()
      Gibt zurück:
      the sorted template names