Tigereye504 / chestcavity

Side effects may include shortness of breath, inhibited healing, inability to fight off infection, vulnerability to physical harm, weakness, loss of nutrition, difficulty walking or running, and sacrifice to Aztec gods .
26 stars 14 forks source link

[Bug] Dupe glitch by bee chest cavity and beehive #106

Open xXStrayXx opened 2 months ago

xXStrayXx commented 2 months ago

By filling the chest cavity of a bee with items, waiting at the gui of chest cavity for the bee to return to a beehive, and then taking the items out of the chest cavity, close the gui, ignite the beehive to drive the bee out (or just wait for the daytime) and open the chest cavity of said bee again, you will find that the items are duplicated, as the items you took out earlier is still inside the bee's chest cavity.

This is obviously caused by the feature where the chest cavity gui won't close automaticly even if the owner of the chest cavity dies or disappears. Which is cool for salvaging organs since it would be annoying if it does. But in the case of bees, when a bee return to a beehive, the bee is no longer an entity but an nbt sequence of the beehive, and the mod can no longer find and modify the chest cavity (which is part of the enetity nbt) of that bee, and since the chest cavity can no longer be modified, you can take out the items in it without actually removing them from the bee's chest cavity nbt, effectively duping items.

I suggest to make it configurable whether the chest cavity gui will automatically close when it can't find the owner of the chest cavity. Which would be really helpful for players who want a less broken experience. Thank you very much.

A5TR0spud commented 2 months ago

Maybe entities' chest cavities could automatically close if the entity can no longer be found, but isn't dead? This way it would work to prevent dupes from similar entities (bucket fish) or modded entities, without removing death scavenging

xXStrayXx commented 2 months ago

Maybe entities' chest cavities could automatically close if the entity can no longer be found, but isn't dead? This way it would work to prevent dupes from similar entities (bucket fish) or modded entities, without removing death scavenging

I don't know much about modding but I looked up the forge api and found a method .getRemovalReason that probably could do just that