Sophisticated Backpacks

Sophisticated Backpacks

89M Downloads

Magnet Upgrades do not respect the "PreventRemoteMovement" NBT Tag

BluSunrize opened this issue ยท 3 comments

commented

Describe the bug
Magnets allow picking up Item entities that have the NBT Tag "PreventRemoteMovement" applied.
This tag is (for instance) applied by Immersive Engineering's conveyor belts.

To Reproduce
Steps to reproduce the behavior:

  1. Open backpack
  2. Install magnet upgrade
  3. Place some IE conveyors and throw an item onto them
    => The magnet upgrade steals the item from the conveyor

Expected behavior
There is an NBT Tag on Item entities that has established itself in the modding community as a global flag for "don't magnet that!"
It was originally hashed out between Vazkii, Ellpeck, WayOfTime, myself and a few others. We agreed on PreventRemoteMovement.
I made my conveyors apply that tag, and various devs adjusted their magnet to ignore entities tagged as such.
It would be super useful if SophisticatedBackpacks did the same!

For example implementation see here:
https://github.com/Draconic-Inc/Draconic-Evolution/blob/master/src/main/java/com/brandon3055/draconicevolution/items/tools/Magnet.java#L73-L75
https://github.com/SuperMartijn642/SimpleMagnets/blob/forge-1.19/src/main/java/com/supermartijn642/simplemagnets/MagnetItem.java#L71

Versions

  • Minecraft: 1.19.2
  • Forge: 43.2.1
  • sophisticatedbackpacks-1.19.2-3.19.5.989.jar
  • ImmersiveEngineering-1.19.2-9.2.3-167.jar
commented

This tag has actually been in use since I added magnet upgrades 3 years ago. 1.19 version of that is here - https://github.com/P3pp3rF1y/SophisticatedCore/blob/1.19.x/src/main/java/net/p3pp3rf1y/sophisticatedcore/upgrades/magnet/MagnetUpgradeWrapper.java#L182

When retesting this I could see that magnet takes stacks from conveyors from time to time. However when I debugged the item entities it picks up don't have the tag set so it's picking them up properly.
The setup I used was chest, extractor conveyor, regular conveyor and finally another chest so in theory those should never turn into entities without tag but they still do from time to time. I guess I will leave it up to you to figure out why those item entities sometimes don't have the tag.

commented

Huh, intriguing!
Guess I have to do some debugging of my own to see why the tag is missing.

Thanks for checking it out =)

commented

from looking at it in the game it seems that sometimes when the item entity is supposed to end in the chest it instead gets dropped in world right next to the chest, if the magnet wasn't around it probably immediately gets picked up by the conveyor and put in the chest but magnet picks it up before that can happen