Jump to content

action bar inventory shift-click drops items


Torojima

Recommended Posts

I do have a little problem with my mods container. The composition is very similar (if not copied :D) to the vanilla chest. It works very well except one little hickup. If an item on the player inventory is shift-clicked, it will be transfered automatically to the container inventory as expected. Vice versa the same. But, if an item in the action bar is shift-clicked it will be dropped to the ground. I have found out that in case of the item slot is located in the players action bar, the third parameter of the slotClick method of the Container class is given as 4, whilst it is 1 if the slot is located in the common area of the player inventory. Now, if I do the following everything in my container class (derived from Container) is working fine again:

 

@Override
public ItemStack slotClick(int slotIdx, int par2, int par3, EntityPlayer player)
{
// hack ... not very nice ...
if(par3 == 4)
{
	par3 = 1;
}
return super.slotClick(slotIdx, par2, par3, player);
}

 

But this is not as I would like to keep it. Thus I have two questions:

 

First, do somebody know what the par3 in slotClick is all about? (or the par2 whilst we're at it :) )

 

and second, does anybody else have a similar problem and a solution for it? Or does know of a solution even without having the same problem :D

 

running minecraft on Mac OS X - Sierra --- creating code since 1986 ... --- मेरा दिल भारतवासी है!

width=289 height=100http://www.arno-saxena.de/pictures/chococraft/banner_signature.png[/img]

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
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.