Powah!

Powah!

19M Downloads

Ender Cells Void inserted cells on Server Restart

V2LenKagamine opened this issue ยท 16 comments

commented

Version: (make sure you are on the latest version before reporting):

  • Minecraft: 1.16.5
  • Forge: 36.42
  • Powah: 2.3.13

Issue description:

On server Crash/reboot, any cells inserted into an "Ender Cell" are voided.

Steps to reproduce:

Launch a server
Insert any cell into an ender cell
Crash/shutdown server

Is this a crash?, please includ it here: (Recommended to use Gist)

Crashes unrelated, I do believe shutting down the server produces the same result as it crashing.

commented

playing ATM9 (latest version) on Minecraft 1.20

my machine crashed (blue screen - java video issue) and my ender cells (1 hardened and 1 blazing) drained on the restart, as in reset to ZERO power. It said they were still capable of power, but they wouldn't receive power from my Flux point until I clicked in another energy cell.

commented

Can you try shutting down properly? I can't reproduce this shutting down properly.
This is very likely to be due to my fix in #155 for channels 2-12 being the same on servers.
I did test on a server and in singleplayer though. Will try to fix it if there's some way to get it to happen consistently.

Tested with:
forge-1.16.5-36.0.43
jei-1.16.4-7.6.1.71
Lollipop-1.16.4-3.2.7
Powah-1.16.4-2.3.13

Video with time-stamps.
02:58โ€‹ Filling up the Ender Cell
06:13โ€‹ Check Ender Cell (OK)
10:17โ€‹ Check Ender Cell again (OK)

Also please provide the debug.log and crash report anyway if you make a report in the future, and maybe for this one too if you can reproduce it again.
Powah uses MapData to store the ender cell storage max capacity and energy level so if that doesn't get saved properly that would be odd.

TL;DR; can't reproduce, please provide steps to reproduce (from a fresh server and client without crashing).

commented

I also tested upgrading from Powah-1.16.4-2.3.9 (Lollipop-1.16.4-3.2.4) to โ€‹Powah-1.16.4-2.3.13 (Lollipop-1.16.4-3.2.7) and channel 2-12 got duplicated as expected, so a bunch of free energy and max capacity for channels 3-12. This was, however, using singleplayer instead of multiplayer. So it seems to properly transfer from old worlds from before to after PR #155.

Video (7m, has time-stamps)
00:00โ€‹ Creating World
01:08โ€‹ Getting Items
01:26โ€‹ Setting up Ender Cell (Ch.1: 55.1kRF/140MRF, Ch. 2 to 12: 29.6kRF/280 MRF)
02:38โ€‹ Saving world
02:58โ€‹ Showing Old Version & Copying World
03:53โ€‹ Loading world on new version
04:41โ€‹ Checking the Ender Cell (OK)
05:20โ€‹ Testing channel seperation from PR #155โ€‹ (OK)
05:56โ€‹ Ending

So yeah, still can't reproduce, even upgrading from an old version. I think I've spent enough time on this issue already, we need a reproducible set of steps on order to look into this further.

commented

Will work on it

commented

This is occurring on my server as well, on every nightly restart. All of the cells are cleared. I'm using a custom modpack with powah 1.16.5-v2.3.13 and lollipop 1.16.4-.v3.2.7.

debug log: https://gist.github.com/Excaliburns/3479dc59c4aed801454abd379e1a907a

Not sure if it's relevant, but our server runs at a low tps most of the time (13-15.)

commented

Also tried that modpack and it reproduces this bug in single player and multiplayer.

The loading performance of that pack is absolutely horrible though (it took me over 20 minutes to load a fresh copy of the pack and create a single player world). The server wouldn't start initially either because of a bug in the old version of FTB quests that was reported by @Excaliburns above https://github.com/FTBTeam/FTB-Quests/issues/544.

If someone can find out what minimal combination of mods + Powah causes the bug to happen then that'd help a lot.

I think a way to get it to load faster just for testing purposes would be to remove KubeJS or delete the kubejs scripts. I don't think scripts could cause this bug to happen so it's worth a shot.

Otherwise I might get around to doing it at some point.

commented

