Class ModuleContributions

java.lang.Object
com.ultikits.ultitools.bootstrap.ModuleContributions
All Implemented Interfaces:
DatapackChannel, EnchantmentChannel, TagChannel

final class ModuleContributions extends Object implements EnchantmentChannel, TagChannel, DatapackChannel
Module-local declarations: only a sealed buffer from a successful hook reaches Paper.
  • Field Details

  • Constructor Details

    • ModuleContributions

      ModuleContributions(String name, Path jar)
  • Method Details

    • name

      String name()
    • jar

      Path jar()
    • namespace

      String namespace()
    • enchantments

      EnchantmentChannel enchantments()
    • tags

      TagChannel tags()
    • datapacks

      DatapackChannel datapacks()
    • seal

      void seal()
    • isSealed

      boolean isSealed()
    • enchantmentsByKey

      Map<net.kyori.adventure.key.Key, EnchantmentDefinition> enchantmentsByKey()
    • tagChanges

    • packNames

      Set<String> packNames()
    • packId

      String packId(String pack)
    • register

      public void register(net.kyori.adventure.key.Key key, EnchantmentDefinition definition)
      Description copied from interface: EnchantmentChannel
      Declares a new enchantment. The key's namespace must equal this module's namespace. The definition runs later, once, while Paper composes the enchantment registry.
      Specified by:
      register in interface EnchantmentChannel
      Parameters:
      key - the new enchantment key
      definition - the builder callback
    • addToTag

      public <T extends org.bukkit.Keyed> void addToTag(io.papermc.paper.registry.RegistryKey<T> registry, net.kyori.adventure.key.Key tag, Collection<net.kyori.adventure.key.Key> values)
      Description copied from interface: TagChannel
      Adds values to an existing or new tag of the given registry; any namespace may be extended.
      Specified by:
      addToTag in interface TagChannel
      Type Parameters:
      T - the registry value type
      Parameters:
      registry - a supported registry
      tag - the tag key
      values - the entry keys to add
    • setTag

      public <T extends org.bukkit.Keyed> void setTag(io.papermc.paper.registry.RegistryKey<T> registry, net.kyori.adventure.key.Key tag, Collection<net.kyori.adventure.key.Key> values)
      Description copied from interface: TagChannel
      Creates or replaces a tag in this module's namespace with exactly these values.
      Specified by:
      setTag in interface TagChannel
      Type Parameters:
      T - the registry value type
      Parameters:
      registry - a supported registry
      tag - the tag key
      values - the replacement entry keys
    • declareTag

      private void declareTag(io.papermc.paper.registry.RegistryKey<?> registry, net.kyori.adventure.key.Key tag, Collection<net.kyori.adventure.key.Key> values, boolean replace)
    • embedded

      public void embedded(String pack)
      Description copied from interface: DatapackChannel
      Declares the bundled data pack at datapacks/<name>/ in this module's JAR. Data packs that add world-generation data are refused: the module will not load, even if it catches the exception from this method.
      Specified by:
      embedded in interface DatapackChannel
      Parameters:
      pack - lower-case [a-z0-9_-]{1,32}; the server lists it as UltiTools/<namespace>.<name>
    • worldgenRefusal

      @Nullable @Nullable ModuleContributions.WorldgenRefusal worldgenRefusal()
    • refuseWorldgen

      private void refuseWorldgen(ZipFile archive, String pack)
    • worldgenDirectory

      @Nullable static @Nullable String worldgenDirectory(ZipFile archive, String pack)
    • validatePack

      static void validatePack(ZipFile archive, String pack) throws IOException
      Throws:
      IOException
    • ledgerEntries

      List<ContentEntry> ledgerEntries()
    • exclusiveEntries

      List<ContentEntry> exclusiveEntries()
    • requireNamespace

      private void requireNamespace(net.kyori.adventure.key.Key key)
    • requireOpen

      private void requireOpen()
    • copyKey

      private static net.kyori.adventure.key.Key copyKey(net.kyori.adventure.key.Key key)