Black hole talisman when attempting to extract using a crafty craft while empty deletes the talisman instead of dropping as is
Ampflower opened this issue ยท 5 comments
Mod Loader
Fabric
Minecraft Version
1.19.2
Botania version
1.19.2-436-FABRIC-SNAPSHOT
Modloader version
Quilt: Loader v0.18.1-beta.10, Quilted Fabric API 4.0.0-beta.19+0.64.0-1.19.2
Modpack info
https://github.com/Oliver-makes-code/gaycraft-pack
The latest.log file
https://gist.github.com/KJP12/50795617495920bf3cbaa0a9cc2bebee
Issue description
When sending an empty black hole talisman through a crafty crate, instead of dropping it or holding onto it as expected, it instead deletes the talisman entirely.
Steps to reproduce
- Obtain talisman, crafty crate and hopper
- Place crafty crate and feed hopper into it.
- Optionally give it a 1x1 placeholder.
- Give the crafty crate the talisman via the hopper.
- If not using the placeholder, right click with a wand of the forest.
Note: The talisman has to be empty for the bug to show, it'll otherwise extract the contents and drop itself as normal
Other information
Reproduced with a minimal set on the client of just QSL, Botania, Patchouli, LazyDFU and Trinkets, happens on server as well.
Still present in 9803af6 under the Fabric development environment, will try to track down the issue more.
Looking around, I believe this might be because the talisman sets itself to air when it is empty, which normally isn't reachable in the vanilla crafting table, but might be reachable by the crafty crate.
One potential fix is to go ahead and make this only return true if the talisman isn't empty, else false otherwise. https://github.com/VazkiiMods/Botania/blob/1.19.x/Xplat/src/main/java/vazkii/botania/common/crafting/recipe/BlackHoleTalismanExtractRecipe.java#L35-L51
Although, this doesn't fix the fact that the crafty crate can still void items when the recipe returns air but matches.
The other component of this would be to check if the stack is empty and bail before mutating the inventory.