Directly build Art (#11813)

This commit is contained in:
Jake Potrebic
2024-12-27 16:07:48 -08:00
committed by GitHub
parent 33411ec0a1
commit 0629524cb2
7 changed files with 88 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
package io.papermc.paper.registry.data;
import io.papermc.paper.registry.RegistryBuilderFactory;
import java.util.Optional;
import java.util.ServiceLoader;
import java.util.function.Consumer;
import org.bukkit.Art;
import org.jetbrains.annotations.ApiStatus;
@ApiStatus.Internal
@ApiStatus.NonExtendable
public interface InlinedRegistryBuilderProvider {
static InlinedRegistryBuilderProvider instance() {
class Holder {
static final Optional<InlinedRegistryBuilderProvider> INSTANCE = ServiceLoader.load(InlinedRegistryBuilderProvider.class).findFirst();
}
return Holder.INSTANCE.orElseThrow();
}
Art createPaintingVariant(Consumer<RegistryBuilderFactory<Art, ? extends PaintingVariantRegistryEntry.Builder>> value);
}