From d3cb6442d984cf6c102a939bcbbb6effe1007ace Mon Sep 17 00:00:00 2001 From: Luke Bemish Date: Mon, 17 Jun 2024 00:11:38 -0500 Subject: [PATCH] Begin update to 1.21 --- .../transform/registroid/RecipeTypeAddon.groovy | 2 +- .../transform/registroid/SoundEventAddon.groovy | 4 ++-- .../registroid/RecipeTypeAddonTransformer.groovy | 4 ++-- .../registroid/SoundEventAddonTransformer.groovy | 8 ++++---- .../ScriptResourceListenerFabric.groovy | 4 +++- gradle/libs.versions.toml | 16 ++++++++-------- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/common/src/transform/groovy/org/groovymc/cgl/api/transform/registroid/RecipeTypeAddon.groovy b/common/src/transform/groovy/org/groovymc/cgl/api/transform/registroid/RecipeTypeAddon.groovy index 217167b..026f351 100644 --- a/common/src/transform/groovy/org/groovymc/cgl/api/transform/registroid/RecipeTypeAddon.groovy +++ b/common/src/transform/groovy/org/groovymc/cgl/api/transform/registroid/RecipeTypeAddon.groovy @@ -16,7 +16,7 @@ import java.lang.annotation.* * * Example out: *
- * {@code static final RecipeType HELLO_WORLD = RecipeType.simple(new ResourceLocation(yourModId, 'hello_world'))}
+ * {@code static final RecipeType HELLO_WORLD = RecipeType.simple(ResourceLocation.fromNamespaceAndPath(yourModId, 'hello_world'))}
  * 
*/ @Documented diff --git a/common/src/transform/groovy/org/groovymc/cgl/api/transform/registroid/SoundEventAddon.groovy b/common/src/transform/groovy/org/groovymc/cgl/api/transform/registroid/SoundEventAddon.groovy index cb66221..fb02345 100644 --- a/common/src/transform/groovy/org/groovymc/cgl/api/transform/registroid/SoundEventAddon.groovy +++ b/common/src/transform/groovy/org/groovymc/cgl/api/transform/registroid/SoundEventAddon.groovy @@ -16,8 +16,8 @@ import java.lang.annotation.* * * Example out: *
- * {@code static final SoundEvent HELLO_WORLD = new SoundEvent(new ResourceLocation(yourModId, 'hello_world'))}
- * {@code static final SoundEvent HELLO_THERE = new SoundEvent(new ResourceLocation(yourModId, 'hello_there'), 0.12f)}
+ * {@code static final SoundEvent HELLO_WORLD = new SoundEvent(ResourceLocation.fromNamespaceAndPath(yourModId, 'hello_world'))}
+ * {@code static final SoundEvent HELLO_THERE = new SoundEvent(ResourceLocation.fromNamespaceAndPath(yourModId, 'hello_there'), 0.12f)}
  * 
