diff --git a/fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/api/attachment/v1/AttachmentRegistry.java b/fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/api/attachment/v1/AttachmentRegistry.java index 959c299ac3..e325bfaa99 100644 --- a/fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/api/attachment/v1/AttachmentRegistry.java +++ b/fabric-data-attachment-api-v1/src/main/java/net/fabricmc/fabric/api/attachment/v1/AttachmentRegistry.java @@ -16,7 +16,7 @@ package net.fabricmc.fabric.api.attachment.v1; -import java.util.Objects; +import java.util.function.Consumer; import java.util.function.Supplier; import com.mojang.serialization.Codec; @@ -30,19 +30,35 @@ * Class used to create and register {@link AttachmentType}s. To quickly create {@link AttachmentType}s, use one of the various * {@code createXXX} methods: *
For finer control over the attachment type and its properties, use {@link AttachmentRegistry#builder()} to - * get a {@link Builder} instance.
+ *For finer control over the attachment type and its properties, use {@link #create(Identifier, Consumer)} to + * get and configure a {@link Builder} instance.
*/ @ApiStatus.Experimental public final class AttachmentRegistry { private AttachmentRegistry() { } + /** + * Creates and registers an attachment, configuring the builder used underneath. + * + * @param id the identifier of this attachment + * @param the type of attached data + * @return the registered {@link AttachmentType} instance + */ + public static AttachmentType create(Identifier id, Consumer