Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override slotClick() to fix issues with ItemStackItemHandler #49

Merged
merged 14 commits into from
Dec 30, 2023

Conversation

ghzdude
Copy link
Contributor

@ghzdude ghzdude commented Dec 24, 2023

Reworks ItemStackItemHandler ModuleContainer to fix a dupe when shift-clicking items.

Adds putStack() calls to ModularContainer::transferItem, ModularContainer::transferStackInSlot, and ModularContainer::slotClick so that items are saved to NBT for ItemStackItemHandler.
Rename certain variables to make the purpose of the logic in ModularContainer::transferItemclearer

Let me know if this will cause problems with other mods

fix fromSlot not being set to empty when it was all moved
set fromSlot to empty
slightly rework the logic in `ModularContainer` to use `putStack()`
rename certain variables to make the logic clearer
fix issue with using `getStack()` directly
@ghzdude ghzdude changed the title Fix Shift-Clicking slots from item slots to player slots duping Rework ItemStackItemHandler Dec 29, 2023
@ghzdude ghzdude changed the title Rework ItemStackItemHandler Override slotClick() to fix issues with ItemStackItemHandler Dec 29, 2023
@brachy84 brachy84 merged commit d6a6a74 into CleanroomMC:master Dec 30, 2023
miozune pushed a commit to GTNewHorizons/ModularUI2 that referenced this pull request Feb 7, 2024
…roomMC#49)

* fix quickmove skipping if check
fix fromSlot not being set to empty when it was all moved

* remove empty check in first loop
set fromSlot to empty

* rework ItemStackItemHandler to extend ItemStackHandler
slightly rework the logic in `ModularContainer` to use `putStack()`
rename certain variables to make the logic clearer
fix issue with using `getStack()` directly

* remove `extractItem` override

* remove extra call to `putStack()`

* undo refactor to ItemStackItemHandler

* refactor `slotClick()` to use `putStack()` in appropriate places

* move method to match master

* add static ints for common mouse button inputs
rename dragType to mouseButton

* remove unneeded copy call

* formatting

* forgor a spot

* some adjustments

* split capability provider and item handler

(cherry picked from commit d6a6a74)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants