Skip to content

Commit

Permalink
feat: Update for Forge 1.21.4
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed Jan 13, 2025
1 parent 54ad068 commit 05d69a1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
8 changes: 6 additions & 2 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ plugins {
}

mixin {
add(sourceSets.main, "${mod_id}.refmap.json")

config("${mod_id}.mixins.json")
config("${mod_id}.forge.mixins.json")
}
Expand Down Expand Up @@ -119,4 +117,10 @@ modrinth {
dependencies {
required.project "balm"
}
}

sourceSets.each {
def dir = layout.buildDirectory.dir("sourcesSets/$it.name")
it.output.resourcesDir = dir
it.java.destinationDirectory = dir
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
package net.blay09.mods.trashslot;

import net.blay09.mods.balm.api.Balm;
import net.blay09.mods.balm.api.EmptyLoadContext;
import net.blay09.mods.balm.api.client.BalmClient;
import net.blay09.mods.balm.forge.ForgeLoadContext;
import net.blay09.mods.trashslot.client.TrashSlotClient;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.loading.FMLEnvironment;

@Mod(TrashSlot.MOD_ID)
public class ForgeTrashSlot {

public ForgeTrashSlot() {
public ForgeTrashSlot(FMLJavaModLoadingContext context) {
final var loadContext = new ForgeLoadContext(context.getModEventBus());
PlatformBindings.INSTANCE = new PlatformBindings() {
@Override
public boolean supportsKeyModifiers() {
return true;
}
};

Balm.initialize(TrashSlot.MOD_ID, EmptyLoadContext.INSTANCE, TrashSlot::initialize);
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> BalmClient.initialize(TrashSlot.MOD_ID, EmptyLoadContext.INSTANCE, TrashSlotClient::initialize));
Balm.initialize(TrashSlot.MOD_ID, loadContext, TrashSlot::initialize);
if (FMLEnvironment.dist.isClient()) {
BalmClient.initialize(TrashSlot.MOD_ID, loadContext, TrashSlotClient::initialize);
}
}

}
1 change: 0 additions & 1 deletion forge/src/main/resources/trashslot.forge.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"minVersion": "0.8",
"package": "net.blay09.mods.trashslot.forge.mixin",
"compatibilityLevel": "JAVA_17",
"refmap": "${mod_id}.refmap.json",
"mixins": [
],
"client": [
Expand Down

0 comments on commit 05d69a1

Please sign in to comment.