You are not logged in.

IC2 Experimental builds: v2.0/2.1/2.2 (For Minecraft 1.6.4/1.7.2/1.7.10 → jenkins)
IndustrialCraft² recent version: v1.117! (For Minecraft 1.5.2 → topic)

Dear visitor, welcome to IC² Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.


Wednesday, February 22nd 2012, 3:36am

[1.70b] Bug: Certain items not stacking [SMP]

I'm having problems with certain items not stacking with each other when items come from IC2 (specificially crops)

Basically I have 4 ink sacs split into 2 and 2. 2 of them came from crops and the other 2 came from a squid. These will not stack.
This is happening with lots of items: wheat, pumpkin, red and yellow dye, etc. Also I think it happened with redstone from a miner once.

I went into NBTedit and discovered that there is an extra empty entry in 1 of the ink sacs (I'm assuming this orginated from the crop)

I also have Redpower (all of it), Forestry and Buildcraft running, but I think the problem is coming from IC2.

Anyone else have this problem or is it just me?


edit: i deleted the tag entries and it fixed the problem, wooden planks had this problem too so i dont think it is IC2 specific. Im thinking it could have been craftguide though as i had that accidently running.

edit2: Okay so its happening very frequently with all sorts of items... even torches and its kinda annoying.

edit3: It began when I started doing agriculture, which means i started using the cropanalyzer. I removed it from my hotbar and things seem normal now.


Wednesday, February 22nd 2012, 10:48am

Looking into it


IC2 admirer

  • "MG0" is male
  • Denmark

Posts: 24


  • Send private message


Wednesday, February 22nd 2012, 3:33pm

I can confirm the bug

So far it has only occurred while playing with crops, however I/we have not done much since the upgrade to 1.70



Wednesday, February 22nd 2012, 3:54pm

Looking into it

I've coded crop NBT to never return null and instead create new NBT tags ... isnt meant to apply to other items, but probably worth a look.


Friday, February 24th 2012, 1:41am

Okay so I am able to reproduce the bug (Tested with SSP and SMP)
1. Have the cropanalyzer in hotbar
2. Have a few of any stackable placeable item BESIDE THE CROPANALYZER IN THE HOTBAR. Also make sure there is a free space in your hotbar
3. Use cropanalyzer and exit it.
4. Switch to item (This is the point where it gets the tag) and place the item.
5. Pick them up and they should pop up as a seperate item (checking NBTedit, the picked up items are normal)
6. Items are now unstackable

Thanks for looking into it. Also I would appreciate if anyone else can try reproducing using these steps to confirm it.


Saturday, February 25th 2012, 5:40am

This bug happens quite often to be we the RE-BATTERY when i autosort with Inventory Tweaks
20kb for a signature? who has pictures that small??


Saturday, February 25th 2012, 6:25am

better add exception handling for null nbt then creating it...


Sunday, February 26th 2012, 6:43am

I can confirm this bug still exists in 1.71. Thanks for reporting it; now I know I don't need to hunt through forge items.

Observed effected entities:

Fertilizer (bonemeal + scrap)
Crop Yeilds
Stakes (er 4 sticks; forget the name offhand)

I also noticed inconsistency between client/server stacks (the client would stack but the server would say no).

From the description and observed behavior: I -think- the issue is opening the crop-analyzer shows the hotbar, and thus this code tags /all/ items with an empty NBT array, irrespective of the item type.

A test for confirming this with known clean parts (or dirty parts to see if they all become dirty); would be to place test items in the hotbar, open the scanner (might require a scan operation on an unknown seed sack) and see if the problem is reproducible.
Unsupported Meme


Sunday, February 26th 2012, 8:12am

I've confirmed that items in the hotbar which are clean are tainted when the crop scanner is used; it does not even have to process a crop; merely opening the scanner seems to be sufficient.

The check for 'bad' crops should probably only trigger when one is dropped in to the input of the scanner, and should require it to match the ID of a seed bag.
Unsupported Meme


Fully Automatic

Posts: 27

Location: Minecraftia

  • Send private message


Tuesday, February 28th 2012, 6:07pm

I can confirm that crafting RE-Batteries in a RP2 Project Table (SMP) can make them unable to stack. Charge a bit and uncharge all the batteries, fixed.
GENERATION 27: The first time you see this, copy it into your sig on any forum and add 1 to the
generation. Social experiment.


Saturday, March 31st 2012, 4:25pm

I have found that if you have Equivalent Exchange installed, throwing what you can into the Transmution Table's fire and then making it again form the EMC made also corrects it a bit.
A Rock Raider trained as an Engineer, among other things.


Saturday, March 31st 2012, 8:46pm

The 1.2.4 version will have a hack to try to prevent that bug. Once it's released, I need you guys' feedback.


Friday, July 6th 2012, 1:11pm

This bug is still present in 1.97 (installed only with forge 3.3.8 or 3.3.7). I added information to wiki's article about cropanalyzer, because it took me 3 hours to track it down.

Edit: I decompiled HandHeldCropnalyzer.class and I found out, that in "public void onGuiClosed" in a loop for every item in inventory until cropnalyzer is found "StackUtil.getOrCreateNbtData" is used.

Source code

                for(int k = 0; k < entityhuman.inventory.getSize(); k++) 

 ItemStack itemstack = entityhuman.inventory.getItem(k); 
 if(itemstack == null)                        continue;                    NBTTagCompound nbttagcompound3 = StackUtil.getOrCreateNbtData(itemstack);
 if(nbttagcompound.getInt("uid") != nbttagcompound3.getInt("uid"))  continue;
 itemStack.count = 1; 
 entityhuman.inventory.setItem(k, itemStack); 
 break;                }

