Fixed #2389 / Fixed #2388 / Fixed #2387 / Fixed #2386

This commit is contained in:
Anuken
2020-08-20 15:11:00 -04:00
parent 6d20e354b1
commit 562c41c288
8 changed files with 18 additions and 8 deletions

View File

@@ -1247,10 +1247,12 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
timeScale = 1f; timeScale = 1f;
} }
enabledControlTime -= Time.delta; if(block.autoResetEnabled){
enabledControlTime -= Time.delta;
if(enabledControlTime <= 0){ if(enabledControlTime <= 0){
enabled = true; enabled = true;
}
} }
if(sound != null){ if(sound != null){

View File

@@ -136,7 +136,7 @@ public class OverlayRenderer{
if(tile != null && tile.team() == player.team()){ if(tile != null && tile.team() == player.team()){
tile.drawSelect(); tile.drawSelect();
if(!tile.enabled){ if(!tile.enabled && tile.block.drawDisabled){
tile.drawDisabled(); tile.drawDisabled();
} }

View File

@@ -94,6 +94,10 @@ public class Block extends UnlockableContent{
public boolean absorbLasers = false; public boolean absorbLasers = false;
/** if false, the status is never drawn */ /** if false, the status is never drawn */
public boolean enableDrawStatus = true; 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 */ /** if true, the block stops updating when disabled */
public boolean noUpdateDisabled = false; public boolean noUpdateDisabled = false;
/** tile entity health */ /** tile entity health */

View File

@@ -14,6 +14,8 @@ public class SwitchBlock extends Block{
super(name); super(name);
configurable = true; configurable = true;
update = true; update = true;
drawDisabled = false;
autoResetEnabled = false;
config(Boolean.class, (SwitchBuild entity, Boolean b) -> entity.enabled = b); config(Boolean.class, (SwitchBuild entity, Boolean b) -> entity.enabled = b);
} }

View File

@@ -64,10 +64,9 @@ public class ImpactReactor extends PowerGenerator{
return new TextureRegion[]{bottomRegion, region}; return new TextureRegion[]{bottomRegion, region};
} }
public class FusionReactorBuild extends GeneratorBuild{ public class ImpactReactorBuild extends GeneratorBuild{
public float warmup; public float warmup;
@Override @Override
public void updateTile(){ public void updateTile(){
if(consValid() && power.status >= 0.99f){ if(consValid() && power.status >= 0.99f){

View File

@@ -113,7 +113,7 @@ public class ItemLiquidGenerator extends PowerGenerator{
} }
} }
totalTime += heat; totalTime += heat * Time.delta;
//liquid takes priority over solids //liquid takes priority over solids
if(hasLiquids && liquid != null && liquids.get(liquid) >= 0.001f){ if(hasLiquids && liquid != null && liquids.get(liquid) >= 0.001f){

View File

@@ -76,12 +76,14 @@ public class NuclearReactor extends PowerGenerator{
float fullness = (float)fuel / itemCapacity; float fullness = (float)fuel / itemCapacity;
productionEfficiency = fullness; productionEfficiency = fullness;
if(fuel > 0){ if(fuel > 0 && enabled){
heat += fullness * heating * Math.min(delta(), 4f); heat += fullness * heating * Math.min(delta(), 4f);
if(timer(timerFuel, itemDuration / timeScale())){ if(timer(timerFuel, itemDuration / timeScale())){
consume(); consume();
} }
}else{
productionEfficiency = 0f;
} }
Liquid liquid = cliquid.liquid; Liquid liquid = cliquid.liquid;

View File

@@ -26,6 +26,7 @@ public class Unloader extends Block{
configurable = true; configurable = true;
saveConfig = true; saveConfig = true;
itemCapacity = 0; itemCapacity = 0;
noUpdateDisabled = true;
config(Item.class, (UnloaderBuild tile, Item item) -> tile.sortItem = item); config(Item.class, (UnloaderBuild tile, Item item) -> tile.sortItem = item);
configClear((UnloaderBuild tile) -> tile.sortItem = null); configClear((UnloaderBuild tile) -> tile.sortItem = null);