Sophisticated Backpacks

Sophisticated Backpacks

89M Downloads

Magnet Upgrade Not Working as Intended

DizzyDJW opened this issue ยท 1 comments

commented

Describe the bug
Idk if the issue persists on smaller backpacks but on the gold, diamond, and netherite ones, with a magnet upgrade, not only are new items going into an empty slot over a pre-existing slot, but if another mod's magnet is equipped, (with the backpack contents filter set), some items end up in player inventory instead of the backpack, when the item in question exists in the backpack already.

To Reproduce
Steps to reproduce the behavior:

  1. Have backpack with magnet upgrade
  2. Set upgrade filter to match contents
  3. Have lots of different items in backpack with some room to spare
  4. Have many items drop and get picked up
  5. See some items take up empty slot over pre-existing slot, and pick up enough to see some ending up in player inventory.

Expected behavior
Newly picked up items matching backpack contents should go to the first matching stack if there's room in that stack.

The backpack's magnet should be faster/have higher priority than other mod's magnets.

Versions
Ver. 3.4.2.354
Forge Ver. 36.2.4

commented

Neither of these things that you describe are bugs

  • items being put into preexisting slots with the same item is a thing only in gui for a good reason and that is performance. especially when picking up a ton of items on the ground this would very negatively affect server performance as simple implementation would mean comparing the item to every single slot when that item is picked up. I have an enhancement on my list to try to implement this in the future, but there will need to be not simple code added to make it perform really well.
  • and another mod picking up before backpack does can be happening for two reasons - the other mod's magnet can just simply run its code before backpack has a chance to run its code. And there's a bit of a delay so that items on the ground are not queried every single tick and again that logic doesn't affect performance of servers. For this one really the only solution is not to use another magnet as then you can expect this result. Or use a different magnet than the one in the backpack and a pickup upgrade that will automatically push these items into backpack once picked up by player using that other magnet. And no I am not going to raise priority of anything that backpack does just because you think that should be the case here. Another player I am sure will think that the other mod's magnet should have higher priority.