diff --git a/codechicken/multipart/MultipartGenerator.scala b/codechicken/multipart/MultipartGenerator.scala index 26fb430..7f736dc 100644 --- a/codechicken/multipart/MultipartGenerator.scala +++ b/codechicken/multipart/MultipartGenerator.scala @@ -74,6 +74,7 @@ object MultipartGenerator { if(converted)//perform client conversion { + ntile.partList(0).invalidateConvertedTile() world.setBlock(pos.x, pos.y, pos.z, MultipartProxy.block.blockID, 0, 0) world.setBlockTileEntity(pos.x, pos.y, pos.z, ntile) PacketCustom.sendToChunk(new Packet53BlockChange(pos.x, pos.y, pos.z, world), world, pos.x>>4, pos.z>>4) diff --git a/codechicken/multipart/TMultiPart.scala b/codechicken/multipart/TMultiPart.scala index f6ca6fc..919f3f4 100644 --- a/codechicken/multipart/TMultiPart.scala +++ b/codechicken/multipart/TMultiPart.scala @@ -240,6 +240,11 @@ abstract class TMultiPart * Called when this part is converted from a normal block/tile (only applicable if a converter has been registered) */ def onConverted() = onAdded() + /** + * Called when this part is converted from a normal block/tile (only applicable if a converter has been registered) before the original tile has been replaced + * Use this to clear out things like inventory from the old tile. + */ + def invalidateConvertedTile(){} /** * Called when this part has been moved without a save/load. */