Fixed neighbor wire change not updating connection packet

This commit is contained in:
Calclavia 2014-09-16 12:07:09 +08:00
parent 4456ac1d63
commit 75d1dd5b3d

View file

@ -207,19 +207,15 @@ class PartFlatWire extends TWire with TFacePart with TNormalOcclusion
super.onAdded() super.onAdded()
if (!world.isRemote) if (!world.isRemote)
{
sendConnUpdate() sendConnUpdate()
}
} }
override def onPartChanged(part: TMultiPart) override def onPartChanged(part: TMultiPart)
{ {
if (!world.isRemote)
{
sendConnUpdate()
}
super.onPartChanged(part) super.onPartChanged(part)
if (!world.isRemote)
sendConnUpdate()
} }
override def onNeighborChanged() override def onNeighborChanged()
@ -229,19 +225,22 @@ class PartFlatWire extends TWire with TFacePart with TNormalOcclusion
return return
super.onNeighborChanged() super.onNeighborChanged()
if (!world.isRemote)
sendConnUpdate()
} }
def notifyCornerChange(r: Int) def notifyCornerChange(r: Int)
{ {
val absDir: Int = Rotation.rotateSide(side, r) val absDir = Rotation.rotateSide(side, r)
val pos: BlockCoord = new BlockCoord(tile).offset(absDir).offset(side) val pos = new BlockCoord(tile).offset(absDir).offset(side)
world.notifyBlockOfNeighborChange(pos.x, pos.y, pos.z, tile.getBlockType) world.notifyBlockOfNeighborChange(pos.x, pos.y, pos.z, tile.getBlockType)
} }
def notifyStraightChange(r: Int) def notifyStraightChange(r: Int)
{ {
val absDir: Int = Rotation.rotateSide(side, r) val absDir = Rotation.rotateSide(side, r)
val pos: BlockCoord = new BlockCoord(tile).offset(absDir) val pos = new BlockCoord(tile).offset(absDir)
world.notifyBlockOfNeighborChange(pos.x, pos.y, pos.z, tile.getBlockType) world.notifyBlockOfNeighborChange(pos.x, pos.y, pos.z, tile.getBlockType)
} }