-
Posts
67 -
Joined
-
Last visited
Everything posted by fernthedev
-
So basically I am attempting to make a mod that will allow you to use controllers for Minecraft (following the console version of Minecraft control's scheme) I have this code, not tested yet, which you might aswell take a look at my current work and see if anything here is wrong (such as yaw needing the numbers in reversed etc.) I can also make a github repo if that is easier to read than just code in plain text. I am currently missing the following which I had no luck finding how to do online: (I added comments for most of my methods showing what they do in Minecraft code just incase I should change something) Left click Right click Jump Esc key button (Optionally) Add a pointer that can be moved with the joysticks for buttons and allow using a button like X to {pick up/place item} in slots or click buttons in menus private ControllerButtons oldButtons; int scrollTime; int dropTime; public void update(IControlPlayer player) { if(oldButtons == null) { oldButtons = controller.getButtons(); } if(!handler.isGuiOpen()) { //Equivalent to (Minecraft.getMinecraft().thePlayer.moveForward = controller.getAxes().getVERTICAL_LEFT_STICKER().getValue();) player.moveForward(controller.getAxes().getVERTICAL_LEFT_STICKER().getValue()); // -1 is down, 1 is up, 0 is stateless //Equivalent to (Minecraft.getMinecraft().thePlayer.moveStrafing = controller.getAxes().getHORIZONTAL_LEFT_STICKER().getValue();) player.moveStrafing(controller.getAxes().getHORIZONTAL_LEFT_STICKER().getValue()); // -1 IS DOWN, 1 IS UP, 0 IS STATELESS //Equivalent to (Minecraft.getMinecraft().thePlayer.rotationPitch += controller.getAxes().getVERTICAL_RIGHT_STICKER().getValue();) player.addRotationYaw(controller.getAxes().getHORIZONTAL_RIGHT_STICKER().getValue()); // -1 IS DOWN, 1 IS UP, 0 IS STATELESS //Equivalent to (Minecraft.getMinecraft().thePlayer.rotationYaw += controller.getAxes().getHORIZONTAL_RIGHT_STICKER().getValue();) player.addRotationPitch(controller.getAxes().getVERTICAL_RIGHT_STICKER().getValue()); // -1 is down, 1 is up, 0 is stateless } if(controller.getAxes().getLEFT_TRIGGER().getValue() > 0.5) { // RIGHT CLICK EQUIVALENT } if(controller.getAxes().getRIGHT_TRIGGER().getValue() > 0.5) { //LEFT CLICK EQUIVALENT } if(checkToggle(controller.getButtons().getA(),oldButtons.getA())) { // JUMP EQUIVALENT } //Closes GUI if(checkToggle(controller.getButtons().getB(),oldButtons.getB())) { if(handler.isGuiOpen()) { //Equivalent to (Minecraft.getMinecraft().displayGuiScreen(null);) handler.closeGUI(); } } ////////////////////////////////////////////// // Drops item if((dropTime == 0 || dropTime > 30) && !handler.isGuiOpen()) { boolean increaseTime = false; if (dropTime == 0 && !controller.getButtons().getB().isState() && oldButtons.getB().isState()) { player.dropItem(); increaseTime = true; } if (dropTime > 30 && controller.getButtons().getB().isState()) { player.dropStack(); increaseTime = true; } if (increaseTime) { dropTime++; } else { dropTime = 0; } } ////////////////////////////////////////////// if(checkToggle(controller.getButtons().getSTART_BUTTON(),oldButtons.getSTART_BUTTON())) { //Would execute what Escape does } if(checkToggle(controller.getButtons().getY(),oldButtons.getY())) { boolean opened = Minecraft.getMinecraft().currentScreen instanceof GuiInventory; if(opened) { //Equivalent to (Minecraft.getMinecraft().displayGuiScreen(null);) handler.closeGUI(); }else{ //Equivalent to (Minecraft.getMinecraft().displayGuiScreen(new GuiInventory(Minecraft.getMinecraft().thePlayer));) player.openInventory(); } } //Basically does what TAB would do if(checkToggle(controller.getButtons().getEXTRA_BUTTON(),oldButtons.getEXTRA_BUTTON())) { handler.renderPlayerList(true); }else{ handler.renderPlayerList(false); } if(checkToggle(controller.getButtons().getLEFT_STICKER(),oldButtons.getLEFT_STICKER())) { //Basically player.setSneaking(!player.isSneaking()); player.toggleSneak(); } //Basically does (Minecraft.getMinecraft().displayGuiScreen(new GuiChat());) if(checkToggle(controller.getButtons().getDPAD_UP(),oldButtons.getDPAD_UP())) { handler.displayChat(); } if(checkToggle(controller.getButtons().getRIGHT_STICKER(),oldButtons.getRIGHT_STICKER())) { //Basically Minecraft.getInstance().gameSettings.thirdPersonView++; handler.toggle3rdPerson(); } //////////////////////////////// //Scrolls between the hotbar if(controller.getButtons().getBUMPER_RIGHT().isState() && (scrollTime == 0 || scrollTime > 30)) { player.scrollSlot(-1); scrollTime++; }else{ scrollTime = 0; } if(controller.getButtons().getBUMPER_LEFT().isState() && (scrollTime == 0 || scrollTime > 30)) { player.scrollSlot(1); }else{ scrollTime = 0; } //////////////////////////////// oldButtons = controller.getButtons(); } private boolean checkToggle(ControllerButtonState newButton, ControllerButtonState oldState) { return newButton.isState() != oldState.isState(); }
-
So I keep running into issues with my project setup, causing gradle to make method not found issues etc. even when I downgrade to the one that used to work before. Magically these errors appeared and so switching to ForgeGradle version 3 fixed them, but I can't seem to add 1.8.9 to my dependencies. How do you add 1.8.9? My project can be found at https://github.com/Fernthedev/FernAPI though be noted that the build.gradle file with the actual forge dependency and code is found here https://github.com/Fernthedev/FernAPI/tree/master/fernapi-common It's a sub project because I used to have 3 different modules for spigot bungee and forge and decided to merge them all together
-
FatJar including Minecraft libraries 1.7.10
fernthedev replied to fernthedev's topic in Modder Support
Ok then. I guessed I was gonna have the reply that it wasn't supported anyways. I just wanted to see if there was any chance of fixing it. Thanks -
FatJar including Minecraft libraries 1.7.10
fernthedev replied to fernthedev's topic in Modder Support
So basically I just give up on the project on 1.7.10 and move on? No solutions at all?? -
So a few weeks/months ago I made a forum post asking for help with making fatJars. The help I received was fast. But then I decided to make my mod work below 1.12.2 and 1.8, to 1.7.10 for me and my friend with our love of mod packs. I did accomplish doing all of I've done before. Except, the file size was 66 MB when 1.8 and 1.12.2 were not close to being any bigger than 3 MB. The problem, the fat jar included ALL of the Minecraft libraries. The first one I noticed was the twitch.tv package in my jar. I haven't added anything to my build.gradle file to add all the library packages. This issue is very odd and I haven't found any other posts regarding it. Anything I can do to shrink the file size? buildscript { repositories { mavenCentral() jcenter() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath "net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT" classpath "com.github.jengelman.gradle.plugins:shadow:1.2.4" } } /*plugins { // id 'com.github.johnrengelman.shadow' version "1.2.4" id "com.github.johnrengelman.shadow" version "1.2.4" }*/ apply plugin: 'com.github.johnrengelman.shadow' apply plugin: "forge" configurations { shade compile.extendsFrom shade } reobf.reobf(shadowJar) { spec -> spec.classpath = sourceSets.main.compileClasspath; } shadowJar { relocate 'org.apache', 'shadow.org.apache' exclude 'GradleStart**' exclude '.cache' exclude 'tv.twitch:twitch' } //build.dependsOn(shadowJar) version = "1.3.2" group = "com.github.fernthedev" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "DiscordMod1.7.10" minecraft { version = "1.7.10-10.13.4.1558-1.7.10" runDir = "run" } sourceCompatibility = targetCompatibility = '1.6' // Need this here so eclipse task generates correctly. compileJava { sourceCompatibility = targetCompatibility = '1.6' } dependencies { // you may put jars on which you depend on in ./libs // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env compile 'org.json:json:20171018' compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.7' // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } }
-
Actually forget eveyrthing I just said I fixed it all finally.Thank you
-
Actually nevermind, I fixed that last issue with relocating. However, this issue is very odd. ---- Minecraft Crash Report ---- WARNING: coremods are present: Contact their authors BEFORE contacting forge // I let you down. Sorry :( Time: 5/22/18 2:15 PM Description: There was a severe problem during mod loading that has caused the game to fail net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Discord (discordmod) Caused by: java.lang.NoSuchMethodError: net.minecraft.client.Minecraft.getMinecraft()Lnet/minecraft/client/Minecraft; at com.github.fernthedev.DiscordMod.init(DiscordMod.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:627) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:218) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:196) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:744) at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:329) at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:534) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:377) at net.minecraft.client.main.Main.main(SourceFile:123) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) https://www.dropbox.com/s/qsfsdzoa7ent06v/DiscordMod-1.0-all.jar?dl=0
-
Actually now I'm receiving this error. I added logger to gradle but still. Caused by: java.lang.NoClassDefFoundError: shadow/org/apache/logging/log4j/Logger Jar with the relocated package https://www.dropbox.com/s/qsfsdzoa7ent06v/DiscordMod-1.0-all.jar?dl=0
-
Thanks I didn't know shadow could do this Really helpful.
-
I've been using that and org.apache.lang.systemutils is included inside it but Minecraft keeps showing the error it's not showing I've also tried other methods of fat jar-ing it and it still causes the exact error. This is being thrown because the library I'm using for the discord API is using that class (I compiled the app myself and it does indeed have the maven shading plugin in the pom.xml and is included) Extract the jar and see for yourself what I'm dealing with. https://www.dropbox.com/s/qsfsdzoa7ent06v/DiscordMod-1.0-all.jar?dl=0
-
I’m pretty new to using gradle (I used maven and did plugin development back then) and never had to shade So what I understand from this is I have to download the library and add it locally with a different name?
-
So you're suggesting I add my project as github repository, adding which "repository" as a git submodule? Also I have given them credit in the mcmod.info file [ { "modid": "discordmod", "name": "Discord", "description": "Enables Rich Presence For your profile.", "version": "1.0", "mcversion": "${mcversion}", "url": "", "updateUrl": "", "authorList": ["Fernthedev"], "credits": "jagrosh for discord api. https://github.com/jagrosh/DiscordIPC", "logoFile": "", "screenshots": [], "dependencies": [] } ] Edit: this error keeps appearing no matter what way I fatjar/shade it, and I opened it with winrar and it does exist inside it Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang/SystemUtils
-
So basically I can run the mod just fine when I run the "runClient" task and everything works great. However, when I compile it with shadowJar it has all the libraries, yet when Minecraft loads it, it says it can't be found. Here's the log ---- Minecraft Crash Report ---- WARNING: coremods are present: Contact their authors BEFORE contacting forge // Quite honestly, I wouldn't worry myself about that. Time: 5/21/18 3:54 PM Description: There was a severe problem during mod loading that has caused the game to fail net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Discord (discordmod) Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang/SystemUtils at net.arikia.dev.drpc.DiscordRPC.loadDLL(DiscordRPC.java:128) at net.arikia.dev.drpc.DiscordRPC.<clinit>(DiscordRPC.java:21) at com.github.fernthedev.DiscordMod.init(DiscordMod.java:45) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:600) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:278) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:256) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:148) at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:720) at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:352) at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:534) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:377) at net.minecraft.client.main.Main.main(SourceFile:123) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.SystemUtils at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:106) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 44 more I have one library for discord rich presence found here (https://github.com/Vatuu/discord-rpc) My build.gradle buildscript { repositories { jcenter() maven { url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' } } plugins { id "com.github.johnrengelman.shadow" version "1.2.4" } apply plugin: 'net.minecraftforge.gradle.forge' //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. version = "1.0" group = "com.github.fernthedev" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "DiscordMod" sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. compileJava { sourceCompatibility = targetCompatibility = '1.8' } configurations { shade compile.extendsFrom shade } shadowJar { baseName = project.name //+ '-all' } jar { configurations.shade.each { dep -> from(project.zipTree(dep)) { exclude 'META-INF', 'META-INF/**' } } } minecraft { version = "1.12.2-14.23.3.2702" runDir = "run" // the mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD snapshot are built nightly. // stable_# stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // simply re-run your setup task after changing the mappings to update your workspace. mappings = "snapshot_20171003" // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. // srgExtra "PK: org/ejml your/new/package/here/ejml" // srgExtra "PK: org/ejml/alg your/new/package/here/ejml/alg" } //create a single Jar with all dependencies task fatJar(type: Jar) { manifest { attributes 'Implementation-Title': 'discordmod', 'Implementation-Version': version, 'Main-Class': 'com.github.fernthedev.DiscordMod' } baseName = project.name + '-all' from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } with jar } repositories { maven { name = 'Tethys (drakon.io)' url = "http://tethys.drakon.io/maven" } } dependencies { // you may put jars on which you depend on in ./libs // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" //compile 'com.jagrosh:DiscordIPC:LATEST' compile 'org.json:json:20171018' compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.7' compile 'io.drakon:pulsar:1.2.1' // shade fileTree(dir: 'libs', include: '*.jar') // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else except the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } and my main class package com.github.fernthedev; import net.arikia.dev.drpc.DiscordEventHandlers; import net.arikia.dev.drpc.DiscordRPC; import net.minecraft.client.Minecraft; import net.minecraft.util.IThreadListener; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLModDisabledEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import org.apache.logging.log4j.Logger; @Mod(modid = DiscordMod.MODID, name = DiscordMod.NAME, version = DiscordMod.VERSION) public class DiscordMod { public static final String MODID = "discordmod"; public static final String NAME = "Discord"; public static final String VERSION = "1.0"; private static Logger logger; private RPC rpc; public static String client; private static DiscordMod instance; //private static IPCClient client; @EventHandler public void preInit(FMLPreInitializationEvent event) { logger = event.getModLog(); } @EventHandler public void init(FMLInitializationEvent event) { DiscordEventHandlers handler = new DiscordEventHandlers(); instance = this; rpc = new RPC(); new RPCEvents(rpc); handler.ready = new ReadyEvent(); client = "448100612987551744L"; DiscordRPC.discordInitialize(client, handler,true); IThreadListener mainThread = Minecraft.getMinecraft(); mainThread.addScheduledTask(DiscordRPC::discordRunCallbacks); } @EventHandler public void loaded(FMLPostInitializationEvent e) { rpc.menu(client); MinecraftForge.EVENT_BUS.register(new RPCEvents(rpc)); } @EventHandler public void shutdown(FMLModDisabledEvent e) { DiscordRPC.discordShutdown(); } public static DiscordMod getInstance() { return instance; } public Logger logger() { return logger; } } I've tried using many ways of shading or making fat jars but they all keep saying the exact same error.