mirror of
https://github.com/ViaVersion/ViaForge.git
synced 2024-11-21 11:55:13 +01:00
fix some incompatibility issues and a crash by using standardized FML loading
This commit is contained in:
parent
eb818ea399
commit
f396ff00bc
@ -88,8 +88,10 @@ jar {
|
||||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd"-"HH:mm:ssZ"),
|
||||
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
|
||||
"TweakOrder": "0",
|
||||
"FMLCorePluginContainsFMLMod": "de.enzaxd.viaforge.injection.MixinLoader",
|
||||
"MixinConfigs": "mixins.${mod_id}.json"
|
||||
"FMLCorePluginContainsFMLMod": "true",
|
||||
"FMLCorePlugin": "de.enzaxd.viaforge.injection.MixinLoader",
|
||||
"MixinConfigs": "mixins.${mod_id}.json",
|
||||
"ForceLoadAsMod": "true"
|
||||
)
|
||||
enabled = false
|
||||
}
|
||||
|
0
gradlew.bat
vendored
Normal file → Executable file
0
gradlew.bat
vendored
Normal file → Executable file
@ -20,11 +20,16 @@ import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
@Mod(modid = "viaforge", name = "ViaForge", version = "1.0.0")
|
||||
public class ViaForge {
|
||||
|
||||
public final static int SHARED_VERSION = 340;
|
||||
|
||||
private static final ViaForge instance = new ViaForge();
|
||||
private static ViaForge instance = null;
|
||||
{ instance = this; } // called when forge initializes the mod
|
||||
private final Logger jLogger = new JLoggerToLog4j(LogManager.getLogger("ViaForge"));
|
||||
private final CompletableFuture<Void> initFuture = new CompletableFuture<>();
|
||||
private ExecutorService asyncExecutor;
|
||||
@ -37,7 +42,8 @@ public class ViaForge {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void start() {
|
||||
@Mod.EventHandler
|
||||
public void init(FMLPreInitializationEvent event) {
|
||||
ThreadFactory factory = new ThreadFactoryBuilder().setDaemon(true).setNameFormat("ViaForge-%d").build();
|
||||
asyncExecutor = Executors.newFixedThreadPool(8, factory);
|
||||
|
||||
|
@ -1,22 +0,0 @@
|
||||
package de.enzaxd.viaforge.injection.mixins;
|
||||
|
||||
import de.enzaxd.viaforge.ViaForge;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.main.GameConfiguration;
|
||||
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(Minecraft.class)
|
||||
public abstract class MixinMinecraft {
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
public void injectConstructor(GameConfiguration p_i45547_1_, CallbackInfo ci) {
|
||||
try {
|
||||
ViaForge.getInstance().start();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -62,6 +62,6 @@ public enum ProtocolCollection {
|
||||
for (ProtocolCollection coll : values())
|
||||
if (coll.getVersion().getVersion() == id)
|
||||
return coll.getVersion();
|
||||
return null;
|
||||
return R1_12_2.getVersion();
|
||||
}
|
||||
}
|
||||
|
16
src/main/resources/mcmod.info
Normal file
16
src/main/resources/mcmod.info
Normal file
@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"modid": "viaforge",
|
||||
"name": "ViaForge",
|
||||
"description": "",
|
||||
"version": "1.0.0",
|
||||
"mcversion": "1.12.2",
|
||||
"url": "https://github.com/FlorianMichael/ViaForge",
|
||||
"updateUrl": "",
|
||||
"authorList": [],
|
||||
"credits": "",
|
||||
"logoFile": "",
|
||||
"screenshots": [],
|
||||
"dependencies": []
|
||||
}
|
||||
]
|
@ -11,7 +11,6 @@
|
||||
"MixinGuiMultiplayer",
|
||||
"MixinGuiScreenAddServer",
|
||||
"MixinGuiScreenServerList",
|
||||
"MixinMinecraft",
|
||||
"MixinNetworkManagerChInit"
|
||||
],
|
||||
"verbose": true
|
||||
|
6
src/main/resources/pack.mcmeta
Normal file
6
src/main/resources/pack.mcmeta
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"pack": {
|
||||
"description": "ViaForge",
|
||||
"pack_format": 3
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user