mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-30 22:49:06 +07:00
Power graph removal
This commit is contained in:
@ -157,6 +157,9 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
||||
}
|
||||
|
||||
public void removeFromProximity(){
|
||||
if(power != null){
|
||||
tile.block().powerGraphRemoved(tile);
|
||||
}
|
||||
GridPoint2[] nearby = Edges.getEdges(tile.block().size);
|
||||
for(GridPoint2 point : nearby){
|
||||
Tile other = world.tile(tile.x + point.x, tile.y + point.y);
|
||||
|
@ -159,6 +159,10 @@ public class Block extends BaseBlock {
|
||||
}
|
||||
}
|
||||
|
||||
public void powerGraphRemoved(Tile tile){
|
||||
tile.entity.power.graph.remove(tile);
|
||||
}
|
||||
|
||||
public boolean isLayer(Tile tile){
|
||||
return true;
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ public class PowerGraph{
|
||||
}
|
||||
|
||||
public void remove(Tile tile){
|
||||
all.add(tile);
|
||||
all.remove(tile);
|
||||
producers.remove(tile);
|
||||
consumers.remove(tile);
|
||||
}
|
||||
|
Reference in New Issue
Block a user