Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2018-10-07 19:22:18 -03:00
4 changed files with 25 additions and 42 deletions

View File

@@ -133,4 +133,15 @@ public class PowerGraph{
}
}
}
@Override
public String toString(){
return "PowerGraph{" +
"producers=" + producers +
", consumers=" + consumers +
", all=" + all +
", lastFrameUpdated=" + lastFrameUpdated +
", graphID=" + graphID +
'}';
}
}

View File

@@ -74,22 +74,22 @@ public class PowerNode extends PowerBlock{
TileEntity entity = tile.entity();
entity.power.links.removeValue(other.packedPosition());
if(other.block() instanceof PowerNode){
other.entity.power.links.removeValue(tile.packedPosition());
}
//clear all graph data first
PowerGraph tg = entity.power.graph;
tg.clear();
entity.power.links.removeValue(other.packedPosition());
other.entity.power.links.removeValue(tile.packedPosition());
//reflow from this point, covering all tiles on this side
tg.reflow(tile);
//create new graph for other end
PowerGraph og = new PowerGraph();
//reflow from other end
og.reflow(other);
if(other.entity.power.graph != tg){
//create new graph for other end
PowerGraph og = new PowerGraph();
//reflow from other end
og.reflow(other);
}
}
@Override