JDKDigital / productive-bees

Useful bees
https://www.curseforge.com/minecraft/mc-mods/productivebees
Other
58 stars 40 forks source link

fix: bee not removed anymore if simulated hive on tick [intermittened issue] #341

Closed DevRichter closed 1 year ago

DevRichter commented 1 year ago

There is a bug in ATM 8 with simulated bee hives, where sometimes bees and beecages get deleted when inserting them into the hive. I have not yet fully found the reason why bees get deleted, but i assume that the "willLeaveHive" could be true which in turn then could result in releasing the bee, even though it should not be able to be released within a simulated hive.

The second fix i had in mind is surround the simulation hive logic with a try / catch and then populate the inventory with the correct cage item, to at least retrieve it in case something gets wrong. i hope to be able to debug that, and see where it actually fails. It might be that it thinks it is actually populated, but in concurrence with the bug on top, it gets a null pointer or something along those lines...

Not sure if any of this is the fault of this mod, or the modpack itself, feedback is welcome :)

JaisDK commented 1 year ago

The code change you've suggested doesn't actually change anything. Can you elaborate a little on when the bees disappear? Is it when you put the cage in or when you put the upgrade in?

DevRichter commented 1 year ago

The code change you've suggested doesn't actually change anything. Can you elaborate a little on when the bees disappear? Is it when you put the cage in or when you put the upgrade in?

oh yea. im using webstorm and the condition was so long, that i could not correctly see to what statement the else if block was assigned to...

So it happens irregularly, when you input a cage with or without a bee inside the hive, when you have a simulation upgrade installed. Sometimes just the cage gets deleted even though there is NO bee inside the hive. Sometimes it works. It does not matter if you shift click it in or not. The same happens for trying to retrieve bees. Sometimes it works, sometimes both the bee and the cage gets deleted. Does not matter if it is a sturdy cage or not.

I thought surrounding the logic with a try / catch would yield some information to when it has an issue. Cannot test rn as im at work.

Edit: tested this only in ATM 8 and with installing the upgrade on empty hives, and inputting bees after so far.

JaisDK commented 1 year ago

is the hive inventory clear in your tests?

DevRichter commented 1 year ago

is the hive inventory clear in your tests?

yes

edit: there is a chance that some hives had some items in the inventory. could be related, but am definitly sure the bug happend with empty inventories.

JaisDK commented 1 year ago

and just to be sure (because it has happened before) you don't have anything pulling from the hive inventory like hoppers/pipes or whatever the cool kids use today?

DevRichter commented 1 year ago

and just to be sure (because it has happened before) you don't have anything pulling from the hive inventory like hoppers/pipes or whatever the cool kids use today?

haha looks like im one of the cool kids then. Is it a known bug then? Im using importers from refined storage.

Nekosity12 commented 1 year ago

Not a bug, the pipes/hoppers etc will pull out the cage before it puts in the bee. Ensure that your importer isn't stealing the bee :)

JaisDK commented 1 year ago

you'll probably find the cages in your storage then

DevRichter commented 1 year ago

ohhhhhh hm that is interesting then. It is like that then. Why does it happen intermittenly, because of ticks? I do not know what happens under the hood. But thanks then!