Merged jar, now for fabric (works on quilt as well), forge and neoforged

This commit is contained in:
coolGi
2023-12-24 21:16:10 +10:30
parent 10bbcc79d3
commit 5f16f81d58
7 changed files with 19 additions and 7 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ loom {
extraAccessWideners.add loom.accessWidenerPath.get().asFile.name
mixinConfigs = [
"DistantHorizons.mixins.json"
"DistantHorizons.forge.mixins.json"
]
}
@@ -1,5 +1,6 @@
package com.seibel.distanthorizons.forge.mixins;
import net.minecraft.client.ClientBrandRetriever;
import net.minecraftforge.fml.ModList;
import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
@@ -18,6 +19,9 @@ public class ForgeMixinPlugin implements IMixinConfigPlugin
@Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName)
{
if (!ClientBrandRetriever.getClientModName().equals("forge"))
return false;
if (mixinClassName.contains(".mods."))
{ // If the mixin wants to go into a mod then we check if that mod is loaded or not
return ModList.get().isLoaded(
+2 -1
View File
@@ -26,7 +26,8 @@ issueTrackerURL = "${issues}"
[[dependencies.distanthorizons]]
modId = "minecraft"
mandatory = true
mandatory = true # Forge syntax
type = "required" # Neoforged syntax
versionRange = "${compatible_forgemc_versions}" # Where we set what version of mc it is avalible for
ordering = "NONE"
side = "BOTH"
@@ -1,5 +1,6 @@
package com.seibel.distanthorizons.neoforged.mixins;
import net.minecraft.client.ClientBrandRetriever;
import net.neoforged.fml.ModList;
import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
@@ -12,12 +13,15 @@ import java.util.Set;
* @author coolGi
* @author cortex
*/
public class ForgeMixinPlugin implements IMixinConfigPlugin
public class NeoforgedMixinPlugin implements IMixinConfigPlugin
{
@Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName)
{
if (!ClientBrandRetriever.getClientModName().equals("neoforge"))
return false;
if (mixinClassName.contains(".mods."))
{ // If the mixin wants to go into a mod then we check if that mod is loaded or not
return ModList.get().isLoaded(
@@ -1,7 +1,7 @@
{
"required": true,
"minVersion": "0.8",
"package": "com.seibel.distanthorizons.forge.mixins",
"package": "com.seibel.distanthorizons.neoforged.mixins",
"mixins": [
"server.unsafe.MixinThreadingDetector",
"server.MixinUtilBackgroundThread",
@@ -20,5 +20,5 @@
"client.MixinTextureUtil"
],
"server": [],
"plugin": "com.seibel.distanthorizons.forge.mixins.ForgeMixinPlugin"
"plugin": "com.seibel.distanthorizons.neoforged.mixins.NeoforgedMixinPlugin"
}
@@ -23,12 +23,15 @@ issueTrackerURL = "${issues}"
#// Allow any version to be present (or not) on the server
acceptableRemoteVersions = "*"
# TODO: Once there is a way to move this to the `META-INF/MANIFEST.MF` with architectury, DO SO!
# (currently, this only works cus neoforge's mods.toml is added to the jar after forge's mods.toml, so this can work
[[mixins]]
config = "DistantHorizons.mixins.json"
config = "DistantHorizons.neoforged.mixins.json"
[[dependencies.distanthorizons]]
modId = "minecraft"
type = "required"
mandatory = true # Forge syntax
type = "required" # Neoforged syntax
versionRange = "${compatible_forgemc_versions}" # Where we set what version of mc it is avalible for
ordering = "NONE"
side = "BOTH"