Mob Grinding Utils

Mob Grinding Utils

80M Downloads

Mob Masher Upgrades Disappearing when used with EnderIO Redstone Conduits

LiamRivet opened this issue · 24 comments

commented

Using a mob masher with 10 beheading upgrades and 10 fortune upgrades for wither farm and they randomly despawn out of the mob masher

commented

I'm experiencing this issue too.

I have mob mashers and fans both connected to redstone conduit and only the mashers are losing their upgrades and glitching out.

I'm not familiar with Minecraft modding but BlockSaw.setState (called from neighborChanged) looks really suspicious:
https://github.com/vadis365/Mob-Grinding-Utils/blob/MC1.12/MobGrindingUtils/MobGrindingUtils/src/main/java/mob_grinding_utils/blocks/BlockSaw.java#L130
Either this code can NullPointerException or the null check below is redundant. The world.setTileEntity call also looks redundant(?).

Fans handle active state entirely differently (why??): TileEntityFan.setActive is never called and the active field is never used. There's also no corresponding BlockFan.setState method.

commented

um, you should never call world.setTileEntity() with a TE you got from world.getTileEnitity(). It may be called "set" but it doesn't replace the existing one, so it is only safe to use after a setBlockState(). Otherwise you end up having your TE in the TE lists multiple times...

commented

I blame legacy code left in from porting and updates :P
Code should be fine now. Still don't know if it'll actually fix the issue with redstone conduits (which is the issue here).

commented

Pushed 0.3.13 update to curse (awaiting approval)

commented

Thanks for making the new release. This bug appears to be fixed now:

I restarted my server 3 times on 0.3.11 and my mob mashers glitched and lost their upgrades each time.
I did the same thing 3 times on 0.3.13 and my mob mashers did not lose their upgrades at all.

commented

Hello,
Fantastic news. Looks like we squashed another bug... for now :)
Thanks for taking the time to report your findings.
I'm going to close this for now and tag @HenryLoenwind - just to say thanks for the help on tracking stuff down.
Cheers,
Me.

commented

Hello,
Considering this is the 1st time this has been reported and as such is a new issue, I'm not sure why it's suddenly happening. The Tile NBT is saved as it has always been; it implements a basic inventory and the contents are saved in the TE's read and write to NBT methods. I'll do some testing, but this is strange.
Cheers,
Me.

*Edit - Is the same issue happening to you for the Fans and Absorption Hopper? These use the exact same inventory methods to handle saving the NBT

commented

I'm also having the same issue. Whenever there's a server restart, all the upgrades from the masher disappear.

@vadis365 are you serializing the container in the Tile Entity NBT? Because I loaded up a chunk with NBTExplorer, and there's nothing on the TE section that would suggest it's being saved there. I also took a peek at the source, and I don't see any special handling of the container contents, so I'm wondering if that has even been implemented.

commented

Not piling on. I have the same issue with the masher. The fan upgrades do not disappear. I am using the Direwolf20 1.12 pack single player if that adds any helpful information.

commented

I did a little more investigation. I have one masher for a week powered by a lever it has never lost the upgrades. Another room has 7 mashers powered by ender IO redstone conduit 4 of the 7 lost the upgrades. I replaced ender IO conduit with levers and all 7 kept the upgrades after a restart. Could it be an issue between ender IO redstone conduit and the masher?

commented

On my server the masher that is disappearing with all upgrades is also connected to an Ender IO Redstone Conduit. I'll try changing that to a lever and see if it fixes after the scheduled restart.
By the way, we are running modpack Direwolf20 1.12 2.20.

commented

I have just spotted some legacy code in some of the TE's in MGU that are returning null stacks on methods concerning the inventory eg. public ItemStack removeStackFromSlot(int slot) is returning null rather than an empty stack or being handled in other ways - I'll fix this and push a new build in a few hours time. This is probably not connected with the above issue, but is a concern that it has been missed for so long - doh!

commented

Hello,
Thanks for the info peeps, it does really help with tracking issues down to specifics. Would it be possible to also report this on the EnderIO issues page as well? @HenryLoenwind is actually a really nice chap and helpful with issues like this.
Cheers,
Me.

commented

Reminds me of issues with disappearing paint some people have. There, however, it only happens when making the network packets, not when writing the save.

Preliminary diagnosis: Some TileEntity is crashing when writing NBT and Forge is silently eating the crash, but stopping the chunk's serializing completely.

PS: The TE causing this would also lose its data. Which actually would rule out the conduits.

I'll have a deeper look into the TE saving code tonight, last time there was a mass-issue with it was ~3 years ago.

commented

@HenryLoenwind / @vadis365 Would attaching a debugger, making a change to the TE and running /save-all with an Exception catchall breakpoint possibly catch the issue? I never tried a broad Exception breakpoint in Minecraft and I'm afraid that I might see things that cannot be unseen.

commented

I think that may actually work. Good idea.

commented

ok, when saving TEs into the save file, exceptions are caught and logged:

image

So if anything goes AWOL from saving+loading it must be the block's own fault.

On the server->client syncing there is no try{}catch block. So actually any error there should kill the server, it seems?

Now that leaves me a bit puzzled as I fail to see any way of TE data getting dropped without a log message. Aside from some mod manually deleting the TileEntity, but that is not a common practice as it is utterly useless.

commented

EnderIO redstone conduits are the issue here. MGU works with vanilla redstone, it's a little bit of round robin on what the actual problem is here.

  • Edit
    I'll test with some other mods that provide redstone signals and see if there is anything happening that can duplicate this.
commented

I didn't say that it's not the conduits, I said that I don't see how this can happen without any message in the logfile.

commented

ta - that is all I needed ;)

commented

That sounded a like I was blaming you @HenryLoenwind - my apologies.
What I meant to say is; the conduits have an issue with MGU and I'll see if other mods do too, as I'm not ruling it out as an issue with MGU itself.
More stack checks in MGU are wrong which shows the codebase to be a little neglected. I'm still surprised they have gone for so long un-noticed and not cropped up as issues sooner.

commented

np, I got a bit into the habit of triple-stating things in github tickets as there are more and more people around that mis-read even simple statements... ;)

commented

Are these still a thing in the latest version?
enderio:blockEndermanSkull
The EndeIO codebase is all over the place - I have no idea where your registeries are these days ;)

commented

The skulls are still there, but the id is under_score_case nowadays (block_enderman_skull).

Registries are easy to find...if you know how. Otherwise it really is a bit hard. Every sub-project has a "...Object" class in its "init" package. (or just look what "implements IModObject"). There all the blocks and items are in.