Fix block status of repair point and battery (#4187)
* Fix block status of repair point and battery * Update Battery.java * Update RepairPoint.java
This commit is contained in:
committed by
GitHub
parent
b672434e83
commit
b79a6f6b32
@@ -42,5 +42,12 @@ public class Battery extends PowerDistributor{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockStatus status(){
|
||||
if(Mathf.equal(power.status, 0f, 0.01f)) return BlockStatus.noInput;
|
||||
if(Mathf.equal(power.status, 1f, 0.01f)) return BlockStatus.active;
|
||||
return BlockStatus.noOutput;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,5 +118,10 @@ public class RepairPoint extends Block{
|
||||
public boolean shouldConsume(){
|
||||
return target != null && enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockStatus status(){
|
||||
return Mathf.equal(efficiency(), 0f, 0.01f) ? BlockStatus.noInput : cons.status();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user