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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final record(package private) static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<net.kyori.adventure.key.Key, EnchantmentDefinition> private final Pathprivate final String(package private) static final Patternprivate booleanprivate final List<ModuleContributions.TagChange> private static final Patternprivate @Nullable ModuleContributions.WorldgenRefusalFields inherited from interface TagChannel
SUPPORTED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends org.bukkit.Keyed>
voidaddToTag(io.papermc.paper.registry.RegistryKey<T> registry, net.kyori.adventure.key.Key tag, Collection<net.kyori.adventure.key.Key> values) Adds values to an existing or new tag of the given registry; any namespace may be extended.private static net.kyori.adventure.key.KeycopyKey(net.kyori.adventure.key.Key key) (package private) DatapackChannelprivate voiddeclareTag(io.papermc.paper.registry.RegistryKey<?> registry, net.kyori.adventure.key.Key tag, Collection<net.kyori.adventure.key.Key> values, boolean replace) voidDeclares the bundled data pack atdatapacks/<name>/in this module's JAR.(package private) EnchantmentChannel(package private) Map<net.kyori.adventure.key.Key, EnchantmentDefinition> (package private) List<ContentEntry> (package private) booleanisSealed()(package private) Pathjar()(package private) List<ContentEntry> (package private) Stringname()(package private) String(package private) Stringprivate voidrefuseWorldgen(ZipFile archive, String pack) voidregister(net.kyori.adventure.key.Key key, EnchantmentDefinition definition) Declares a new enchantment.private voidrequireNamespace(net.kyori.adventure.key.Key key) private void(package private) voidseal()<T extends org.bukkit.Keyed>
voidsetTag(io.papermc.paper.registry.RegistryKey<T> registry, net.kyori.adventure.key.Key tag, Collection<net.kyori.adventure.key.Key> values) Creates or replaces a tag in this module's namespace with exactly these values.(package private) List<ModuleContributions.TagChange> (package private) TagChanneltags()(package private) static voidvalidatePack(ZipFile archive, String pack) (package private) static @Nullable StringworldgenDirectory(ZipFile archive, String pack) (package private) @Nullable ModuleContributions.WorldgenRefusal
-
Field Details
-
PACK_NAME
-
WORLDGEN
-
name
-
jar
-
enchantments
-
tags
-
packs
-
sealed
private boolean sealed -
worldgenRefusal
-
-
Constructor Details
-
ModuleContributions
-
-
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
List<ModuleContributions.TagChange> tagChanges() -
packNames
-
packId
-
register
Description copied from interface:EnchantmentChannelDeclares 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:
registerin interfaceEnchantmentChannel- Parameters:
key- the new enchantment keydefinition- 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:TagChannelAdds values to an existing or new tag of the given registry; any namespace may be extended.- Specified by:
addToTagin interfaceTagChannel- Type Parameters:
T- the registry value type- Parameters:
registry- a supported registrytag- the tag keyvalues- 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:TagChannelCreates or replaces a tag in this module's namespace with exactly these values.- Specified by:
setTagin interfaceTagChannel- Type Parameters:
T- the registry value type- Parameters:
registry- a supported registrytag- the tag keyvalues- 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
Description copied from interface:DatapackChannelDeclares the bundled data pack atdatapacks/<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:
embeddedin interfaceDatapackChannel- Parameters:
pack- lower-case[a-z0-9_-]{1,32}; the server lists it asUltiTools/<namespace>.<name>
-
worldgenRefusal
-
refuseWorldgen
-
worldgenDirectory
-
validatePack
- 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)
-