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

Bug: Shulker boxes get stuck inside pouches and backpacks #240

Closed
ryantheleach opened this issue Mar 3, 2024 · 1 comment
Closed

Bug: Shulker boxes get stuck inside pouches and backpacks #240

ryantheleach opened this issue Mar 3, 2024 · 1 comment

Comments

@ryantheleach
Copy link
Contributor

ryantheleach commented Mar 3, 2024

If you manage to get a backpack, pouch, or shulkerbox inside a pouch or backpack, it's impossible to get it out.

Rather than prevent you from taking illegal items out, you should only prevent illegal items entering the pouch / backpack.

Also, it's possible to put a shulkerbox or chest inside a pouch or backpack, using the 'right click on inventory stack' method of putting items into pouches and backpacks, but NOT pouches or backpacks.

The logic in the Storage Group is a little all over the place too, the checks should probably call a method that centralizes the logic to prevent stuff like this happening in the future.

public void on_place_item_in_storage_inventory(InventoryClickEvent event) {
<snip>


// Allow putting in any items that are not a storage item, or storage items that have nothing in them.
			if (!(is_storage_item(event.getCursor()) && event.getCursor().hasItemMeta())) {

So the fact that custom items have item meta is what's filtering it out, which isn't really what we want to be checking for.

public void on_inventory_click(InventoryClickEvent event) {
<snip>
if (is_storage_item(event.getCurrentItem()) || (is_storage_item(event.getCursor()) && event.getCursor().hasItemMeta())) {

This is incorrectly filtering ALL storage items somehow, maybe it's because of getCurrentItem vs getCursor? not sure what the original intention was supposed to be here.

public void on_inventory_drag(InventoryDragEvent event) {
<snip>
for (final var item_stack : event.getNewItems().values()) {
			if (is_storage_item(item_stack)) {

drag is only checking if anything is a storage item, then cancelling.

@GabFran
Copy link

GabFran commented Oct 28, 2024

This bug still persists, noticed it when I couldn't put a dispenser inside a backpack. You can still place these items inside by number-clicking from hotbar into the backpack, and it is completely impossible to take them out.

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

No branches or pull requests

2 participants