Jump to content

Recommended Posts

Posted

I assume you want to alter the behaviour of a vanilla Chest?

If so there is no event that is fired when the player attempts to take an Item out of an Inventory slot.

The simplest way to archive this would be to make a new block that behaves like a chest and that uses the same container classes etc. and then extend those classes to change their behavior.

I assume that it is also possible using reflection but that is slow and more difficult but then you wouldn't need to make a new block.

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Posted

I assume you want to alter the behaviour of a vanilla Chest?

If so there is no event that is fired when the player attempts to take an Item out of an Inventory slot.

The simplest way to archive this would be to make a new block that behaves like a chest and that uses the same container classes etc. and then extend those classes to change their behavior.

I assume that it is also possible using reflection but that is slow and more difficult but then you wouldn't need to make a new block.

 

No, I want to set the slot of an item that I am dragging from the vanilla chest into my own inventory.

Posted

If you are talking vanilla chest, I'll offer another solution.

 

Cancel the interact event for vanilla chests with event, then open your own GUI that looks just like the vanilla chest GUI.  Then you can manipulate anything you want.

 

 

Long time Bukkit & Forge Programmer

Happy to try and help

Posted

Oh,

 

That is something you should have put in the first post.

 

You want it to one time sort or periodically do it?

 

If periodically, just set up a tick event to fire off a sorter every so often.

 

If you want one time, just watch for the gui to be closed and fire it or watch for your inventory to change.

Long time Bukkit & Forge Programmer

Happy to try and help

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.