mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-05 07:47:48 +07:00
Fixed unit tests, power problems
This commit is contained in:
@ -41,6 +41,10 @@ public abstract class BlockStorage extends UnlockableContent{
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean productionValid(Tile tile){
|
||||
return true;
|
||||
}
|
||||
|
||||
public float getPowerProduction(Tile tile){
|
||||
return 0f;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public class ItemLiquidGenerator extends PowerGenerator{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldConsume(Tile tile){
|
||||
public boolean productionValid(Tile tile){
|
||||
ItemLiquidGeneratorEntity entity = tile.entity();
|
||||
return entity.generateTime > 0;
|
||||
}
|
||||
|
@ -56,8 +56,8 @@ public class Pump extends LiquidBlock{
|
||||
|
||||
@Override
|
||||
public void drawPlace(int x, int y, int rotation, boolean valid) {
|
||||
super.drawPlace(x, y, rotation, valid);
|
||||
Tile tile = world.tile(x, y);
|
||||
if(tile == null) return;
|
||||
|
||||
float tiles = 0f;
|
||||
Liquid liquidDrop = null;
|
||||
@ -69,7 +69,7 @@ public class Pump extends LiquidBlock{
|
||||
}
|
||||
}
|
||||
|
||||
if (liquidDrop != null){
|
||||
if(liquidDrop != null){
|
||||
float width = drawPlaceText(Core.bundle.formatFloat("bar.pumpspeed", tiles * pumpAmount / size / size * 60f, 0), x, y, valid);
|
||||
float dx = x * tilesize + offset() - width/2f - 4f, dy = y * tilesize + offset() + size * tilesize / 2f + 5;
|
||||
Draw.mixcol(Color.darkGray, 1f);
|
||||
|
@ -23,7 +23,7 @@ public class ConsumeModule extends BlockModule{
|
||||
boolean prevValid = valid();
|
||||
valid = true;
|
||||
optionalValid = true;
|
||||
boolean docons = entity.block.shouldConsume(entity.tile);
|
||||
boolean docons = entity.block.shouldConsume(entity.tile) && entity.block.productionValid(entity.tile);
|
||||
|
||||
for(Consume cons : entity.block.consumes.all()){
|
||||
if(cons.isOptional()) continue;
|
||||
|
Reference in New Issue
Block a user