Closed Xhamolk closed 11 years ago
Possible solutions for [1]:
GuiContainer.handleMouseClick()
to stop the interacting with that slot. But it could also close the GUI, just like RP2 does with the canvas bags.
However this approach should do it on the ContainerItem.slotClick()
method.damageValue
when the GUI is opened on the ItemStack, and change it back when it's closed. I do this so my GuiContainer can track down the item based on it's itemID
and the modified damageValue
Solution:
Overrode the Container.slotClick()
method, so it checks ContainerItem.slotContainsHeldItem()
. If that returns true, then prevent the pick up, and call ContainerItem.onPickupPrevented()
.
I believe this is a bit more safe (gameplay-wise) than throwing the item to the world when it's picked from the GUI, which was the idea I had after observing RP2's Canvas Bags do that.
The Basic Functionality for ItemContainer and ContainerItem (637af3ba761ee09686dc9f704c3f3330ef2a7774) has the following flaw(s):
These flaws need to be fixed before I can make a PR against Forge for adding support for this.