diff --git a/core/assets/sprites/block_colors.png b/core/assets/sprites/block_colors.png index 6649c27445..1e888528da 100644 Binary files a/core/assets/sprites/block_colors.png and b/core/assets/sprites/block_colors.png differ diff --git a/core/assets/sprites/sprites2.png b/core/assets/sprites/sprites2.png index 11661f6d1d..bae1868cc6 100644 Binary files a/core/assets/sprites/sprites2.png and b/core/assets/sprites/sprites2.png differ diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 302ba2dc3c..464b613680 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -159,6 +159,24 @@ public class Blocks implements ContentList{ albedo = 0.5f; }}; + darksandTaintedWater = new ShallowLiquid("darksand-tainted-water"){{ + speedMultiplier = 0.75f; + statusDuration = 60f; + albedo = 0.5f; + }}; + + sandWater = new ShallowLiquid("sand-water"){{ + speedMultiplier = 0.8f; + statusDuration = 50f; + albedo = 0.5f; + }}; + + darksandWater = new ShallowLiquid("darksand-water"){{ + speedMultiplier = 0.8f; + statusDuration = 50f; + albedo = 0.5f; + }}; + tar = new Floor("tar"){{ drownTime = 150f; status = StatusEffects.tarred; @@ -221,23 +239,9 @@ public class Blocks implements ContentList{ playerUnmineable = true; }}; - darksandTaintedWater = new ShallowLiquid("darksand-tainted-water", Blocks.taintedWater, Blocks.darksand){{ - speedMultiplier = 0.75f; - statusDuration = 60f; - albedo = 0.5f; - }}; - - sandWater = new ShallowLiquid("sand-water", Blocks.water, Blocks.sand){{ - speedMultiplier = 0.8f; - statusDuration = 50f; - albedo = 0.5f; - }}; - - darksandWater = new ShallowLiquid("darksand-water", Blocks.water, Blocks.darksand){{ - speedMultiplier = 0.8f; - statusDuration = 50f; - albedo = 0.5f; - }}; + ((ShallowLiquid)darksandTaintedWater).set(Blocks.taintedWater, Blocks.darksand); + ((ShallowLiquid)sandWater).set(Blocks.water, Blocks.sand); + ((ShallowLiquid)darksandWater).set(Blocks.water, Blocks.darksand); holostone = new Floor("holostone"){{ diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 4cf01c7307..a5a8de4cc2 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -59,7 +59,9 @@ public class UnitType extends UnlockableContent{ if(EntityMapping.map(name) != null){ constructor = EntityMapping.map(name); }else{ - constructor = () -> Nulls.unit; + //TODO fix for mods + throw new RuntimeException("Unit has no type: " + name); + //constructor = () -> Nulls.unit; } } diff --git a/core/src/mindustry/world/blocks/environment/Floor.java b/core/src/mindustry/world/blocks/environment/Floor.java index 0d6c49528c..d3b3929975 100644 --- a/core/src/mindustry/world/blocks/environment/Floor.java +++ b/core/src/mindustry/world/blocks/environment/Floor.java @@ -231,14 +231,7 @@ public class Floor extends Block{ } protected boolean doEdge(Floor other, boolean sameLayer){ - //TODO this is awful and should not exist. - boolean normal = ((other instanceof ShallowLiquid) == (this instanceof ShallowLiquid)) || (cacheLayer == other.cacheLayer); - return (((other.blendGroup.id > blendGroup.id) || edges() == null) && - other.edgeOnto(this) && (other.cacheLayer.ordinal() > this.cacheLayer.ordinal() || !sameLayer)) == normal; - } - - protected boolean edgeOnto(Floor other){ - return true; + return (((other.blendGroup.id > blendGroup.id) || edges() == null) && (other.cacheLayer.ordinal() > this.cacheLayer.ordinal() || !sameLayer)); } TextureRegion edge(Floor block, int x, int y){ diff --git a/core/src/mindustry/world/blocks/environment/ShallowLiquid.java b/core/src/mindustry/world/blocks/environment/ShallowLiquid.java index 4c9c4c4636..28d94c05fe 100644 --- a/core/src/mindustry/world/blocks/environment/ShallowLiquid.java +++ b/core/src/mindustry/world/blocks/environment/ShallowLiquid.java @@ -4,12 +4,14 @@ import mindustry.world.*; //do not use in mods! public class ShallowLiquid extends Floor{ - public final Floor liquidBase, floorBase; + public Floor liquidBase, floorBase; public float liquidOpacity = 0.35f; - public ShallowLiquid(String name, Block liquid, Block floor){ + public ShallowLiquid(String name){ super(name); + } + public void set(Block liquid, Block floor){ this.liquidBase = liquid.asFloor(); this.floorBase = floor.asFloor();