Closed joekaiser closed 8 years ago
Here is a picture of the trace. The screenshot shows the the call the chunkTileEntityMap.put is being given an entity with an inventory. That inventory has a single item in it (In this case a grass block) but when the code finishes, the chest does not have that grass block
I fixed it but it'll be simpler not to have a whole pull request for it.
replace the if(hasTE){}
block with
TileEntity te = world.getTileEntity(targetPos);
if(te != null) {
tileEntityNbtData.setInteger("x", targetPos.getX());
tileEntityNbtData.setInteger("y", targetPos.getY());
tileEntityNbtData.setInteger("z", targetPos.getZ());
te.readFromNBT(tileEntityNbtData);
te.markDirty();
world.markBlockForUpdate(targetPos);
}
fixed by 9e9ba87
The Matter Trasnporter is working great for blocks, but if you move something with a TileEntity attached, it doesn't move the TileEntity right...or so it seems
I have done a trace, and the contents of the inventory are being save in the transporter. I also saw the the call to
TileEntity.createAndLoadEntity(tileEntityNbtData)
is creating the TE with the correct inventory (the items are in the chest). Stepping through the code,worldIn.setTileEntity(targetPos, te);
ends up doing a call into the Chunk and the reference to the chest from the chunk still has the inventory. Somewhere along the ling after the TileEntity is placed the inventory is removed.It almost seems like the chest isn't being associated to the TileEntity and doesn't see it.