Class ItemBuilderLoader

java.lang.Object
com.kamikazejam.kamicommon.item.ItemBuilderLoader

public class ItemBuilderLoader extends Object
Loader to assist in automatically extracting ItemBuilders from configuration sections.

Supports the KamiConfig system, requiring a ConfigurationSection object to load from.
  • Constructor Details

    • ItemBuilderLoader

      public ItemBuilderLoader()
  • Method Details

    • load

      @NotNull public static @NotNull ItemBuilder load(@NotNull @NotNull ConfigurationSection section)
      Load a full ItemBuilder from a configuration section.

      The section can define the material, amount, name, lore, and many additional attributes of the item.
      Returns:
      The loaded ItemBuilder where the config values were set as IBuilder PATCHES.
      Throws:
      IllegalArgumentException - If any part of the parsing failed (for example if no valid material was defined).
    • loadPatches

      @NotNull public static @NotNull ItemBuilder loadPatches(@NotNull @NotNull ItemStack prototype, @NotNull @NotNull ConfigurationSection section)
      Load an ItemBuilder from a prototype ItemStack and a configuration section which defines additional patches to apply to the item.

      The section can define the amount, name, lore, and many additional attributes of the item. (Everything except the material type)
      Parameters:
      prototype - The prototype item stack to base the ItemBuilder on, this defines the material type and any existing item meta.
      section - The configuration section to load additional patches from.