TeamGalacticraft / Galacticraft-Legacy

An advanced Space Dimension Mod for Minecraft
MIT License
75 stars 33 forks source link

[Bug]: 4.0.5 -> 4.0.6 broke IC2 Classic EU compatibility #209

Open xJon opened 3 months ago

xJon commented 3 months ago

Forge Version

14.23.5.2860

Galacticraft Version

4.0.6

Log or Crash Report

When using version 4.0.6 alongside IC2 Classic, this error is in the log:

Unhide ``` [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: java.lang.NoSuchFieldException: tickHandler [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at java.lang.Class.getDeclaredField(Unknown Source) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at micdoodle8.mods.galacticraft.core.util.CompatibilityManager.checkForCompatibleMods(CompatibilityManager.java:127) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at micdoodle8.mods.galacticraft.core.GalacticraftCore.postInit(GalacticraftCore.java:538) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at java.lang.reflect.Method.invoke(Unknown Source) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:637) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at java.lang.reflect.Method.invoke(Unknown Source) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at com.google.common.eventbus.EventBus.post(EventBus.java:217) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at java.lang.reflect.Method.invoke(Unknown Source) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at com.google.common.eventbus.EventBus.post(EventBus.java:217) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:754) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:336) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:535) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at net.minecraft.client.main.Main.main(SourceFile:123) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at java.lang.reflect.Method.invoke(Unknown Source) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [Client thread/INFO]: [micdoodle8.mods.galacticraft.core.util.CompatibilityManager:checkForCompatibleMods:170]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28) ```

Reproduction steps

First reported over https://github.com/xJon/Tekkit-2/issues/258.

  1. Use Galacticraft 4.0.6, alongside any of IC2 Classic's versions from the past couple of years
  2. Try to flow IC2 Classic EU through Galacticraft Sealable blocks (i.e. Sealable Glass Fiber Cable)
  3. Energy won't flow

I believe this commit broke it.

xJon commented 3 months ago

@Speiger do you have any ideas about what's happening?

Speiger commented 3 months ago

@xJon GalacticCraft searches for IC2 Core classes. The whole ITickHandler implementation they try to use only exists in IC2Exp. here is the code: https://github.com/TeamGalacticraft/Galacticraft-Legacy/blob/acec4429525eb30452298c2034d1e5d5d4b41046/src/main/java/micdoodle8/mods/galacticraft/core/util/CompatibilityManager.java#L127

IC2Classic has a whole API for this stuff (this says 1.10.2 but the api between 1.10.2 and 1.12.2 is 100% equal) https://github.com/TinyModularThings/IC2Classic/blob/1.10.2/src/main/java/ic2/api/classic/util/ITickCallbackProvider.java

So there have to be patches made to have classic compat but it would remove a lot of Reflection code too.