Mouse Tweaks

Mouse Tweaks

284M Downloads

Mouse tweaks scrolling deletes items with Minecolonies

Raycoms opened this issue ยท 6 comments

commented

Initial bug report: ldtteam/minecolonies#6078

It's because Minecolonies copies the stack on setStackInSlot.

commented

Might be better to fix in Minecolonies. Generally you don't want things like this to be possible from the client side (Mouse Tweaks is clientside-only).

commented

That's strange because shift clicking etc works perfectly fine. Even shifting over several stacks which should have a similar behaviour.

commented
    @Override
    public void setStackInSlot(final int slot, @Nonnull final ItemStack stack)
    {
        mainInventory.set(slot, stack.copy());
    }

Basically because we copy here, the scrolling to insert breaks.

commented

How do other inventories do it?

commented

Also FYI Mouse Tweaks doesn't (and can't) directly manipulate containers with setStackInSlot; it implements all its features by simulating button presses using handleMouseClick.

commented

Vanilla mostly sets the stack directly, but they don't track inventory changes as we need it. We're tracking the contents of the inventories to avoid changing contents and us not noticing things are gone or new.