made a better working multiloader build process

This commit is contained in:
2025-06-19 22:35:40 +02:00
parent b1b02afd46
commit 2effc8a6eb
59 changed files with 749 additions and 1367 deletions

View File

@@ -1,23 +1,18 @@
package com.vaporvee.loadsupport;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.FabricLoader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LoadSupport implements ModInitializer {
public static final String MOD_ID = "loadsupport";
@Override
public void onInitialize() {
// This method is invoked by the Fabric mod loader when it is ready
// to load your mod. You can access Fabric and Common code in this
// project.
public static final Logger logger = LoggerFactory.getLogger("Load Support");
@Override
public void onInitialize() {
if (FabricLoader.getInstance().getEnvironmentType() == EnvType.SERVER) {
logger.info(MOD_ID + " is a client mod only!");
return;
}
logger.info("Loading Load Support mod.");
}
}
// Use Fabric to bootstrap the Common mod.
Constants.LOG.info("Hello Fabric world!");
CommonClass.init();
}
}

View File

@@ -0,0 +1,20 @@
package com.vaporvee.loadsupport.mixin;
import com.vaporvee.loadsupport.Constants;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.TitleScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(TitleScreen.class)
public class MixinTitleScreen {
@Inject(at = @At("HEAD"), method = "init()V")
private void init(CallbackInfo info) {
Constants.LOG.info("This line is printed by an example mod mixin from Fabric!");
Constants.LOG.info("MC Version: {}", Minecraft.getInstance().getVersionType());
}
}

View File

@@ -0,0 +1,30 @@
package com.vaporvee.loadsupport.platform;
import com.vaporvee.loadsupport.platform.services.IPlatformHelper;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
public class FabricPlatformHelper implements IPlatformHelper {
@Override
public String getPlatformName() {
return "Fabric";
}
@Override
public boolean isModLoaded(String modId) {
return FabricLoader.getInstance().isModLoaded(modId);
}
@Override
public boolean isEnvServer() {
return FabricLoader.getInstance().getEnvironmentType() == EnvType.SERVER;
}
@Override
public boolean isDevelopmentEnvironment() {
return FabricLoader.getInstance().isDevelopmentEnvironment();
}
}

View File

@@ -0,0 +1 @@
com.vaporvee.loadsupport.platform.FabricPlatformHelper

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -1,42 +1,36 @@
{
"schemaVersion": 1,
"id": "loadsupport",
"version": "${version}",
"name": "Load Support",
"description": "Shows when the user has too less Java memory allocated, and plays a sound when the game has loaded.",
"authors": [
{
"name": "vaporvee",
"contact": {
"homepage": "https://vaporvee.com"
}
"schemaVersion": 1,
"id": "${mod_id}",
"version": "${version}",
"name": "${mod_name}",
"description": "${description}",
"authors": [
"${mod_author}"
],
"contact": {
"homepage": "https://fabricmc.net/",
"sources": "https://github.com/FabricMC/fabric-example-mod"
},
"license": "${license}",
"icon": "${mod_id}.png",
"environment": "*",
"entrypoints": {
"main": [
"com.vaporvee.loadsupport.LoadSupport"
]
},
"mixins": [
"${mod_id}.mixins.json",
"${mod_id}.fabric.mixins.json"
],
"depends": {
"fabricloader": ">=${fabric_loader_version}",
"fabric-api": "*",
"minecraft": "~${minecraft_version}",
"java": ">=${java_version}"
},
"suggests": {
"another-mod": "*"
}
],
"contact": {
"sources": "https://github.com/vaporvee/EnoughMemory",
"issues": "https://github.com/vaporvee/EnoughMemory/issues"
},
"custom": {
"modmenu": {
"links": {
"modmenu.discord": "https://discord.gg/StMHnsC9s2"
}
}
},
"license": "Apache License 2.0",
"icon": "assets/loadsupport/icon.png",
"environment": "*",
"entrypoints": {
"main": ["com.vaporvee.loadsupport.LoadSupport"],
"client": ["com.vaporvee.loadsupport.LoadSupportClient"]
},
"depends": {
"fabricloader": ">=0.16.5",
"minecraft": "~1.21.1",
"java": ">=21",
"fabric-api": "*"
},
"suggests": {
"another-mod": "*"
}
}

View File

@@ -0,0 +1,16 @@
{
"required": true,
"minVersion": "0.8",
"package": "com.vaporvee.loadsupport.mixin",
"refmap": "${mod_id}.refmap.json",
"compatibilityLevel": "JAVA_21",
"mixins": [],
"client": [
"MixinTitleScreen"
],
"server": [],
"injectors": {
"defaultRequire": 1
}
}

View File

@@ -1,8 +0,0 @@
{
"required": true,
"package": "com.vaporvee.loadsupport.mixin",
"compatibilityLevel": "JAVA_21",
"injectors": {
"defaultRequire": 1
}
}