From 53c9a858771efe8954925761efb6cfa36574e663 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sat, 4 May 2024 21:21:34 +0100 Subject: [PATCH] Allow for chaining plugins when registering --- .../client/model/armour/ArmourRendererPlugin.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/minelittlepony/client/model/armour/ArmourRendererPlugin.java b/src/main/java/com/minelittlepony/client/model/armour/ArmourRendererPlugin.java index 8dc721c0..2c387328 100644 --- a/src/main/java/com/minelittlepony/client/model/armour/ArmourRendererPlugin.java +++ b/src/main/java/com/minelittlepony/client/model/armour/ArmourRendererPlugin.java @@ -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 INSTANCE = new AtomicReference<>(new ArmourRendererPlugin() {}); - static void register(ArmourRendererPlugin plugin) { - INSTANCE.set(plugin); + static void register(Function constructor) { + INSTANCE.set(constructor.apply(INSTANCE.get())); } default ArmourTextureLookup getTextureLookup() {