cc-tweaked / CC-Tweaked

Just another ComputerCraft fork
https://tweaked.cc
882 stars 206 forks source link

Computers Freeze On Game Startup #34

Closed shelbykauth closed 6 years ago

shelbykauth commented 6 years ago

What I expect to happen:

What actually happens:

Current Workaround:

Other Workaround:

I'd like to not have to use either of these workarounds. Or at the very least, I'd like to know what's causing this.

This also does not happen 100% of the time. It seems to happen only when I first start Minecraft. If I stop the world (return to menu) and return, the computers work fine.

I am using:

I do have three Windows junction folders inside one of the computers in question so I can work on a program collection, use git without it showing up inside the computer, and not have this program set depending on this world, and so that my changes still take place instantly. I don't think this should affect anything, but I cannot fully test without the junction files because, well... I don't know how far they would affect. If they can affect other computers in the loaded world, would they be able to affect computers in an unloaded world?

Pictures of Problems:

After Typing: image

After Having right-clicked on computer: image

SquidDev commented 6 years ago

OK, that is curious. I've seen issues with the block appearing to be off, but never input failing entirely. Can you use keyboard shortcuts like Ctrl-s to shutdown, or does nothing work at all?

I doubt junction points are causing issues, unless they are included in themselves. Would it be possible to create an empty world and see if you can reproduce it on there?

shelbykauth commented 6 years ago

Keyboard shortcuts do not work, either.

I should note, I've gotten this once or twice a day in single player, and I just realized it probably correlates with shutting the whole game down and relaunching. But I've also gotten this once or twice (across several weeks) on the local server I'm running from a linux box. And that probably correlates with the server rebooting. But it's not as frequent because we move around more.

SquidDev commented 6 years ago

So I've had a little fiddle and I'm honestly not sure how this is happening. I'm seeing similar issues on server startup, but it seems to fix itself in a few seconds, after all the computers have booted up.

I'd be tempted to say that one computer has played up somewhere, borking all the others. However, the fact that breaking and replacing works implies that this isn't the case.

Just a couple of things worth checking:

shelbykauth commented 6 years ago

Can you use the Twitch Launcher? If so, I can provide you with everything, including my saves (minus the junction folder stuff), quite easily. I'm going to exclude the multiplayer stuff, though. My single player worlds are just testing and dev.

I restarted Minecraft. This time around, the computers all appear to be on, but are still unresponsive. 2018-05-15_13 26 42

Here's the Latest Log file:, I can't make heads or tails of it, but there's a big chunk of ComputerCraft stuff at line 746.

If this can be figured out without me updating for the time being, I'd prefer that. I haven't figured out how to properly manage modpack versions yet, and I'm already overflowing with additional versions. I either have to split into a different version or update everyone's packs to be the same... I think... I don't know.

==Edit== Oh! And when I went out just far enough for chests, computers, and tinkers tank fluids to disappear, but the wood and stuff stayed in place, and came back, nothing. Just a little farther out, so it was included in the fog area, came back. All the computers had the stuff I had typed in waiting there on the screen.

SquidDev commented 6 years ago

OK, so this appears to be a Peripherals+1 compatibility issue:

[com.austinv11.peripheralsplusplus.mount.DynamicMount:attach:165]: java.lang.NoSuchMethodException: dan200.computercraft.core.lua.CobaltLuaMachine.addAPI(dan200.computercraft.core.apis.ILuaAPI)
[com.austinv11.peripheralsplusplus.mount.DynamicMount:attach:165]:    at java.lang.Class.getDeclaredMethod(Class.java:2122)
[com.austinv11.peripheralsplusplus.mount.DynamicMount:attach:165]:    at com.austinv11.peripheralsplusplus.utils.ReflectionHelper.registerAPI(ReflectionHelper.java:167)
[com.austinv11.peripheralsplusplus.mount.DynamicMount:attach:165]:    at com.austinv11.peripheralsplusplus.mount.DynamicMount.attach(DynamicMount.java:160)
[com.austinv11.peripheralsplusplus.mount.DynamicMount:attach:165]:    at com.austinv11.peripheralsplusplus.mount.DynamicMountPeripheralChangeListener$1.execute(DynamicMountPeripheralChangeListener.java:40)
[com.austinv11.peripheralsplusplus.mount.DynamicMount:attach:165]:    at com.austinv11.peripheralsplusplus.utils.proxy.Task.invoke(Task.java:25)
[com.austinv11.peripheralsplusplus.mount.DynamicMount:attach:165]:    at com.sun.proxy.$Proxy74.execute(Unknown Source)
[com.austinv11.peripheralsplusplus.mount.DynamicMount:attach:165]:    at dan200.computercraft.core.computer.ComputerThread$TaskRunner.run(ComputerThread.java:274)
[com.austinv11.peripheralsplusplus.mount.DynamicMount:attach:165]:    at java.lang.Thread.run(Thread.java:745)
[java.lang.ThreadGroup:uncaughtException:1052]: java.lang.ClassCastException: dan200.computercraft.shared.computer.core.ServerComputer cannot be cast to dan200.computercraft.core.computer.Computer
[java.lang.ThreadGroup:uncaughtException:1052]:     at com.sun.proxy.$Proxy74.getOwner(Unknown Source)
[java.lang.ThreadGroup:uncaughtException:1052]:     at dan200.computercraft.core.computer.ComputerThread$TaskExecutor.execute(ComputerThread.java:235)
[java.lang.ThreadGroup:uncaughtException:1052]:     at dan200.computercraft.core.computer.ComputerThread$TaskExecutor.run(ComputerThread.java:174)
[java.lang.ThreadGroup:uncaughtException:1052]:     at java.lang.Thread.run(Thread.java:745)

It looks like, somehow, both the executor and manager thread are getting entirely borked, which is why nothing works until reloading chunks.

Pinging @rolandoislas on this - CC:Tweaked has native support for what you're trying to do, so would it be possible to detect that and use those APIs instead?

rolandoislas commented 6 years ago

Support for CC-Tweaked's API registration is implemented in the latest PeripheralsPlusOne alpha (build 61+).

shelbykauth commented 6 years ago

Confirmed that updating to PeripheralsPlusOne Build-61 (and CC:Tweaked pr 1.6) fixes the problem. (At least as far as I can see). Build 61 is still marked as Alpha on Twitch, so I have to manually go to that version instead of just clicking the update button, but that's alright. I'll get my crew updated soon.

Thank you guys so much for helping!

SquidDev commented 6 years ago

Amazing, thank you everyone for the information provided!

Support for CC-Tweaked's API registration is implemented in the latest PeripheralsPlusOne alpha (build 61+).

Sorry, I'd missed that as I hadn't looked at the develop branch. Thanks! Apologies for breaking things, I wasn't expecting people to get that deep into CC internals.