Conduit autotiling / Added Block.onProximityUpdate()

This commit is contained in:
Anuken
2018-07-10 10:14:10 -04:00
parent d31fbf3b6f
commit 66b9cdf64c
29 changed files with 379 additions and 199 deletions
@@ -151,7 +151,10 @@ public class TileEntity extends BaseEntity implements TargetTrait {
for (GridPoint2 point : nearby) {
Tile other = world.tile(tile.x + point.x, tile.y + point.y);
//remove this tile from all nearby tile's proximities
if(other != null) other = other.target();
if(other != null){
other = other.target();
other.block().onProximityUpdate(other);
}
if(other != null && other.entity != null){
other.entity.proximity.removeValue(tile, true);
}
@@ -165,7 +168,12 @@ public class TileEntity extends BaseEntity implements TargetTrait {
GridPoint2[] nearby = Edges.getEdges(tile.block().size);
for (GridPoint2 point : nearby) {
Tile other = world.tile(tile.x + point.x, tile.y + point.y);
if(other != null) other = other.target();
if(other != null){
other.block().onProximityUpdate(other);
other = other.target();
}
if(other != null && other.entity != null){
tmpTiles.add(other);
@@ -180,6 +188,8 @@ public class TileEntity extends BaseEntity implements TargetTrait {
for(Tile tile : tmpTiles){
proximity.add(tile);
}
tile.block().onProximityUpdate(tile);
}
public Array<Tile> proximity(){