Class PaperEnchantmentConverter

java.lang.Object
io.artificial.enchantments.internal.PaperEnchantmentConverter

public final class PaperEnchantmentConverter extends Object
Converts library EnchantmentDefinition instances to Paper's native EnchantmentRegistryEntry.Builder format for registration during bootstrap.

This utility class bridges the library's enchantment definition format with Paper 1.21+'s native registry system. It handles conversion of properties like description, rarity, costs, supported items, and exclusive conflicts.

Since:
0.2.0
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    convertToBuilder(@NotNull EnchantmentDefinition definition, io.papermc.paper.registry.data.EnchantmentRegistryEntry.Builder builder, @NotNull io.papermc.paper.registry.event.RegistryComposeEvent<org.bukkit.enchantments.Enchantment,io.papermc.paper.registry.data.EnchantmentRegistryEntry.Builder> event)
    Configures a Paper EnchantmentRegistryEntry.Builder from an EnchantmentDefinition.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • convertToBuilder

      public static void convertToBuilder(@NotNull @NotNull EnchantmentDefinition definition, @NotNull io.papermc.paper.registry.data.EnchantmentRegistryEntry.Builder builder, @NotNull @NotNull io.papermc.paper.registry.event.RegistryComposeEvent<org.bukkit.enchantments.Enchantment,io.papermc.paper.registry.data.EnchantmentRegistryEntry.Builder> event)
      Configures a Paper EnchantmentRegistryEntry.Builder from an EnchantmentDefinition.
      Parameters:
      definition - the library enchantment definition
      builder - the Paper builder to configure
      event - the registry compose event for tag lookups