Allow for chaining plugins when registering

This commit is contained in:
Sollace 2024-05-04 21:21:34 +01:00
parent ced4a2d980
commit 53c9a85877
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -18,12 +18,13 @@ import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
public interface ArmourRendererPlugin {
AtomicReference<ArmourRendererPlugin> INSTANCE = new AtomicReference<>(new ArmourRendererPlugin() {});
static void register(ArmourRendererPlugin plugin) {
INSTANCE.set(plugin);
static void register(Function<ArmourRendererPlugin, ArmourRendererPlugin> constructor) {
INSTANCE.set(constructor.apply(INSTANCE.get()));
}
default ArmourTextureLookup getTextureLookup() {