This commit is contained in:
Anuken
2025-08-21 14:07:53 -04:00
parent 6d86707781
commit d89450d7e7

View File

@@ -41,30 +41,31 @@ public class Pump extends LiquidBlock{
super.drawPlace(x, y, rotation, valid); super.drawPlace(x, y, rotation, valid);
Tile tile = world.tile(x, y); Tile tile = world.tile(x, y);
if(tile == null) return;
float amount = 0f; if(valid && tile != null){
Liquid liquidDrop = null; float amount = 0f;
Liquid liquidDrop = null;
for(Tile other : tile.getLinkedTilesAs(this, tempTiles)){ for(Tile other : tile.getLinkedTilesAs(this, tempTiles)){
if(canPump(other)){ if(canPump(other)){
if(liquidDrop != null && other.floor().liquidDrop != liquidDrop){ if(liquidDrop != null && other.floor().liquidDrop != liquidDrop){
liquidDrop = null; liquidDrop = null;
break; break;
}
liquidDrop = other.floor().liquidDrop;
amount += other.floor().liquidMultiplier;
} }
liquidDrop = other.floor().liquidDrop;
amount += other.floor().liquidMultiplier;
} }
}
if(liquidDrop != null){ if(liquidDrop != null){
float width = drawPlaceText(Core.bundle.formatFloat("bar.pumpspeed", amount * pumpAmount * 60f, 0), x, y, valid); float width = drawPlaceText(Core.bundle.formatFloat("bar.pumpspeed", amount * pumpAmount * 60f, 0), x, y, valid);
float dx = x * tilesize + offset - width/2f - 4f, dy = y * tilesize + offset + size * tilesize / 2f + 5, s = iconSmall / 4f; float dx = x * tilesize + offset - width/2f - 4f, dy = y * tilesize + offset + size * tilesize / 2f + 5, s = iconSmall / 4f;
float ratio = (float)liquidDrop.fullIcon.width / liquidDrop.fullIcon.height; float ratio = (float)liquidDrop.fullIcon.width / liquidDrop.fullIcon.height;
Draw.mixcol(Color.darkGray, 1f); Draw.mixcol(Color.darkGray, 1f);
Draw.rect(liquidDrop.fullIcon, dx, dy - 1, s * ratio, s); Draw.rect(liquidDrop.fullIcon, dx, dy - 1, s * ratio, s);
Draw.reset(); Draw.reset();
Draw.rect(liquidDrop.fullIcon, dx, dy, s * ratio, s); Draw.rect(liquidDrop.fullIcon, dx, dy, s * ratio, s);
}
} }
} }