Possible fix would be to replace

Source code

                    NBTTagCompound nbttagcompound3 = StackUtil.getOrCreateNbtData(itemstack);  
if(nbttagcompound.getInt("uid") != nbttagcompound3.getInt("uid"))                        continue;


Source code

                     NBTTagCompound nbttagcompound3 = itemstack.getTag();  
if(nbttagcompound3 == null || nbttagcompound.getInt("uid") != nbttagcompound3.getInt("uid"))                        continue; 

Something went wrong with code tags.

You shouldn't modify non cropanalyzer items in any way, but getOrCreateNbtData is doing it. Also I don't think that "entityhuman.inventory.setItem(k, itemStack)" is necessary, because you operate on references (ignoring this fact seems to be cause of this bug).

This post has been edited 7 times, last edit by "Zjarek" (Jul 6th 2012, 2:15pm)


It's OVER 9000!!!

  • "GregoriusT" is male

Posts: 9,087

Location: Location, Location.

  • Send private message


Friday, July 6th 2012, 2:00pm

Yes, the Bug is still there. Fix it Richard!
I don't say, your "insert whatever here" is bad,
I'm only showing possibilities for making it better.

Bugreports belong to the GregTech Thread. Any PM regarding Bugs or Support will get Ignored.


Friday, July 6th 2012, 4:49pm

That's the second time I've used code fixes from the community on the main source, I'm feeling uneasy...


Friday, July 6th 2012, 5:00pm

If you fixed this bug, could you post updated .class file, because I didn't go into whole recompiling thing yet.


Tuesday, September 11th 2012, 12:45am

Bug is still present in 1.103 and is EXTREMELY annoying.


Miner Of Diamond

  • "CrafterOfMines57" is male

Posts: 1,482

Location: The Great Islands of Nigeria

  • Send private message


Tuesday, September 11th 2012, 12:48am

I play on a lot of modded servers and while it seems rare, this has happened to me twice in total with many items such as red dye, or more recently water melons given from crops.
Is the answer to this question no?


Hey don't take it so hard. Ignorance is part of this generation it seems. -the wise words of XFmax-o-l


Tuesday, September 11th 2012, 12:40pm

There isn't anything else I can do. All stray mentions of NBT are removed from the cropnalyzer.

Also, they broke in 1.3


It's OVER 9000!!!

  • "GregoriusT" is male

Posts: 9,087

Location: Location, Location.

  • Send private message


Tuesday, September 11th 2012, 1:48pm

There isn't anything else I can do. All stray mentions of NBT are removed from the cropnalyzer.

Also, they broke in 1.3
Moment. Item-NBT broke in 1.3? Thats new to me, as my handheld Sonictron works fine with its 64 Inventoryslots and 2 Integervariables. And i looked at old IC²-Code to find out how it works.
I don't say, your "insert whatever here" is bad,
I'm only showing possibilities for making it better.

Bugreports belong to the GregTech Thread. Any PM regarding Bugs or Support will get Ignored.


Hits today: 20,087 | Hits yesterday: 19,915 | Hits record: 111,506 | Hits total: 38,350,168
Rate this thread