Conduit autotiling / Added Block.onProximityUpdate()
This commit is contained in:
@@ -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(){
|
||||
|
||||
Reference in New Issue
Block a user