Attempt to fix node connections

This commit is contained in:
Calclavia 2014-11-04 06:44:44 +08:00
parent dba426aaba
commit 509d369033
2 changed files with 5 additions and 3 deletions

View file

@ -110,13 +110,13 @@ class TileBattery extends TileAdvanced(Material.iron) with TElectric with IPacke
{
super.setIO(dir, packet)
//TODO: Not set during init
dcNode.connectionMask = ForgeDirection.VALID_DIRECTIONS.filter(getIO(_) > 0).map(d => 1 << d.ordinal()).foldLeft(0)(_ | _)
dcNode.connectionMask = 0x3F
//TODO: Connection logic having an issue
dcNode.positiveTerminals.clear()
dcNode.positiveTerminals.addAll(getOutputDirections())
notifyChange()
dcNode.reconstruct()
// dcNode.reconstruct()
markUpdate()
}

View file

@ -82,7 +82,8 @@ trait TWire extends PartAbstract with TNodePartConnector with TMaterial[WireMate
*/
def canConnectTo(obj: AnyRef): Boolean =
{
if (obj != null && obj.getClass.isAssignableFrom(getClass))
//If the object is a wire
if (obj != null && obj.getClass == getClass)
{
val wire = obj.asInstanceOf[TWire]
@ -107,6 +108,7 @@ trait TWire extends PartAbstract with TNodePartConnector with TMaterial[WireMate
return true
else if (obj.isInstanceOf[INodeProvider])
{
//Object not a wire
val node = obj.asInstanceOf[INodeProvider].getNode(classOf[DCNode], from)
if (node != null)