mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-06 16:27:25 +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;
|
||||
|
@ -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