Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.8.9] Organizing Stacks


Atijaf
 Share

Recommended Posts

When an item is shift clicked from from a chest, it is organized into your inventory.

 

I.e. Shift clicking on 64 oak within a separate inventory will fill oak stacks in your inventory first, before adding new ones.

 

Is there a way to call that method, that transfers the stacks, from the event "PlayerOpenContainerEvent"?  Or will I have to write my own code?

 

Thanks!

Link to comment
Share on other sites

The methods are reserved for containers and are fired when you actually shift-click stuff. It basically is written separately for each possible container to respect all slots of all inventories displayed in given container (one container can display many inventories - e.g: player's, chest's, crafting grid's, on and on...).

 

You can't just call those methods. They kinda work like this: "Oh, you shift clicked stack in some inventory at some index." -> "Lemme transfer that stack to the other inventory for you." -> *Iterates through other inventory* -> *Fills-up non-full stacks of same type* -> *Is something is left, places it in 1st possible slot - respecting design*.

 

Those methods are always written (for specific stack) to do transfering (from inv to inv), if you would want to sort all stacks so that you will get nicely stacked (sorted) ItemStacks in one inventory - that would look totally differently. So yeah - you need to write your method.

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.