Fixed #1959 / Indication of selected units
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user