feildmaster/Quantum-Connectors

Chunk Persistence

feildmaster opened this issue · 18 comments

Keep chunks with "receivers" loaded, or find a work around.
Work around example: When chunk is loaded, check if any receivers in the area, and "power" if sender is "on"

Assigned this to myself. Gonna give it a whirl.

Have fun. I might try it later too... just to familiarize myself with it

I understand how to stop "chunk unloading."

But chunk-pre-load i am unsure about.

Well, I have started testing the chunk unloading code I've seen floating around (which is pretty much what WirelessRedstone does), and not-suprisingly it doesn't work. The chunk info seems to be different now for some reason. That's probably why it broke in WR. So I'm not sure how to tackle that ... going to try to debug a bit more later.

As for the preloading, I was going to use WirelessRedstone as an example there too. Looks like he's basically calling a method in his onEnable() that iterates over all the circuit locations and gets their chunks, then gets the world from the loc and does a world.loadChunk(). Seems simple enough.

Ok, weird, that wasn't working earlier ... but it's working now.

have the Chunk Unloading doing the right thing. Now let me try the preload...

Cool, preload works. Let me just clean up the code a bit then I'll check it in for you to test out too.

take your time. I'm about to go off to work in a little.

Heya, was wondering if you'd let me know how testing this goes.

It looks good, I think we should do one or two more issues before merging and releasing the update though.

Oh ... well then I should rename the branch to be something other than "issue-1" ... like maybe "next-version"

By the way, do you use instant messenger or anything? would be better for brainstorming I think.

k, renamed my issue-1 branch to "next-version" and pushed it up to github. Let me know when you've switched to the "next-version" branch and I'll remove the "issue-1" branch.

I use skype. I'll mail you.

Ah hah!

This current issue is still wrong! It doesn't protect /everything/!

What is it not protecting?

It doesn't protect receivers! (Only the senders)

But I have fixed that. I actually have a VERY messy code with trying to update it to multiple-receivers AND update the yml.

Well, that's weird. Because the way I tested it was to to chain sender/receivers so that a set of each were in separate chunks that were normally getting unloaded. Then I ended with a reciever at my start point. I turned it on and off and the state chained all the way through.

OH! I know why. My receivers in that test case were close enough to the senders that they were in the same chunk. And the last receiver was in the chunk I was standing in. Now it makes sense. My bad.

It's alright, like I said I got it fixed... I'll actually be pushing the mess of code I have so far. It fixes a lot of things. :D