Thaumcraft Fix

Thaumcraft Fix

23.3k Downloads

Infernal Furnace doesn't check if item is dead

JoshieGemFinder opened this issue ยท 2 comments

commented

The infernal furnace block doesn't check that the EntityItem it picks up isn't dead, meaning it can technically pick up an item on the same tick as a hungry chest or magic mirror captures it, "duplicating" the item (it destroys all non-smeltable items, so it can't be abused that easily).

Originally I was also going to criticize the Hungry Chest, Magic Mirror and Crucible for not setting the item's contents to an empty stack; however, not emptying it is actually the correct behaviour that vanilla hoppers use.
The infernal furnace can set the content item of an EntityItem to an empty stack (instead of setting it to dead and leaving the content stack), breaking the vanilla behaviour.

commented

it's hard to get this to happen

It indeed is, due to the specific timings involved. Since the entire bug needs to happen in a subtick, the hungry chest needs to be interacted with first, and then the infernal furnace second, which means due to a quirk of Minecraft's code, the exact interaction is directional. Another thing to consider is that, depending on the state of the chest, the Infernal Furnace might immediately empty the shadow ItemStack instance, making it basically useless (it's really a miracle I stumbled across this bug at all).
I have recently discovered a way to consistently replicate the exact behaviour, but I feel like publicly announcing the exact method to effectively infinitely duplicate ores would only serve to turn this into a bigger issue than it currently is.

commented

This should technically be fixed, although I couldn't get anything weird to happen by trying to steal the item before the furnace gets to it. It seems like because the furnace activates based on the item hitting the block and not by ticking, it's hard to get this to happen. While I was at it, I did fix the sound and particles for throwing in an unsmeltable item, though.