| Type: | Bug | ||
| Reporter: | [Mojang] Panda | Assignee: | [Mojang] Agnes Larsson |
| Resolution: | Fixed | Votes: | 146 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CHK: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Confirmation Status: | Confirmed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Game Mode: | Survival | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
When crafting something that gives more than one item as an result (e.g. diamond blocks to diamonds, stairs, slabs) and not all resulting items fit into the inventory, the overflow gets deleted. Steps to reproduce Ways to fix So for a nice fix some more generic Inventory/Container code would be good. Fix note: https://twitter.com/_LadyAgnes/status/762734666042441730 |
| Comments |
| Comment by Marcono1234 [ 10/Aug/16 ] |
|
Confirmed fixed for 16w32a |
| Comment by null (Inactive) [ 22/Jun/16 ] |
|
Confirmed for 1.10.1. |
| Comment by null (Inactive) [ 08/Jun/16 ] |
|
Confirmed for 1.10. |
| Comment by null (Inactive) [ 07/Jun/16 ] |
|
Confirmed for 1.10-pre2. |
| Comment by null (Inactive) [ 03/Jun/16 ] |
|
Confirmed for 1.10-pre1. |
| Comment by null (Inactive) [ 26/May/16 ] |
|
Confirmed for 16w21b. |
| Comment by null (Inactive) [ 25/May/16 ] |
|
Confirmed for 16w21a. |
| Comment by [Mod] redstonehelper [ 23/May/16 ] |
|
The third option wouldn't work, you can shift-craft while holding items with your cursor. |
| Comment by user-f2760 (Inactive) [ 19/May/16 ] |
|
I'd say the second option, that seems the most logical. |
| Comment by Fabian Röling [ 19/May/16 ] |
|
I don't see someone suggesting an intended behaviour yet in these comments. Should it...
|
| Comment by null (Inactive) [ 18/May/16 ] |
|
Confirmed for 16w20a. |
| Comment by null (Inactive) [ 11/May/16 ] |
|
Confirmed for 1.9.4. |
| Comment by null (Inactive) [ 06/May/16 ] |
|
Confirmed for 1.9.3-pre3. |
| Comment by user-f2760 (Inactive) [ 04/May/16 ] |
|
Cha0sPudd1ng you can also just say "confirmed for 1.9.2". |
| Comment by Andreas Billmaier [ 04/May/16 ] |
| Comment by Kumasasa [ 01/Apr/16 ] |
|
xxXmlgnosc0prXxx: 1.RV-pre1 is not tracked here. |
| Comment by John Samson [ 31/Mar/16 ] |
|
Confirmed for 1.RV PreRelease 1 (I know its an April Fools joke but it still affects it) |
| Comment by Wululululu [ 30/Mar/16 ] |
|
Affects 1.9.1 (and probably 1.9.2, as it will only be a fix for |
| Comment by James (inactive) [ 15/Mar/16 ] |
|
Confirmed for 1.9.1-pre3. |
| Comment by Fenhl (Max Dominik Weber) [ 27/Feb/16 ] |
|
Affects 1.9-pre4. |
| Comment by Marcono1234 [ 20/Feb/16 ] |
|
Please link to this comment in the description of the report. The following is based on decompiled version of Minecraft 1.8 using MCP. All method and class names are the names used in the decompiled version. The reason why this happens is that the protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean useEndIndex) method of the net.minecraft.inventory.Container class assumes it can always take only a part of the stack. This works for containers but not for crafting GUIs where it is either all or nothing (in this case it thinks it should remove all). This could be fixed by using a parameter to indicate whether the item stack can be splitted or not. The following shows one possible way to fix this. Class: net.minecraft.inventory.Container // This is the method with the parametes normally used protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean useEndIndex) { return mergeItemStack(stack, startIndex, endIndex, useEndIndex, true); } /** * Merges provided ItemStack with the first avaliable one in the container/player inventor between minIndex * (included) and maxIndex (excluded). Args : stack, minIndex, maxIndex, negativDirection. /!\ the Container * implementation do not check if the item is valid for the slot */ // Added the parameter "canStackBeSplitted" (boolean) // protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean useEndIndex) protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean useEndIndex, boolean canStackBeSplitted) { boolean var5 = false; int var6 = startIndex; if (useEndIndex) { var6 = endIndex - 1; } Slot var7; ItemStack var8; if (stack.isStackable()) { while (stack.stackSize > 0 && (!useEndIndex && var6 < endIndex || useEndIndex && var6 >= startIndex)) { var7 = (Slot)this.inventorySlots.get(var6); var8 = var7.getStack(); if (var8 != null && var8.getItem() == stack.getItem() && (!stack.getHasSubtypes() || stack.getMetadata() == var8.getMetadata()) && ItemStack.areItemStackTagsEqual(stack, var8)) { int var9 = var8.stackSize + stack.stackSize; if (var9 <= stack.getMaxStackSize()) { stack.stackSize = 0; var8.stackSize = var9; var7.onSlotChanged(); var5 = true; } // Replaced this to test if the stack can be splitted //else if (var8.stackSize < stack.getMaxStackSize()) else if (canStackBeSplitted && var8.stackSize < var8.getMaxStackSize()) { stack.stackSize -= stack.getMaxStackSize() - var8.stackSize; var8.stackSize = stack.getMaxStackSize(); var7.onSlotChanged(); var5 = true; } } if (useEndIndex) { --var6; } else { ++var6; } } } //... return var5; } Class: net.minecraft.inventory.ContainerWorkbench /** * Take a stack from the specified inventory slot. */ public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack var3 = null; Slot var4 = (Slot)this.inventorySlots.get(index); if (var4 != null && var4.getHasStack()) { ItemStack var5 = var4.getStack(); var3 = var5.copy(); if (index == 0) { // Index 0 is the crafting result which cannot be splitted //if (!this.mergeItemStack(var5, 10, 46, true)) if (!this.mergeItemStack(var5, 10, 46, true, false)) { return null; } var4.onSlotChange(var5, var3); } //... } return var3; } Class: net.minecraft.inventory.ContainerPlayer /** * Take a stack from the specified inventory slot. */ public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack var3 = null; Slot var4 = (Slot)this.inventorySlots.get(index); if (var4 != null && var4.getHasStack()) { ItemStack var5 = var4.getStack(); var3 = var5.copy(); if (index == 0) { // Index 0 is the crafting result which cannot be splitted //if (!this.mergeItemStack(var5, 9, 45, true)) if (!this.mergeItemStack(var5, 9, 45, true, false)) { return null; } var4.onSlotChange(var5, var3); } //... } return var3; } Class: net.minecraft.inventory.ContainerMerchant /** * Take a stack from the specified inventory slot. */ public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack var3 = null; Slot var4 = (Slot)this.inventorySlots.get(index); if (var4 != null && var4.getHasStack()) { ItemStack var5 = var4.getStack(); var3 = var5.copy(); if (index == 2) { // Index 2 is the item the player receives //if (!this.mergeItemStack(var5, 3, 39, true)) if (!this.mergeItemStack(var5, 3, 39, true, false)) { return null; } var4.onSlotChange(var5, var3); } //... } return var3; } Note: There might be other GUIs affected as well but I currently cannot think of any other ones |
| Comment by Wululululu [ 19/Feb/16 ] |
|
Affects 1.9-pre2 |
| Comment by 19Spleen [ 17/Feb/16 ] |
|
Confirmed for 1.9-pre1 |
| Comment by Fenhl (Max Dominik Weber) [ 16/Feb/16 ] |
|
Affects 16w07b. |
| Comment by Fenhl (Max Dominik Weber) [ 15/Feb/16 ] |
|
Affects 16w07a. |
| Comment by Fenhl (Max Dominik Weber) [ 10/Feb/16 ] |
|
Affects 16w06a. |
| Comment by Wululululu [ 08/Feb/16 ] |
|
Still in 16w05b |
| Comment by Fenhl (Max Dominik Weber) [ 29/Jan/16 ] |
|
Affects 16w04a. |
| Comment by Mona Juntus [ 26/Jan/16 ] |
|
@[Mod] CubeTheThird: Thanks, I'll keep it there in the future. |
| Comment by [Mod] CubeTheThird [ 26/Jan/16 ] |
|
Unless providing additional information about the issue, please keep discussions on the Jira Subreddit. |
| Comment by Mona Juntus [ 22/Jan/16 ] |
|
Confirmed for 16w03a. |
| Comment by James (inactive) [ 13/Jan/16 ] |
|
Confirmed for 16w02a. |
| Comment by James (inactive) [ 21/Dec/15 ] |
|
Confirmed for 15w51b. |
| Comment by George Gates [ 19/Nov/15 ] |
|
Still happening in 15w47a. |
| Comment by 19Spleen [ 12/Nov/15 ] |
|
Confirmed for 15w46a |
| Comment by George Gates [ 05/Nov/15 ] |
|
Still happening in 15w45a. Did the same thing as in the images, 8 diamond blocks and the extra diamonds got erased. |
| Comment by Wululululu [ 14/Oct/15 ] |
|
Still in 15w42a |
| Comment by Kumasasa [ 18/Sep/15 ] |
|
Changed reporter to panda4994 |
| Comment by [Mod] CubeTheThird [ 18/Sep/15 ] |
|
@Maria, this issue and |
| Comment by Maria Zuyeva [ 18/Sep/15 ] |
|
Couldn't find it with search as was looking for "shift". Reported it again |
| Comment by Andrew hunter [ 18/Sep/15 ] |
|
I don't know if this is part of this bug but if you Shift left click an item that is already in a full chest it just deletes it, which ties into the game not registering that your inventory is full. |
| Comment by branza [ 17/Sep/15 ] |
|
The title should also say that this happens for any recipe, not just for splitting blocks into separate items (well, I assume it does, I didn't actually test it). |
| Comment by [Mojang] Panda [ 17/Sep/15 ] |
|
Can confirm for 15w38b, also I agree with Wululululu that the title could be a bit more clear about the deletion of items |
| Comment by Wululululu [ 17/Sep/15 ] |
|
Still in 15w38a, Can a mod label this Bug as "item deletion" or for the sake of it as "item duplication"? |
| Comment by Wululululu [ 16/Aug/15 ] |
|
It's in 15w33c |
| Comment by Wululululu [ 05/Aug/15 ] |
|
Another week, another version it's in. 15w32a. |
| Comment by Wululululu [ 29/Jul/15 ] |
|
Confirmed in 1.8.8 and 15w31a |
| Comment by ChocolateChip Cookies [ 26/Jun/15 ] |
|
Confirmed in 1.8.7. |
| Comment by Seurabimn [ 17/Jan/15 ] |
|
Confirmed in 1.8.2-pre2, -pre3, and -pre4 |
| Comment by Chris [ 13/Jan/15 ] |
|
Confirmed in 1.8.2-pre1. Also affects wood planks. Can occur even when crafting more than a full stack (e.g. 22 diamond blocks + 3 empty slots -> 192 diamonds instead of 198). |
| Comment by [Mod] Neko [ 20/Nov/14 ] |
|
Confirmed in 1.8.1-pre5 |
| Comment by branza [ 20/Nov/14 ] |
|
Since this bug affects all recipes that give multiple items, the title should be changed to something like "Recipes that give multiple items not properly checking for full inventory". |
| Comment by Clint Kennedy [ 20/Nov/14 ] |
|
It's basically just destroying the remainder of 1 block. It's not completely destroying all blocks. Although this is still obviously an issue, it's not as bad as it would seem, but still of course bad! |
| Comment by Megabobster [ 20/Nov/14 ] |
|
I attached proper screenshots of the issue (my skin is blacked out because it's terrible). First two are the buggy behavior when shift clicking, second two are the what happens under normal circumstances. It's worth noting that this bug affects ALL mineral blocks. I can provide more screenshots or even video if it is necessary. |
| Comment by Wululululu [ 16/Oct/14 ] |
|
Confirmed for 1.8.1-pre2 |
| Comment by ChocolateChip Cookies [ 02/Sep/14 ] |
|
Confirmed for 1.8 official release |
| Comment by Wululululu [ 28/Aug/14 ] |
|
and 1.8-pre2 & 3 |
| Comment by [Mod] redstonehelper [ 24/Aug/14 ] |
|
Confirmed for 1.8-pre1. |
| Comment by Wululululu [ 20/Aug/14 ] |
|
still in 14w34c and d ... I guess we'll have this bug in 1.8 |
| Comment by Wululululu [ 18/Aug/14 ] |
|
and 14w34b |
| Comment by ChocolateChip Cookies [ 18/Aug/14 ] |
|
Affects version 14w34a. |
| Comment by Wululululu [ 14/Aug/14 ] |
|
Confirmed for 14w33a. |
| Comment by Wululululu [ 06/Aug/14 ] |
|
Confirmed for 14w32a, |
| Comment by Andrew Thomas [ 10/Jul/14 ] |
|
Confirmed for 14w28a |
| Comment by Wululululu [ 10/Jul/14 ] |
|
And it's still in 14w28a... |
| Comment by ChocolateChip Cookies [ 02/Jul/14 ] |
|
Confirmed for 14w27a. C'mon mojang, this would take like 5 minutes to fix, and it's been around for almost 2 years. |
| Comment by AgentM [ 28/Jun/14 ] |
|
Confirmed for the latest snapshot 14w26a/b/c Btw vote for this bug If you want it fixed and keep updating the Affects Versions. |
| Comment by Jeremy [ 05/May/14 ] |
|
This is a seriously bad bug. I am surprised to see it still in the game after all this time. Edit: You may also want to add that this affects Windows users as well, not just Linux. |
| Comment by rsNeutrino [ 05/May/14 ] |
|
Confirmed for snapshot 14w18b. |
| Comment by Wululululu [ 01/Mar/14 ] |
|
Still exists in 1.7.5. Not really surprising as Amunak confirmed it for the current Snapshots. |
| Comment by Amunak [ 01/Mar/14 ] |
|
This is true for all recipes that create more than one item per one input. Can confirm for 14w08a (latest snapshot as of now). It's a nasty bug and someone should fix it. |
| Comment by Jacob Petersen [ 27/Jan/14 ] |
|
I can verify that this bug still exists in 1.7.2. |
| Comment by Anton Kudin [ 10/Nov/13 ] |
|
Still a bug in 1.7.2. |
| Comment by Marios [ 26/Sep/13 ] |
|
Affects 1.6.4 and snapshot 13w38c. |
| Comment by Chalmes (Jon) [ 01/Nov/12 ] |
|
Confirmed. Nasty bug. Edit: Can I suggest changing title of bug to something like "Splitting blocks into separate items not properly checking for full inventory" |