gnembon / scarpet

Public Repository of scarpet programs for Minecraft
Creative Commons Zero v1.0 Universal
351 stars 158 forks source link

auto_pickup.sc Stopping At 2 Items Per Stack #391

Open AKA-Mae opened 2 weeks ago

AKA-Mae commented 2 weeks ago

Describe the bug When using auto_pickup.sc multiple stacks of 2 will be created and if there are no more empty slots will drop on the ground.

To Reproduce Steps to reproduce the behavior:

  1. Use /script download survival/auto_pickup.sc to download and enable the script
  2. Have 3 blocks of the same type in world to break
  3. Fill all inventory slots except 1 with something other than the block you're going to break
  4. Break the 3 blocks
  5. The first 2 will be automatically moved to your inventory in that empty slot, the third will drop as if there is no more room

Expected behavior Items should continue filling the inventory until stacks are full. I have tested this with multiple items, such as wooden planks and redstone dust.

Screenshots image

Environment

Additional context I noticed this first in a modded server, then tested with a fresh install of 1.20.6 and only carpet-fabric installed.

AKA-Mae commented 2 weeks ago

I just started using Carpet mod yesterday, so I'm not familiar with the syntax for scarpet, but I feel like the if ( current:1+count <= stack_limit(item_name) && current:2 == item_nbt, line may be the problem

rv3r commented 2 weeks ago

You are correct about the problematic line. I solved this on discord already, but unfortunately we haven't decided on how to update scripts to keep them backwards compatible.

Update line 47 to if ( current:1+count <= stack_limit(item_name) && current:2:'components' == item_nbt:'components',

https://discord.com/channels/882822986795716608/894811484062892095/1246920279020671089

AKA-Mae commented 2 weeks ago

Thank you for the fix! I'll join the discord to check for some more fixes on other scripts then.

manchesterjm commented 1 week ago

I updated the script with that fix, and it works fine now in 1.21. Thanks for the update.