mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-16 17:44:23 +01:00
Allow for chaining plugins when registering
This commit is contained in:
parent
ced4a2d980
commit
53c9a85877
1 changed files with 3 additions and 2 deletions
|
@ -18,12 +18,13 @@ import net.minecraft.util.Identifier;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
public interface ArmourRendererPlugin {
|
public interface ArmourRendererPlugin {
|
||||||
AtomicReference<ArmourRendererPlugin> INSTANCE = new AtomicReference<>(new ArmourRendererPlugin() {});
|
AtomicReference<ArmourRendererPlugin> INSTANCE = new AtomicReference<>(new ArmourRendererPlugin() {});
|
||||||
|
|
||||||
static void register(ArmourRendererPlugin plugin) {
|
static void register(Function<ArmourRendererPlugin, ArmourRendererPlugin> constructor) {
|
||||||
INSTANCE.set(plugin);
|
INSTANCE.set(constructor.apply(INSTANCE.get()));
|
||||||
}
|
}
|
||||||
|
|
||||||
default ArmourTextureLookup getTextureLookup() {
|
default ArmourTextureLookup getTextureLookup() {
|
||||||
|
|
Loading…
Reference in a new issue