Package com.kamikazejam.kamicommon.item
Class ItemBuilderLoader
java.lang.Object
com.kamikazejam.kamicommon.item.ItemBuilderLoader
Loader to assist in automatically extracting
Supports the
ItemBuilder
s from configuration sections.Supports the
KamiConfig
system, requiring a ConfigurationSection
object to load from.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ItemBuilder
load
(@NotNull ConfigurationSection section) Load a fullItemBuilder
from a configuration section.
The section can define the material, amount, name, lore, and many additional attributes of the item.static @NotNull ItemBuilder
loadPatches
(@NotNull ItemStack prototype, @NotNull ConfigurationSection section) Load anItemBuilder
from a prototypeItemStack
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.
-
Constructor Details
-
ItemBuilderLoader
public ItemBuilderLoader()
-
-
Method Details
-
load
Load a fullItemBuilder
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 anItemBuilder
from a prototypeItemStack
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.
-