That's strange, it definitely doesn't take 20 minutes for me, or any of my players. The KubeJS scripts are kind of needed to unify some blocks.

And I should get around to pushing a new version with some updated dependencies... I'm a little lazy since I thought no one else would try to run that server.

I can do a little digging after work and see if I can find the interaction. (as well as update my modpack, lol.)

commented

Hello,

Was looking this up and can add some more info I think. Tested with just Powah and JEI. After saving and re-entering world, current FE stored in Ender cells is not saved.

I originally experienced the battery upgrades disappearing (max FE value) in the Enig6 modpack, but was not able to reproduce that part with just Powah and JEI installed.

Version: (make sure you are on the latest version before reporting):
Minecraft: 1.16.5
Forge: 36.0.43
Powah: 2.3.13
Lollipop: 3.2.7
JEI: 7.6.1.71

Video of occurrence

commented

Hmm interesting. I can't get it to happen by putting refined pipes into the dev environment.
I will try with the versions given by Xnosis.

Okay what, I look at the video and it didn't save the current energy level, but the maximum storage was saved?
How strange...
Do you think you could send the debug.log as well for that recording if you still have them?

Okay that's really weird. I tried updating the dev environment to that forge version, and the JEI to that version as well and it didn't happen.

I'm going to try on a non-dev environment with some debug logging added in.

commented

More info, I uninstalled refined pipes and then created a new world with the mods reported by @Xnosis . That world saves correctly.

I then loaded up the world that I created with refined pipes installed, and the issue was still there.

Video and log:

https://streamable.com/50o8kw
https://gist.github.com/Excaliburns/4f7cab1212033af1da46592bef510e80

and no offense taken at your comments! I want to ensure everyone playing the pack has a good experience, so any abnormal loading times are good to report. 8 min still seems like a lot to me, but that could just be because of hardware and such.

commented

Does it happen consistently with that world?
Like every time you load it and add capacity, then close and re-open it loses it?
If so maybe you could send me that world by uploading it somewhere?

commented

Okay yep I tested with that works and it resets to zero energy and 1M max energy for channel 1 every time.
Will investigate.

I created a debug version of Powah that has debug logging for when the EnderNetwork is being read or written to.

Turns out for that world, for some reason it's only being read, and not written. (Search for EnderNetwork# in the logs):

Without Refined Pipes

With Refined Pipes

commented

Okay. I found the issue. It was introduced in my PR #155 as expected / mentioned.
Specifically the changes here to setEnergy.
It was not correct to change it to only markDirty() when clone returns true, because it's valid to modifying the backing Energy object directly as long as setEnergy() is called afterwards. So I'm gonna change it to always markDirty() like before.

Sorry for the inconvenience. PR coming soon.

commented

I was able to reproduce this with Refined Pipes. I had an inkling it was Refined Pipes doing this. I've had it do some weird things in regards to writing NBT to the server. Not entirely sure why...

It seems to also handle bad entries in its NBT-stored network data by throwing runtime exceptions on load, that's what I've had to deal with at least.

forge-39.0.39
Mods installed:
Refined Pipes - 0.5
Lollipop - 3.2.7
Powah - 2.3.13

Steps to reproduce (singleplayer):
Create a new world
Place ender cell
Load energy into any channel 2-12
Exit game
Go back into world
Energy is poof.

I've also updated my modpack, and if you're still experiencing crashes and long load times I'd appreciate an issue on my github page with your hardware and logs!

commented

Edit: I couldn't reproduce it with just Refined Pipes strangely, gonna look into what the comment under suggests.

Okay that's a huge help, thanks so much.
Since it's a single mod it'll be a lot easier to load it into a dev environment for testing.

Sorry about the harsh loading time comment. I think it took 20 mins cause it was a fresh boot and I was loading the server (also a fresh boot) and recording with OBS at the same time. Also includes the time it took to create a single player world and it become playable. I tested again and it takes about 8 minutes without a server running and OBS to load the pack and create a single player world and have it become interactible without lagging. Which is much more acceptable. Also I meant just removing the scripts for testing e.g. doing a binary search on the mod list. Not to actually remove them from the pack for playing purposes. Regardless, I could have been a bit nicer about it. Sorry.