mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-28 21:57:51 +07:00
More sensors / Logic tweaks
This commit is contained in:
@ -1174,6 +1174,9 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
if(sensor == LSensor.totalItems && items != null) return items.total();
|
||||
if(sensor == LSensor.totalLiquids && liquids != null) return liquids.total();
|
||||
if(sensor == LSensor.totalPower && power != null) return power.status * (block.consumes.getPower().buffered ? block.consumes.getPower().capacity : 1f);
|
||||
if(sensor == LSensor.itemCapacity) return block.itemCapacity;
|
||||
if(sensor == LSensor.liquidCapacity) return block.liquidCapacity;
|
||||
if(sensor == LSensor.powerCapacity) return block.consumes.hasPower() ? block.consumes.getPower().capacity : 0f;
|
||||
if(sensor == LSensor.powerNetIn && power != null) return power.graph.getPowerProduced();
|
||||
if(sensor == LSensor.powerNetOut && power != null) return power.graph.getPowerNeeded();
|
||||
if(sensor == LSensor.powerNetStored && power != null) return power.graph.getLastPowerStored();
|
||||
|
@ -4,6 +4,9 @@ public enum LSensor{
|
||||
totalItems,
|
||||
totalLiquids,
|
||||
totalPower,
|
||||
itemCapacity,
|
||||
liquidCapacity,
|
||||
powerCapacity,
|
||||
powerNetStored,
|
||||
powerNetCapacity,
|
||||
powerNetIn,
|
||||
|
@ -287,7 +287,7 @@ public class LStatements{
|
||||
|
||||
@Override
|
||||
public LCategory category(){
|
||||
return LCategory.operations;
|
||||
return LCategory.blocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -337,7 +337,7 @@ public class LStatements{
|
||||
|
||||
@Override
|
||||
public LCategory category(){
|
||||
return LCategory.operations;
|
||||
return LCategory.blocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user