From 754412074faf5cc79be915cdfcd54c8b16771883 Mon Sep 17 00:00:00 2001 From: Paint_Ninja Date: Fri, 16 Aug 2024 19:36:30 +0100 Subject: [PATCH] Add non-varargs version of IConfigurable methods to allow implementations to optimize if they want. (#20) --- build.gradle | 2 +- .../forgespi/language/IConfigurable.java | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index c423b5c..9ecbdac 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,7 @@ tasks.named('jar', Jar).configure { dependencies { implementation('org.apache.logging.log4j:log4j-api:2.17.0') // Needed for Type - implementation('org.ow2.asm:asm:9.6') + implementation('org.ow2.asm:asm:9.7') // Needed for dependency version comparisons implementation('org.apache.maven:maven-artifact:3.8.1') // Needed for SecureJar API class diff --git a/src/main/java/net/minecraftforge/forgespi/language/IConfigurable.java b/src/main/java/net/minecraftforge/forgespi/language/IConfigurable.java index 91bdcbd..9e7363c 100644 --- a/src/main/java/net/minecraftforge/forgespi/language/IConfigurable.java +++ b/src/main/java/net/minecraftforge/forgespi/language/IConfigurable.java @@ -11,6 +11,15 @@ * This is an interface for querying configuration elements */ public interface IConfigurable { - Optional getConfigElement(final String... key); - public List getConfigList(final String... key); + default Optional getConfigElement(String key) { + return getConfigElement(new String[] { key }); + } + + Optional getConfigElement(String... key); + + default List getConfigList(String key) { + return getConfigList(new String[] { key }); + } + + List getConfigList(String... key); }