Torojima Posted April 10, 2013 Posted April 10, 2013 I do have a little problem with my mods container. The composition is very similar (if not copied ) 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 Quote running minecraft on Mac OS X - Sierra --- creating code since 1986 ... --- मेरा दिल भारतवासी है! http://www.arno-saxena.de/pictures/chococraft/banner_signature.png[/img]
Recommended Posts
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.