From 3cae8dc0ede0f6af7cb80bcd32d82de972357bdd Mon Sep 17 00:00:00 2001 From: AlexIIL Date: Sun, 22 Oct 2023 09:21:08 +0100 Subject: [PATCH] Add LanguageAdapter.getDefault() --- gradle.properties | 2 +- .../java/org/quiltmc/loader/api/LanguageAdapter.java | 11 +++++++++++ .../java/org/quiltmc/loader/impl/QuiltLoaderImpl.java | 2 +- src/main/resources/changelog/0.21.2.txt | 3 +++ 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/changelog/0.21.2.txt diff --git a/gradle.properties b/gradle.properties index b5d771eb2..84f6e6e8a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ group = org.quiltmc description = The mod loading component of Quilt url = https://github.com/quiltmc/quilt-loader # Don't forget to change this in QuiltLoaderImpl as well -quilt_loader = 0.21.1 +quilt_loader = 0.21.2-beta.1 # Fabric & Quilt Libraries asm = 9.5 diff --git a/src/main/java/org/quiltmc/loader/api/LanguageAdapter.java b/src/main/java/org/quiltmc/loader/api/LanguageAdapter.java index 040e4bada..85228f11a 100644 --- a/src/main/java/org/quiltmc/loader/api/LanguageAdapter.java +++ b/src/main/java/org/quiltmc/loader/api/LanguageAdapter.java @@ -17,6 +17,8 @@ package org.quiltmc.loader.api; +import org.quiltmc.loader.impl.util.DefaultLanguageAdapter; + /** * Creates instances of objects from custom notations. * @@ -95,6 +97,15 @@ * */ public interface LanguageAdapter { + + /** Returns the default language adapter. Most mods will have no use for this method - instead it is intended for + * other {@link LanguageAdapter}s to fallback to the default behaviour. + * + * @return The default language adapter. */ + public static LanguageAdapter getDefault() { + return DefaultLanguageAdapter.INSTANCE; + } + /** * Creates an object of {@code type} from an arbitrary string declaration. * diff --git a/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java b/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java index 26e2bfa48..17ee21ec0 100644 --- a/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java +++ b/src/main/java/org/quiltmc/loader/impl/QuiltLoaderImpl.java @@ -129,7 +129,7 @@ public final class QuiltLoaderImpl { public static final int ASM_VERSION = Opcodes.ASM9; - public static final String VERSION = "0.21.1"; + public static final String VERSION = "0.21.2-beta.1"; public static final String MOD_ID = "quilt_loader"; public static final String DEFAULT_MODS_DIR = "mods"; public static final String DEFAULT_CACHE_DIR = ".cache"; diff --git a/src/main/resources/changelog/0.21.2.txt b/src/main/resources/changelog/0.21.2.txt new file mode 100644 index 000000000..668e6022e --- /dev/null +++ b/src/main/resources/changelog/0.21.2.txt @@ -0,0 +1,3 @@ +Features: + +- Added LanguageAdapter.getDefault(), to allow other LanguageAdapters to use it as their fallback.