Rounding of research amounts
This commit is contained in:
@@ -10,6 +10,7 @@ import arc.struct.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import arc.util.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.core.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
@@ -99,7 +100,7 @@ public class PowerNode extends PowerBlock{
|
||||
|
||||
bars.add("batteries", entity -> new Bar(() ->
|
||||
Core.bundle.format("bar.powerstored",
|
||||
(ui.formatAmount((int)entity.power.graph.getBatteryStored())), ui.formatAmount((int)entity.power.graph.getTotalBatteryCapacity())),
|
||||
(UI.formatAmount((int)entity.power.graph.getBatteryStored())), UI.formatAmount((int)entity.power.graph.getTotalBatteryCapacity())),
|
||||
() -> Pal.powerBar,
|
||||
() -> Mathf.clamp(entity.power.graph.getBatteryStored() / entity.power.graph.getTotalBatteryCapacity())));
|
||||
}
|
||||
|
||||
@@ -39,11 +39,6 @@ public class Fracker extends SolidPump{
|
||||
@Override
|
||||
public void drawCracks(){}
|
||||
|
||||
@Override
|
||||
public boolean shouldConsume(){
|
||||
return liquids.get(result) < liquidCapacity - 0.01f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
Draw.rect(region, x, y);
|
||||
|
||||
@@ -113,6 +113,11 @@ public class Pump extends LiquidBlock{
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldConsume(){
|
||||
return liquidDrop != null && liquids.get(liquidDrop) < liquidCapacity - 0.01f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTile(){
|
||||
if(consValid() && liquidDrop != null){
|
||||
|
||||
@@ -101,6 +101,11 @@ public class SolidPump extends Pump{
|
||||
Draw.rect(topRegion, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldConsume(){
|
||||
return liquids.get(result) < liquidCapacity - 0.01f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTile(){
|
||||
float fraction = 0f;
|
||||
|
||||
@@ -9,6 +9,7 @@ import arc.struct.*;
|
||||
import arc.util.ArcAnnotate.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.core.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.game.*;
|
||||
@@ -77,10 +78,10 @@ public class CoreBlock extends StorageBlock{
|
||||
|
||||
bars.add("capacity", (CoreEntity e) ->
|
||||
new Bar(
|
||||
() -> Core.bundle.format("bar.capacity", ui.formatAmount(e.storageCapacity)),
|
||||
() -> Core.bundle.format("bar.capacity", UI.formatAmount(e.storageCapacity)),
|
||||
() -> Pal.items,
|
||||
() -> e.items.total() / ((float)e.storageCapacity * content.items().count(i -> i.unlockedNow()))
|
||||
));
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user