Immersive Engineering

Immersive Engineering

143M Downloads

[Bug] Magically repairing graphite electrodes in the enchating table when shiftlicking from stack in inventory

Lorelando opened this issue ยท 4 comments

commented

When shift clicking stacked (the stack has to be lager than one) and damaged graphite electrodes from your inventory into an enchanting table it get magically repaired.

Also, their stacking mechanic is kinda weird, they stack fine when dropping into the world or creating the stack by dragging the item with your cursor, they won't create a stack by shift clicking between inventories.

Minecraft 1.12.2
Minecraft Forge 14.23.2.2611
Immersive Engineering 0.12-80
Full Modlist

commented

This is likely a Forge or vanilla issue (seems to happen with any stackable NBT-carrying item, like bullets). I'm looking into it now.
The second part is definitely a vanilla thing, item pickup uses different rules to check mergeability than containers/GUI's.

commented

Solution: We should really stop graphite electrodes going in the enchanting table in the first place. They shouldn't get Unbreaking, it's just a bug I was always too lazy to fix.

commented

You weren't. They can't be enchanted, but it seems like all items go in the table. Have you got any idea what good this does (runs on slot click, so not really performance critical):

if (itemstack1.hasTagCompound() && itemstack1.getCount() == 1)
{
    ((Slot)this.inventorySlots.get(0)).putStack(itemstack1.copy());
    itemstack1.setCount(0);
}
else if (!itemstack1.isEmpty())
{
    ((Slot)this.inventorySlots.get(0)).putStack(new ItemStack(itemstack1.getItem(), 1, itemstack1.getMetadata()));
    itemstack1.shrink(1);
}
commented

Will be fixed by Forge once the above PR is merged.