Added invalidateConvertedTile callback for parts

This commit is contained in:
Chicken-Bones committed 2013-11-12 12:59:40 +10:00
1 parent 607854f537
commit bb13dbd65c
2 files changed
+6

No files matched your search

@@ -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)
+5
View File
@@ -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.
*/