EnchantmentItems

public final class EnchantmentItems

Shared item operations. Hosts retain inventory transactions, acquisition policy and effect dispatch.

Constructors

Link copied to clipboard
public void EnchantmentItems(Function<String, EnchantmentItems.Resolved> resolver, Function<ItemStack, EnchantmentItemProfile> classifier)

Types

Link copied to clipboard
public final class Construction
Immutable definitions for worker-owned items.
Link copied to clipboard
public final class Preview
Link copied to clipboard
public final class Resolved extends Record

Functions

Link copied to clipboard
public static EnchantmentItemProfile classify(ItemStack item)
Reuses registered authored-item classifiers without applying anvil-specific acquisition vetoes.
Link copied to clipboard
public Map<String, Integer> inspect(ItemStack item)
Identity comes only from native metadata and the versioned custom record.
Link copied to clipboard
public static Map<String, Integer> inspectCustom(ItemMeta meta)
Reads caller-owned metadata without consulting providers or accessing an inventory.
Link copied to clipboard
public static EnchantmentItems.Construction prepareConstruction(Collection<String> ids)
Link copied to clipboard
public EnchantmentItems.Preview preview(ItemStack source, Map<String, Integer> proposed)
Produces a reviewable clone.
Link copied to clipboard
public EnchantmentItems.Preview previewAuthored(ItemStack source, Map<String, Integer> proposed)
Administrator-authored items supersede acquisition limits and compatibility rules.
Link copied to clipboard
public EnchantmentItems.Preview previewAuthoredCustom(ItemStack source, Map<String, Integer> proposedCustom)
Hosts with extended native storage author custom entries without rewriting native metadata.
Link copied to clipboard
public EnchantmentItems.Preview previewCustom(ItemStack source, Map<String, Integer> proposedCustom)
Updates the complete custom set while leaving the host's native enchantment data untouched.
Link copied to clipboard
public ItemStack refreshPresentation(ItemStack source)
Redraws known/inactive entries without changing their identities or levels.
public ItemStack refreshPresentation(ItemStack source, UnaryOperator<List<String>> rebuildHostLore)
Rebuilds host lore around the validated shared section, retaining its position.
public ItemStack refreshPresentation(ItemStack source, UnaryOperator<List<String>> rebuildHostLore, ToIntFunction<List<String>> enchantmentPosition)
Rebuilds host lore and places the shared enchantment section at the supplied host-line index.