This commit is contained in:
Anuken
2025-08-21 14:07:53 -04:00
parent 6d86707781
commit d89450d7e7
@@ -41,30 +41,31 @@ public class Pump extends LiquidBlock{
super.drawPlace(x, y, rotation, valid);
Tile tile = world.tile(x, y);
if(tile == null) return;
float amount = 0f;
Liquid liquidDrop = null;
if(valid && tile != null){
float amount = 0f;
Liquid liquidDrop = null;
for(Tile other : tile.getLinkedTilesAs(this, tempTiles)){
if(canPump(other)){
if(liquidDrop != null && other.floor().liquidDrop != liquidDrop){
liquidDrop = null;
break;
for(Tile other : tile.getLinkedTilesAs(this, tempTiles)){
if(canPump(other)){
if(liquidDrop != null && other.floor().liquidDrop != liquidDrop){
liquidDrop = null;
break;
}
liquidDrop = other.floor().liquidDrop;
amount += other.floor().liquidMultiplier;
}
liquidDrop = other.floor().liquidDrop;
amount += other.floor().liquidMultiplier;
}
}
if(liquidDrop != null){
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 ratio = (float)liquidDrop.fullIcon.width / liquidDrop.fullIcon.height;
Draw.mixcol(Color.darkGray, 1f);
Draw.rect(liquidDrop.fullIcon, dx, dy - 1, s * ratio, s);
Draw.reset();
Draw.rect(liquidDrop.fullIcon, dx, dy, s * ratio, s);
if(liquidDrop != null){
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 ratio = (float)liquidDrop.fullIcon.width / liquidDrop.fullIcon.height;
Draw.mixcol(Color.darkGray, 1f);
Draw.rect(liquidDrop.fullIcon, dx, dy - 1, s * ratio, s);
Draw.reset();
Draw.rect(liquidDrop.fullIcon, dx, dy, s * ratio, s);
}
}
}