Fixed #1959 / Indication of selected units

This commit is contained in:
Anuken
2020-05-02 10:53:48 -04:00
parent 5f27261cb1
commit 342523a7de
6 changed files with 39 additions and 2 deletions

View File

@@ -147,6 +147,8 @@ public class StackConveyor extends Block implements Autotiler{
public void onProximityUpdate(){
super.onProximityUpdate();
int lastState = state;
state = stateMove;
int[] bits = buildBlending(tile, tile.rotation(), null, true);
@@ -160,6 +162,15 @@ public class StackConveyor extends Block implements Autotiler{
blendprox |= (1 << i);
}
}
//update other conveyor state when this conveyor's state changes
if(state != lastState){
for(Tilec near : proximity){
if(near instanceof StackConveyorEntity){
near.onProximityUpdate();
}
}
}
}
@Override

View File

@@ -43,7 +43,11 @@ public class UnitFactory extends Block{
flags = EnumSet.of(BlockFlag.producer);
configurable = true;
config(Integer.class, (tile, i) -> ((UnitFactoryEntity)tile).currentPlan = i < 0 || i >= plans.length ? -1 : i);
config(Integer.class, (tile, i) -> {
((UnitFactoryEntity)tile).currentPlan = i < 0 || i >= plans.length ? -1 : i;
((UnitFactoryEntity)tile).progress = 0;
});
consumes.add(new ConsumeItemDynamic(e -> {
UnitFactoryEntity entity = (UnitFactoryEntity)e;