Posted January 5, 201411 yr Hello everyone, I was looking at the tutorials on the wiki and I saw the one for Containers and GUIs, I implemented it, it works great but there's a little problem, when I do the shift + click stuff it doubles my item, I tried to look at a lot of different sources, implemented it a lot of times and it still doubles my items, what could I do? The problem is when transfering from the tile entity's inventory to the player inventory.
January 5, 201411 yr Author All of the classes are here: http://www.minecraftforge.net/wiki/Containers_and_GUIs
January 5, 201411 yr He means post YOUR code. Even if you copied the tutorial, we need to see your code.
January 5, 201411 yr Author Well, the code is the exact same, copy paste... A few names changed but that's it. When I say that my code is the same as it is there then it is (6 years of java). I tried to get it from a lot of other sources, all of them did the same. Container: http://pastebin.com/u7XMwF2K (It's an exact copy with the names changed) TE: http://pastebin.com/Wfesgiy7 (Exact copy with changed names) The block, do you really need that?
January 5, 201411 yr public ItemStack decrStackSize(int par1, int par2) { if (this.furnaceItemStacks[par1] != null) { ItemStack itemstack; if (this.furnaceItemStacks[par1].stackSize <= par2) { itemstack = this.furnaceItemStacks[par1]; this.furnaceItemStacks[par1] = null; return itemstack; } else { itemstack = this.furnaceItemStacks[par1].splitStack(par2); if (this.furnaceItemStacks[par1].stackSize == 0) { this.furnaceItemStacks[par1] = null; } return itemstack; } } else { return null; } } Im not sure why you didnt just use the furnace tile entity as reference... The above is from the furnace.
January 5, 201411 yr Author Soo...what is the problem? decrStackSize? Why would that be a problem in a chest Well, I'll try that when I get back home.
January 5, 201411 yr Author As I said, the problem is when shift clicking from the tile entity to the player inventory, that decrement stack size function from the furnance didn't change anything
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.