mojira.dev
MCPE-155479

Wrong range of the hopper to fetch entities

    In "Hopper::_pullInItems()" ,  the position passed to "Hopper::_getItemAt()" is offsetted by +0.625 on the y-axis, "Hopper::_getItemAt()" defines a cube fetch range with a side length of 1, and inwards in all axes shrink by 0.0001. The final result is:

 

[media]

 

    As shown in the figure, the range of BE is different from that of JE, which makes BE's hopper unable to fetch drops above the soul sand. For this, the height of the BE's hopper fetch range should be changed to 1.375 for version parity.

 

    The fetch range of the hopper should never shrink inwards, the real solution is to replace all "AABB::intersectsInner()" inside "BlockSource::fetchEntities()" with "AABB::intersects()" . Following paragraphs will explain the reason behind.

 

[media]

 
    The float in C++ is only accurate to 6~7 digits in decimal, you can see that when the value exceeds 2048, the shrinking 0.0001 will not have any effect.
 

[media]

 

    You can test it in game, drop items against block like this, and the items will be sucked into the hopper. This happens for any hopper whose coordinates are outside ±2049, which is obviously unacceptable.

 

[media]

 
    The fetch range of the hopper at the chunk boundary will also be wrong. Here I use the RenderDragon shader bin I wrote myself to visualize the chunk boundary, which can be found at https://github.com/OEOTYAN/useless-shaders/releases/tag/v.rd.0.2 . When the coordinates are within ±2048, if you drop an item into a hopper with a honey block above the block on all sides, the item will be sucked correctly, but if you drop the item at the chunk boundary as shown in the figure, the item will be stuck between the honey block and the hopper gaps even the hopper is empty.

    This behavior is "repaired" at certain boundaries outside of ±2049, as the range of the funnel becomes 1*1 instead of 0.9998*0.9998.
 

[media]

 
    This is because "Bounds::Bounds()" in "BlockSource::fetchEntities()" is fetched using the hopper's range passed in, but this range does not contain neighboring chunks.
 

[media]

 
    The original AABB should still be used when determining with "AABB::intersects()" , and the search AABB should be extended by 0.125 for the xz axis when getting the chunk list. The same is true for hopper minecarts. You can add a parameter to the "BlockSource::fetchEntities()" function, or you can extend 0.125 for the get type of item inside the function.

Related issues

Attachments

Comments

migrated
[media][media][media][media][media][media]
Arisa Bot

⚠️ Please do not mark Unreleased Versions as affected. You don't have access to them yet.

-- I am a bot. This action was performed automatically! If you think it was incorrect, please notify us on Discord or Reddit

migrated

Thank you for your report!
We're tracking this issue in MCPE-55824 and MCPE-99462, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

migrated

crazy amount of research, sad it was swept under the rug like most reports. it was 6 months ago the issue should have been resolved already, but as usual mojang is busy implementing shiny new mobs to get new players to buy their bugged game. 

migrated

Afecta 1.19.51

ΘΣΦΓΥΔΝ

(Unassigned)

Confirmed

Windows

1.18.32, 1.19.0.31 Preview, 1.19.0.30 Beta, 1.18.30, 1.18.31

Retrieved