WIP small unit fabricator

This commit is contained in:
Anuken
2022-02-16 18:38:40 -05:00
parent e86b4b0192
commit 5e601cb978
11 changed files with 34 additions and 38 deletions

View File

@@ -264,7 +264,7 @@ public class PowerGraph{
batteries.add(build);
}else if(build.block.outputsPower){
producers.add(build);
}else if(build.block.consumesPower){
}else if(build.block.consumesPower && build.block.consPower != null){
consumers.add(build);
}
}

View File

@@ -41,12 +41,16 @@ public class UnitFactory extends UnitBlock{
regionRotated1 = 1;
config(Integer.class, (UnitFactoryBuild tile, Integer i) -> {
if(!configurable) return;
if(tile.currentPlan == i) return;
tile.currentPlan = i < 0 || i >= plans.size ? -1 : i;
tile.progress = 0;
});
config(UnitType.class, (UnitFactoryBuild tile, UnitType val) -> {
if(!configurable) return;
int next = plans.indexOf(p -> p.unit == val);
if(tile.currentPlan == next) return;
tile.currentPlan = next;
@@ -218,6 +222,10 @@ public class UnitFactory extends UnitBlock{
@Override
public void updateTile(){
if(!configurable){
currentPlan = 0;
}
if(currentPlan < 0 || currentPlan >= plans.size){
currentPlan = -1;
}