Fixed unit tests, power problems

This commit is contained in:
Anuken
2019-11-05 19:20:23 -05:00
parent ce6f3ddb5a
commit ccac67ced6
4 changed files with 8 additions and 4 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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;