mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 04:27:59 +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 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() {
|
||||
|
|
Loading…
Reference in a new issue