Fixed unit tests, power problems
This commit is contained in:
@@ -41,6 +41,10 @@ public abstract class BlockStorage extends UnlockableContent{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean productionValid(Tile tile){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public float getPowerProduction(Tile tile){
|
public float getPowerProduction(Tile tile){
|
||||||
return 0f;
|
return 0f;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class ItemLiquidGenerator extends PowerGenerator{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldConsume(Tile tile){
|
public boolean productionValid(Tile tile){
|
||||||
ItemLiquidGeneratorEntity entity = tile.entity();
|
ItemLiquidGeneratorEntity entity = tile.entity();
|
||||||
return entity.generateTime > 0;
|
return entity.generateTime > 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ public class Pump extends LiquidBlock{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPlace(int x, int y, int rotation, boolean valid) {
|
public void drawPlace(int x, int y, int rotation, boolean valid) {
|
||||||
super.drawPlace(x, y, rotation, valid);
|
|
||||||
Tile tile = world.tile(x, y);
|
Tile tile = world.tile(x, y);
|
||||||
|
if(tile == null) return;
|
||||||
|
|
||||||
float tiles = 0f;
|
float tiles = 0f;
|
||||||
Liquid liquidDrop = null;
|
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 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;
|
float dx = x * tilesize + offset() - width/2f - 4f, dy = y * tilesize + offset() + size * tilesize / 2f + 5;
|
||||||
Draw.mixcol(Color.darkGray, 1f);
|
Draw.mixcol(Color.darkGray, 1f);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class ConsumeModule extends BlockModule{
|
|||||||
boolean prevValid = valid();
|
boolean prevValid = valid();
|
||||||
valid = true;
|
valid = true;
|
||||||
optionalValid = 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()){
|
for(Consume cons : entity.block.consumes.all()){
|
||||||
if(cons.isOptional()) continue;
|
if(cons.isOptional()) continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user