Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features

This commit is contained in:
Anuken
2021-08-22 09:52:19 -04:00
9 changed files with 34 additions and 10 deletions
@@ -135,7 +135,7 @@ public class EntityCollisions{
public static boolean waterSolid(int x, int y){
Tile tile = world.tile(x, y);
return tile == null || (tile.solid() || !tile.floor().isLiquid);
return tile == null || tile.solid() || !tile.floor().isLiquid;
}
public static boolean solid(int x, int y){
@@ -27,13 +27,14 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{
@Override
public void update(){
boolean flying = isFlying();
for(int i = 0; i < 2; i++){
Trail t = i == 0 ? tleft : tright;
t.length = type.trailLength;
int sign = i == 0 ? -1 : 1;
float cx = Angles.trnsx(rotation - 90, type.trailX * sign, type.trailY) + x, cy = Angles.trnsy(rotation - 90, type.trailX * sign, type.trailY) + y;
t.update(cx, cy, world.floorWorld(cx, cy).isLiquid ? 1 : 0);
t.update(cx, cy, world.floorWorld(cx, cy).isLiquid && !flying ? 1 : 0);
}
}
@@ -71,6 +72,12 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{
return isFlying() ? null : EntityCollisions::waterSolid;
}
@Replace
@Override
public boolean onSolid(){
return EntityCollisions.waterSolid(tileX(), tileY());
}
@Replace
public float floorSpeedMultiplier(){
Floor on = isFlying() ? Blocks.air.asFloor() : floorOn();