@@ -1247,10 +1247,12 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
timeScale = 1f;
|
||||
}
|
||||
|
||||
enabledControlTime -= Time.delta;
|
||||
if(block.autoResetEnabled){
|
||||
enabledControlTime -= Time.delta;
|
||||
|
||||
if(enabledControlTime <= 0){
|
||||
enabled = true;
|
||||
if(enabledControlTime <= 0){
|
||||
enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(sound != null){
|
||||
|
||||
@@ -136,7 +136,7 @@ public class OverlayRenderer{
|
||||
|
||||
if(tile != null && tile.team() == player.team()){
|
||||
tile.drawSelect();
|
||||
if(!tile.enabled){
|
||||
if(!tile.enabled && tile.block.drawDisabled){
|
||||
tile.drawDisabled();
|
||||
}
|
||||
|
||||
|
||||
@@ -94,6 +94,10 @@ public class Block extends UnlockableContent{
|
||||
public boolean absorbLasers = false;
|
||||
/** if false, the status is never drawn */
|
||||
public boolean enableDrawStatus = true;
|
||||
/** whether to draw disabled status */
|
||||
public boolean drawDisabled = true;
|
||||
/** whether to automatically reset enabled status after a logic block has not interacted for a while. */
|
||||
public boolean autoResetEnabled = true;
|
||||
/** if true, the block stops updating when disabled */
|
||||
public boolean noUpdateDisabled = false;
|
||||
/** tile entity health */
|
||||
|
||||
@@ -14,6 +14,8 @@ public class SwitchBlock extends Block{
|
||||
super(name);
|
||||
configurable = true;
|
||||
update = true;
|
||||
drawDisabled = false;
|
||||
autoResetEnabled = false;
|
||||
|
||||
config(Boolean.class, (SwitchBuild entity, Boolean b) -> entity.enabled = b);
|
||||
}
|
||||
|
||||
@@ -64,10 +64,9 @@ public class ImpactReactor extends PowerGenerator{
|
||||
return new TextureRegion[]{bottomRegion, region};
|
||||
}
|
||||
|
||||
public class FusionReactorBuild extends GeneratorBuild{
|
||||
public class ImpactReactorBuild extends GeneratorBuild{
|
||||
public float warmup;
|
||||
|
||||
|
||||
@Override
|
||||
public void updateTile(){
|
||||
if(consValid() && power.status >= 0.99f){
|
||||
|
||||
@@ -113,7 +113,7 @@ public class ItemLiquidGenerator extends PowerGenerator{
|
||||
}
|
||||
}
|
||||
|
||||
totalTime += heat;
|
||||
totalTime += heat * Time.delta;
|
||||
|
||||
//liquid takes priority over solids
|
||||
if(hasLiquids && liquid != null && liquids.get(liquid) >= 0.001f){
|
||||
|
||||
@@ -76,12 +76,14 @@ public class NuclearReactor extends PowerGenerator{
|
||||
float fullness = (float)fuel / itemCapacity;
|
||||
productionEfficiency = fullness;
|
||||
|
||||
if(fuel > 0){
|
||||
if(fuel > 0 && enabled){
|
||||
heat += fullness * heating * Math.min(delta(), 4f);
|
||||
|
||||
if(timer(timerFuel, itemDuration / timeScale())){
|
||||
consume();
|
||||
}
|
||||
}else{
|
||||
productionEfficiency = 0f;
|
||||
}
|
||||
|
||||
Liquid liquid = cliquid.liquid;
|
||||
|
||||
@@ -26,6 +26,7 @@ public class Unloader extends Block{
|
||||
configurable = true;
|
||||
saveConfig = true;
|
||||
itemCapacity = 0;
|
||||
noUpdateDisabled = true;
|
||||
|
||||
config(Item.class, (UnloaderBuild tile, Item item) -> tile.sortItem = item);
|
||||
configClear((UnloaderBuild tile) -> tile.sortItem = null);
|
||||
|
||||
Reference in New Issue
Block a user