From 36fda3c9312dd11a16c216e76e9d2871513b218b Mon Sep 17 00:00:00 2001 From: dra-goop Date: Sun, 5 Jan 2025 10:37:35 -0500 Subject: [PATCH 1/3] yeah so it doesnt actually work anymore, but it is updated to 1.21.1 and cobblemon 1.6 --- build.gradle | 8 ++++---- gradle.properties | 10 +++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- src/main/resources/cobblemon-explock.mixins.json | 2 +- src/main/resources/fabric.mod.json | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index 7b3fbf6..a107a90 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.3-SNAPSHOT' + id 'fabric-loom' version '1.9-SNAPSHOT' id 'maven-publish' } @@ -59,7 +59,7 @@ processResources { } tasks.withType(JavaCompile).configureEach { - it.options.release = 17 + it.options.release = 21 } java { @@ -68,8 +68,8 @@ java { // If you remove this line, sources will not be generated. withSourcesJar() - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } jar { diff --git a/gradle.properties b/gradle.properties index decbf2e..8bc544c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,9 +4,9 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.19.2 -yarn_mappings=1.19.2+build.28 -loader_version=0.14.21 +minecraft_version=1.21.1 +yarn_mappings=1.21.1+build.3 +loader_version=0.16.9 # Mod Properties mod_version=1.0.0 @@ -14,6 +14,6 @@ maven_group=unsafedodo.cobblemonexplock archives_base_name=cobblemon-explock # Dependencies -fabric_version=0.76.0+1.19.2 +fabric_version=0.114.0+1.21.1 -cobblemon_curse_file_id=4468330 \ No newline at end of file +cobblemon_curse_file_id=6021010 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9f4197d..e2847c8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/resources/cobblemon-explock.mixins.json b/src/main/resources/cobblemon-explock.mixins.json index 7b81e1e..13702be 100644 --- a/src/main/resources/cobblemon-explock.mixins.json +++ b/src/main/resources/cobblemon-explock.mixins.json @@ -1,7 +1,7 @@ { "required": true, "package": "unsafedodo.cobblemonexplock.mixin", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_21", "mixins": [ "ExpGainMixin", "SaveNbtMixin" diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 71d9de6..72ed50b 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -23,9 +23,9 @@ "cobblemon-explock.mixins.json" ], "depends": { - "fabricloader": ">=0.14.18", - "minecraft": "~1.19.2", - "java": ">=17", + "fabricloader": ">=0.16.9", + "minecraft": "~1.21.1", + "java": ">=21", "fabric-api": "*" }, "suggests": { From 22724ad384d8b7903e3ff0e18ed2107faa8cd17a Mon Sep 17 00:00:00 2001 From: dra-goop Date: Mon, 6 Jan 2025 02:28:05 -0500 Subject: [PATCH 2/3] Everything but Mixins are fixed --- build.gradle | 1 + .../command/ExpLockToggleCommand.java | 11 +++-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index a107a90..e141d56 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ plugins { id 'fabric-loom' version '1.9-SNAPSHOT' id 'maven-publish' + id "org.jetbrains.kotlin.jvm" version "2.1.0" } version = project.mod_version diff --git a/src/main/java/unsafedodo/cobblemonexplock/command/ExpLockToggleCommand.java b/src/main/java/unsafedodo/cobblemonexplock/command/ExpLockToggleCommand.java index 98a977c..8f01e0d 100644 --- a/src/main/java/unsafedodo/cobblemonexplock/command/ExpLockToggleCommand.java +++ b/src/main/java/unsafedodo/cobblemonexplock/command/ExpLockToggleCommand.java @@ -1,7 +1,6 @@ package unsafedodo.cobblemonexplock.command; import com.cobblemon.mod.common.Cobblemon; -import com.cobblemon.mod.common.api.storage.NoPokemonStoreException; import com.cobblemon.mod.common.api.storage.party.PlayerPartyStore; import com.cobblemon.mod.common.pokemon.Pokemon; import com.mojang.brigadier.CommandDispatcher; @@ -25,20 +24,16 @@ public static void register(CommandDispatcher dispatcher, C } private static int run(CommandContext context) { - try{ - PlayerPartyStore partyStore = Cobblemon.INSTANCE.getStorage().getParty(context.getSource().getPlayer().getUuid()); + PlayerPartyStore partyStore = Cobblemon.INSTANCE.getStorage().getParty(context.getSource().getPlayer()); int slot = (IntegerArgumentType.getInteger(context, "slotNumber")-1); Pokemon pokemon = partyStore.get(slot); if(pokemon != null){ boolean state = ExpData.setExpState((IPokemonDataSaver) pokemon); - context.getSource().sendFeedback(Text.literal("Exp gain state for "+pokemon.getDisplayName().getString()+" changed to "+state).formatted(Formatting.GREEN), false); + context.getSource().sendFeedback(() -> Text.literal("Exp gain state for "+pokemon.getDisplayName().getString()+" changed to "+state).formatted(Formatting.GREEN), false); } else { - context.getSource().sendFeedback(Text.literal("Invalid slot").formatted(Formatting.RED), false); + context.getSource().sendFeedback(() -> Text.literal("Invalid slot").formatted(Formatting.RED), false); return -1; } - } catch (NoPokemonStoreException e){ - e.printStackTrace(); - } return 0; } From 19aebc752cf195b3334ef3e35e193bd64cbdfdc7 Mon Sep 17 00:00:00 2001 From: dra-goop Date: Mon, 6 Jan 2025 04:03:28 -0500 Subject: [PATCH 3/3] Works now --- build.gradle | 2 ++ gradle.properties | 4 +++- .../java/unsafedodo/cobblemonexplock/mixin/SaveNbtMixin.java | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index e141d56..d7555cb 100644 --- a/build.gradle +++ b/build.gradle @@ -49,6 +49,8 @@ dependencies { include(modImplementation('me.lucko:fabric-permissions-api:0.2-SNAPSHOT')) modImplementation("curse.maven:cobblemon-687131:${property("cobblemon_curse_file_id")}") + + modImplementation("net.fabricmc:fabric-language-kotlin:${property("fabric_kotlin")}") } processResources { diff --git a/gradle.properties b/gradle.properties index 8bc544c..775a140 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,4 +16,6 @@ archives_base_name=cobblemon-explock # Dependencies fabric_version=0.114.0+1.21.1 -cobblemon_curse_file_id=6021010 \ No newline at end of file +cobblemon_curse_file_id=6021010 + +fabric_kotlin=1.13.0+kotlin.2.1.0 \ No newline at end of file diff --git a/src/main/java/unsafedodo/cobblemonexplock/mixin/SaveNbtMixin.java b/src/main/java/unsafedodo/cobblemonexplock/mixin/SaveNbtMixin.java index edc598b..c2f8424 100644 --- a/src/main/java/unsafedodo/cobblemonexplock/mixin/SaveNbtMixin.java +++ b/src/main/java/unsafedodo/cobblemonexplock/mixin/SaveNbtMixin.java @@ -2,6 +2,7 @@ import com.cobblemon.mod.common.pokemon.Pokemon; import net.minecraft.nbt.NbtCompound; +import net.minecraft.registry.DynamicRegistryManager; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -21,7 +22,7 @@ public NbtCompound getPersistentData(){ } @Inject(method = "loadFromNBT", at = @At("TAIL")) - protected void loadFromNbt(NbtCompound nbt, CallbackInfoReturnable cir){ + protected void loadFromNbt(DynamicRegistryManager drm, NbtCompound nbt, CallbackInfoReturnable cir){ if(nbt.contains("explock")){ persistentData = nbt.getCompound("explock"); } @@ -29,7 +30,7 @@ protected void loadFromNbt(NbtCompound nbt, CallbackInfoReturnable cir) @Inject(method = "saveToNBT", at = @At("TAIL")) - protected void saveToNbt(NbtCompound nbt, CallbackInfoReturnable cir){ + protected void saveToNbt(DynamicRegistryManager drm, NbtCompound nbt, CallbackInfoReturnable cir){ if(persistentData != null){ nbt.put("explock", persistentData); }