Inventory Tweaks [1.12 only]

Inventory Tweaks [1.12 only]

127M Downloads

Inventory Tweaks in Eclipse as a library isn't working.

IMarvinTPA opened this issue ยท 7 comments

commented

Minecraft Version: 1.10.2
Inventory Tweaks Version: 1.61-58

In Eclipse,
Using InventoryTweaks-deobf-1.61-58.jar by going to Configure Build Path -> Libraries, Add External Jar.
When I try to run minecraft in Eclipse, I get:
Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderException: java.lang.IllegalAccessError: tried to access field net.minecraft.client.settings.KeyBinding.keyCode from class invtweaks.InvTweaksObfuscation
at net.minecraftforge.fml.common.LoadController.transition(LoadController.java:186)
at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:792)
at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:324)
...

What am I doing wrong to add Inventory Tweaks as a dependency to a new mod?
Thanks,
IMarv

commented

Is there no caused by for those? It should search for mods to load 'normally' even in debug settings.

Like I've said before, dealing with having multiple mods in a development setup is something I've never done though, so you're probably better off asking people who know how to do that.

commented

I also have a project that is just the "git clone https://github.com/Inventory-Tweaks/inventory-tweaks.git" command, followed by the normal gradlew deobfs .. and gradlew eclipse. It also gives me this error.

How do you start with a fresh project and get a running inventory tweaks?

Thanks,
IMarv

commented

Try gradlew runClient

commented

I did not know about that command, but:
[11:34:11] [Client thread/INFO]: Setting user: Player576
Exception in thread "Client thread" [11:34:15] [Client thread/ERROR] [LaunchWrapper]: Unable to launchlient
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_111]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_111]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_111]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_111]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

commented

You only really need the files in the API section to compile against. I believe you should be able to drop the deobf jar (or maybe the normal one) in the run/mods folder to test against it.

commented

I started with Forge 2099, empty (got it running). I added the JEI information to the Gradle build file, got that running. Added the Inventory Tweaks deobfs file (1.61-58) to the run/mods folder. I got the following error: (I don't have log files from before I added JEI, but I couldn't get Inventory Tweaks working before it either.)

net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: invtweaks/InvTweaks
at net.minecraftforge.fml.common.LoadController.transition(LoadController.java:186)
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:612)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:257)
...

And this is the start of the log for the normal jar file:
net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: invtweaks/InvTweaks
at net.minecraftforge.fml.common.LoadController.transition(LoadController.java:186)
at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:612)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:257)

Ideally, I don't want to need to update Inventory Tweaks and just have JEI or NEI use the IT API to add a new sort option using the tree.

However, an option to add a keyword that JEI can filter on in the tool tip of the items may be a worthy request to put in. (And have a tag for "NotInTheTree")

Thanks,
IMarv

commented

Someone emailed me directly with similar issues, here's how they eventually got things to work:

Already figured out.
For any other "java specialists" xD like me that will annoy you with similar questions, solution is:

  1. Copy "InventoryTweaks-api-.jar" and "InventoryTweaks-deobf-.jar" to the "..\src\main\java" folder.
  2. Put contents of "https://github.com/Inventory-Tweaks/inventory-tweaks/blob/develop/src/main/resources/invtweaks_at.cfg" to the "..\src\main\resources\invtweaks_at.cfg" file.
  3. Project -> Properties -> Java Build Path -> Libraries -> Add External JARs -> "InventoryTweaks-api-.jar" and "InventoryTweaks-deobf-.jar" -> Apply
  4. Exit Eclipse.
  5. gradlew.bat setupDevWorkspace
    gradlew.bat setupDecompWorkspace
    gradlew.bat eclipse
  6. Open Eclipse and do step 3 again.
  7. Yay. Use "import invtweaks.*" to access Inventory Tweaks classes from your mod.