MightyPirates / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
1.59k stars 432 forks source link

Warning when IC2 is not present in modpack #573

Closed kinnison closed 10 years ago

kinnison commented 10 years ago

Hi,

I don't have IC2 in my modpack, and so I get the following backtraces turn up a lot when using OpenComputers stuff:

[23:33:54] [Server thread/WARN] [OpenComputers]: Error in scheduled tick action.
java.lang.ClassCastException: li.cil.oc.common.tileentity.Case cannot be cast to ic2.api.energy.tile.IEnergyTile
    at li.cil.oc.common.EventHandler$$anonfun$scheduleIC2Add$1.apply$mcV$sp(EventHandler.scala:49) ~[EventHandler$$anonfun$scheduleIC2Add$1.class:?]
    at li.cil.oc.common.EventHandler$$anonfun$onTick$1.apply(EventHandler.scala:81) [EventHandler$$anonfun$onTick$1.class:?]
    at li.cil.oc.common.EventHandler$$anonfun$onTick$1.apply(EventHandler.scala:80) [EventHandler$$anonfun$onTick$1.class:?]
    at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) [IndexedSeqOptimized$class.class:?]
    at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186) [ArrayOps$ofRef.class:?]
    at li.cil.oc.common.EventHandler$.onTick(EventHandler.scala:80) [EventHandler$.class:?]
    at cpw.mods.fml.common.eventhandler.ASMEventHandler_245_EventHandler$_onTick_ServerTickEvent.invoke(.dynamic) [?:?]
    at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51) [ASMEventHandler.class:?]
    at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122) [EventBus.class:?]
    at cpw.mods.fml.common.FMLCommonHandler.onPreServerTick(FMLCommonHandler.java:260) [FMLCommonHandler.class:?]
    at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:536) [MinecraftServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:427) [MinecraftServer.class:?]
    at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685) [li.class:?]

Is there any way to prevent these filling my logs?

fnuecke commented 10 years ago

Probably the same (cause) as #567. Please let me know if this still happens in the latest dev builds.

kinnison commented 10 years ago

I will have to wait until the next scheduled downtime then I'll try, thanks.

fnuecke commented 10 years ago

If this is still an issue in the latest builds, let me know and I'll reopen this.

mzx987 commented 10 years ago

I know this issue has been closed, but even with the latest dev build (1.3.5.164), I still seem to have this same issue.

kinnison commented 10 years ago

I can ack the latest build still causes me this issue. just log spam, but still annoying

fnuecke commented 10 years ago

All right, attempt number one. This should fix it if I'm right and this is caused by some other mods shipping a (weirdly) partial IC2 API. Please give build 165 a try when it's done!

mzx987 commented 10 years ago

Tried the latest build. I even tried removing and replacing the blocks, but they give me the same error.

Would it help if I said that these blocks were being placed next to a Redstone Energy Cell from Thermal Expansion? Both the Server Rack, and the Power Converter leading to my computer are placed next to two output sides.

EDIT: Maybe its a problem with Thermal Expansion? I dunno, never was good at guessing these things.

fnuecke commented 10 years ago

Huh, well, if that didn't help then this simply makes no sense anymore whatsoever :P It should technically not be possible from my understanding... since that would mean that a class gets re-initialized, which AFAIK is not possible... I'll try another work around...

fnuecke commented 10 years ago

Oh, out of curiosity, could you see if in your startup log a line with "Skipping power support for mod xyz" (with xyz being IndustrialCraft2 for example) shows up?

mzx987 commented 10 years ago

Alright. Ill check that. May take a bit.

mzx987 commented 10 years ago

Yep. I found a line in my log file during startup that says the following:

"[Server thread/WARN] [OpenComputers/OpenComputers]: Skipping power support for mod IC2API."

And a bunch of "Option removal" lines from OpenComputers as well.

fnuecke commented 10 years ago

Ah! OK, I think I know what's happening... gah.

mzx987 commented 10 years ago

Also, as a side note, you are pretty fast at responding to these. I appreciate that :)

fnuecke commented 10 years ago

Heh, thanks for helping me narrow this down! :)

I now think this is some mod shipping the IC2 API without the API annotation, leading the injection to fail due to the implementing methods being stripped by FML, but the OC-internal mod detection to succeed - because that has to be based on the interface presence due to certain other mods shipping the partial IC2 API, meaning even if the API is supposedly present it can still fail due to missing interfaces... I'm now manually disabling power input from mods for which the injection fails, instead of relying on mod presence detection...this is such a mess :-/

Anyway, please give 166 a shot when it's done and let me know if that fixed it.

mzx987 commented 10 years ago

This one seems to have fixed it, but there is another issue that arises. I probably should have addressed it before. I'm sorry... :(

It has something to do with an error in scheduled tick action, but it throws out "java.lang.AbstractMethodError"

Here's a pastebin of just that error: http://pastebin.com/HCZsXN3K

EDIT: This appears to happen when I place one of the blocks down anywhere. I think Applied Energistics has something to do with it

fnuecke commented 10 years ago

OK, great! As for the AE one, OC is built against AE2 rv2, if you're using an older version, that might be the cause?

mzx987 commented 10 years ago

Oh. I guess I need to update to rv2 then. I'm using the stable builds. EDIT: Argh. I'll need to update Forge as well.

fnuecke commented 10 years ago

I'll see if I can add a version specific check to avoid the log spam on older versions.

mzx987 commented 10 years ago

If you could, that would be great. Mainly because of the mess I got myself in when I updated Forge. But I can fix it. Just means more updated and unstable mods.

mzx987 commented 10 years ago

After an arduous task of replacing 4 or so mods with unstable ones, I would just like to confirm that OpenComputers works without a problem I can see, so far.

Thank you so much for taking the time to help fix the key issue.

fnuecke commented 10 years ago

All right, thanks a lot for confirming! The next build (167) has a version specific presence check in it and should also be fine with older AE2 versions (it still won't accept power from AE, but at least it won't spam the log about it).