stonecutter: fix 1.21.5 support

This commit is contained in:
Martin Prokoph
2025-11-06 22:45:14 +01:00
parent fa5119ab04
commit 625b820cf0

View File

@@ -46,7 +46,7 @@ public abstract class MidnightConfig {
public boolean shouldSkipField(FieldAttributes fieldAttributes) { return fieldAttributes.getAnnotation(Entry.class) == null; } public boolean shouldSkipField(FieldAttributes fieldAttributes) { return fieldAttributes.getAnnotation(Entry.class) == null; }
}) })
.registerTypeAdapter(ResourceLocation.class, .registerTypeAdapter(ResourceLocation.class,
//? if >= 1.21.6 { //? if >= 1.21.4 {
new TypeAdapter<ResourceLocation>() { new TypeAdapter<ResourceLocation>() {
public void write(JsonWriter out, ResourceLocation id) throws IOException { out.value(id.toString()); } public void write(JsonWriter out, ResourceLocation id) throws IOException { out.value(id.toString()); }
public ResourceLocation read(JsonReader in) throws IOException { return ResourceLocation.parse(in.nextString()); } public ResourceLocation read(JsonReader in) throws IOException { return ResourceLocation.parse(in.nextString()); }