Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'fabric-loom' version '1.9-SNAPSHOT'
id 'maven-publish'
id "org.jetbrains.kotlin.jvm" version "2.1.0"
}

version = project.mod_version
Expand Down Expand Up @@ -48,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 {
Expand All @@ -59,7 +62,7 @@ processResources {
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 17
it.options.release = 21
}

java {
Expand All @@ -68,8 +71,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 {
Expand Down
12 changes: 7 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ 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
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
cobblemon_curse_file_id=6021010

fabric_kotlin=1.13.0+kotlin.2.1.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -25,20 +24,16 @@ public static void register(CommandDispatcher<ServerCommandSource> dispatcher, C
}

private static int run(CommandContext<ServerCommandSource> 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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -21,15 +22,15 @@ public NbtCompound getPersistentData(){
}

@Inject(method = "loadFromNBT", at = @At("TAIL"))
protected void loadFromNbt(NbtCompound nbt, CallbackInfoReturnable<Pokemon> cir){
protected void loadFromNbt(DynamicRegistryManager drm, NbtCompound nbt, CallbackInfoReturnable<Pokemon> cir){
if(nbt.contains("explock")){
persistentData = nbt.getCompound("explock");
}
}


@Inject(method = "saveToNBT", at = @At("TAIL"))
protected void saveToNbt(NbtCompound nbt, CallbackInfoReturnable<NbtCompound> cir){
protected void saveToNbt(DynamicRegistryManager drm, NbtCompound nbt, CallbackInfoReturnable<NbtCompound> cir){
if(persistentData != null){
nbt.put("explock", persistentData);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/cobblemon-explock.mixins.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"required": true,
"package": "unsafedodo.cobblemonexplock.mixin",
"compatibilityLevel": "JAVA_17",
"compatibilityLevel": "JAVA_21",
"mixins": [
"ExpGainMixin",
"SaveNbtMixin"
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down