*/ @Documented diff --git a/common/src/transform/groovy/org/groovymc/cgl/impl/transform/registroid/RecipeTypeAddonTransformer.groovy b/common/src/transform/groovy/org/groovymc/cgl/impl/transform/registroid/RecipeTypeAddonTransformer.groovy index b59fd2c..4701f1d 100644 --- a/common/src/transform/groovy/org/groovymc/cgl/impl/transform/registroid/RecipeTypeAddonTransformer.groovy +++ b/common/src/transform/groovy/org/groovymc/cgl/impl/transform/registroid/RecipeTypeAddonTransformer.groovy @@ -20,8 +20,8 @@ class RecipeTypeAddonTransformer implements RegistroidAddon { @Override void process(AnnotationNode registroidAnnotation, ClassNode targetClass, PropertyNode property, RegistroidASTTransformer transformer, Supplier modId) { property.field.setInitialValueExpression( - GeneralUtils.callX(RECIPE_TYPE_TYPE, 'simple', GeneralUtils.ctorX( - RL_TYPE, GeneralUtils.args( + GeneralUtils.callX(RECIPE_TYPE_TYPE, 'simple', GeneralUtils.callX( + RL_TYPE, "fromNamespaceAndPath", GeneralUtils.args( GeneralUtils.constX(modId.get()), GeneralUtils.constX(transformer.getRegName(property)) ) )) diff --git a/common/src/transform/groovy/org/groovymc/cgl/impl/transform/registroid/SoundEventAddonTransformer.groovy b/common/src/transform/groovy/org/groovymc/cgl/impl/transform/registroid/SoundEventAddonTransformer.groovy index b525fb7..566126d 100644 --- a/common/src/transform/groovy/org/groovymc/cgl/impl/transform/registroid/SoundEventAddonTransformer.groovy +++ b/common/src/transform/groovy/org/groovymc/cgl/impl/transform/registroid/SoundEventAddonTransformer.groovy @@ -25,8 +25,8 @@ class SoundEventAddonTransformer implements RegistroidAddon { void process(AnnotationNode registroidAnnotation, ClassNode targetClass, PropertyNode property, RegistroidASTTransformer transformer, Supplier modId) { if (property.field.initialValueExpression === null) { property.field.setInitialValueExpression( - GeneralUtils.callX(SOUND_EVENT_TYPE, 'createVariableRangeEvent', GeneralUtils.ctorX( - RL_TYPE, GeneralUtils.args( + GeneralUtils.callX(SOUND_EVENT_TYPE, 'createVariableRangeEvent', GeneralUtils.callX( + RL_TYPE, "fromNamespaceAndPath", GeneralUtils.args( GeneralUtils.constX(modId.get()), GeneralUtils.constX(transformer.getRegName(property)) ))) ) @@ -36,8 +36,8 @@ class SoundEventAddonTransformer implements RegistroidAddon { if (args instanceof ArgumentListExpression && args.size() >= 1) { final arg0 = args[0] if (arg0 instanceof ConstantExpression && arg0.value === null) { - args.expressions.set(0, GeneralUtils.ctorX( - RL_TYPE, GeneralUtils.args( + args.expressions.set(0, GeneralUtils.callX( + RL_TYPE, "fromNamespaceAndPath", GeneralUtils.args( GeneralUtils.constX(modId.get()), GeneralUtils.constX(transformer.getRegName(property)) ) )) diff --git a/fabric/src/main/groovy/org/groovymc/cgl/impl/fabric/resources/ScriptResourceListenerFabric.groovy b/fabric/src/main/groovy/org/groovymc/cgl/impl/fabric/resources/ScriptResourceListenerFabric.groovy index f5b1a6f..6976353 100644 --- a/fabric/src/main/groovy/org/groovymc/cgl/impl/fabric/resources/ScriptResourceListenerFabric.groovy +++ b/fabric/src/main/groovy/org/groovymc/cgl/impl/fabric/resources/ScriptResourceListenerFabric.groovy @@ -1,11 +1,13 @@ package org.groovymc.cgl.impl.fabric.resources +import groovy.transform.CompileStatic import net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener import net.minecraft.resources.ResourceLocation import org.groovymc.cgl.impl.resources.ScriptResourceListener +@CompileStatic class ScriptResourceListenerFabric extends ScriptResourceListener implements IdentifiableResourceReloadListener { - public static final ResourceLocation FABRIC_ID = new ResourceLocation('cgl', 'load_scripts') + public static final ResourceLocation FABRIC_ID = ResourceLocation.fromNamespaceAndPath('cgl', 'load_scripts') @Override ResourceLocation getFabricId() { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f383f8c..811731d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,14 +1,14 @@ [versions] -minecraft = "1.20.6" +minecraft = "1.21" parchment_minecraft = "1.20.6" parchment_mappings = "2024.05.01" -neoforge = "20.6.76-beta" +neoforge = "21.0.14-beta" -fabric_loader = "0.15.10" -fabric_api = "0.100.0+1.20.6" +fabric_loader = "0.15.11" +fabric_api = "0.100.1+1.21" -mdg = "2.0.0-beta.27" +mdg = "2.0.0-beta.28" autoservice = "1.1.1" nexuspublish = "2.0.0" idea_ext = "1.1.8" @@ -18,12 +18,12 @@ architectury_loom = "1.6.397" jetbrains_annotations = "24.1.0" managedversioning = "1.2.19" -registrationutils = "1.20.6-0.1.0" +registrationutils = "1.21.0-0.1.0" enhancedgroovy = "0.2.0" -groovybundler = "2.1.4" +groovybundler = "2.1.5" groovyduvet = "3.1.6" -gml = "6.0.1" +gml = "7.0.0" jankson = "1.2.3" nightconfig = "3.6.7"