You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Place a hopper facing into multiple inventory entities (in the world download: 19 chest carts and one chest boat, chest boat sits on a soul sand behind the rail)
Make sure all but one entity inventory is filled entirely (in the world download: chest carts full, chest boat empty)
Put items into the hopper and check how long the transfer takes on average. Compare this to the average time on vanilla. (World download: 86 seconds for 64 items in vanilla, 58 seconds for 64 items on neoforge)
Description of issue:
Neoforge's hopper item insertion logic is broken. Neoforge adds a "hook" at the start of the insertion code that duplicates the insertion code in case the insertion attempt fails. For successful attempts, it cancels the execution of the vanilla insertion code. In defail, the hook returns false for unsuccessful insertion attempts and the vanilla attempt is only cancelled when true is returned. (This is implemented differently for the extraction hook.)
Item transfers to inventory entities work by uniformly choosing a random inventory entity that intersects the 1x1x1 volume at the hopper output.
The chance of picking the chest boat in the example is 1/20.
After not choosing the chest boat (19/20 chance), the item transfer attempt fails.
With neoforge a second attempt takes place: Another 1/20 chance to pick the chest boat and successfully transfer.
This significantly speeds up the transfer to the chest boat from ~86 seconds to ~58 seconds for 64 items.
The fix should probably include always cancelling the vanilla transfer code or if possible, avoiding to duplicate the transfer code in the first place.
The text was updated successfully, but these errors were encountered:
Minecraft Version: 1.21.4
NeoForge Version: 21.4.22-beta
Steps to Reproduce:
World download:
HopperTest.zip
Demo Video:
Cannot post a video here, but demonstration video on the neoforge discord: 1836 ticks (91 seconds) on vanilla vs 1072 ticks (53 seconds) on neoforge The video shows a measurement of the timing. It is not necessary to understand the issue, but may be helpful.
Description of issue:
Neoforge's hopper item insertion logic is broken. Neoforge adds a "hook" at the start of the insertion code that duplicates the insertion code in case the insertion attempt fails. For successful attempts, it cancels the execution of the vanilla insertion code. In defail, the hook returns false for unsuccessful insertion attempts and the vanilla attempt is only cancelled when true is returned. (This is implemented differently for the extraction hook.)
Item transfers to inventory entities work by uniformly choosing a random inventory entity that intersects the 1x1x1 volume at the hopper output.
The chance of picking the chest boat in the example is 1/20.
After not choosing the chest boat (19/20 chance), the item transfer attempt fails.
With neoforge a second attempt takes place: Another 1/20 chance to pick the chest boat and successfully transfer.
This significantly speeds up the transfer to the chest boat from ~86 seconds to ~58 seconds for 64 items.
The fix should probably include always cancelling the vanilla transfer code or if possible, avoiding to duplicate the transfer code in the first place.
The text was updated successfully, but these errors were encountered: