BuildCraft|Core

BuildCraft|Core

7M Downloads

ItemStacks sent via IPipeTile mysteriously disappear (regression from 4.2.2)

asiekierka opened this issue ยท 15 comments

commented

If I try to send an ItemStack via IPipeTile's injectItem method, it travels through the first pipe and then disappears, as seen here: http://gfycat.com/CelebratedPlayfulGardensnake (BuildCraft 5.0.3, Minecraft 1.7.2).

The exact same code (normal, regular usage of IPipeTile.injectItem()) works fine on BuildCraft 4.2.2 and Minecraft 1.6.4.

commented

That's going to be difficult to investigate on my end. Do you have a setup to look at it?

commented

Yes, but it's kind of involved (you need OpenComputers, a special dev build of Computronics and a map with a computer already set up). I'll poke you at IRC when I find time and explain.

commented

Let's do this the other way around ;-) I'm happy to provide you all the BC insights that you need, but I won't be able to work on it myself. Feel free to carry on this thread if you need anything. Or let me know if this is not something you're interested in fixing, in which case there are good chances for this issue to drop dead (except if anybody else is willing to give it a shot).

commented

Try to make sure that the Iron pipe is displaying an actual item and that it's not just a ghost. If the transfer between two pipes fails, there is probably something wrong with the item.

commented

@SpaceToad - sure, I'll look into it.

@SandGrainOne - I am definitely sure that the API is called on the server side, but I will start debugging it soon.

commented

@SpaceToad - I found what seems to be the reason of the bug. The TravellingItem is the same for the server and client if I injectItem(), meaning that once the client sets the container to its own, the server thinks it is invalid and purges the TravellingItem.

A hacky workaround I found was to clone the TravellingItem before writing it, like this:

    NBTTagCompound nbt = new NBTTagCompound();
    item.writeToNBT(nbt);
    items.add(item.make(nbt));

but it's not perfect. Not perfect at all. Well, it works, but it's a hack. I'd be more than happy to hear what a proper solution would be.

commented

Thanks for the hints @asiekierka! I'll look it up in more details this we and tell you if I find anything.

commented

If you need me to debug anything else, poke me here or on IRC and I shall provide necessary details.

commented

Alright, we need to get back to that one. Went a bit under the radar. @Prototik, is that something you'd be interested to investigate? Probably worth putting on 6.0 at this stage.

commented

@SpaceToad No problems, I'll see that.

commented

@Prototik great - thanks for your help!

commented

@SpaceToad
I had been write test mod over 6.0.9 just now and I cannot confirm this bug.
Regression was fixed or even didn't exists ever.

All items which I sent in IPipeTile (TileGenericPipe) successfully travel to destination without any glitches.

commented

That's interesting. Admittedly, I have only tested in 5.0.4 - it might have been fixed.

It does not matter if it cannot be reproduced as I do not seek to work on the mod mentioned in the issue for a long period of time, possibly approaching infinity.

commented

Is your mod available so that we could test with that? Loosing items is a serious matter and with your mod you might have found an edge case we don't handle very well.

commented

Thanks for the investigations @Prototik. There may indeed have been fixed or side effects of other changes. @SandGrainOne, I'm closing this issue for now, but please feel free to re-open if you manage to confirm the bug.