1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2025-02-19 11:13:45 +07:00

Fixed ore-cliff blending

This commit is contained in:
Anuken 2018-07-24 09:18:04 -04:00
parent 9bc1ff8fa2
commit bf8f565631
2 changed files with 4 additions and 1 deletions
core/src/io/anuke/mindustry/world/blocks

View File

@ -12,6 +12,7 @@ import io.anuke.mindustry.type.StatusEffect;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.core.Effects.Effect;
import io.anuke.ucore.function.BiPredicate;
import io.anuke.ucore.function.Predicate;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.util.Geometry;
@ -60,6 +61,7 @@ public class Floor extends Block{
protected TextureRegion[] variantRegions;
protected Vector2[] offsets;
protected Predicate<Floor> blends = block -> block != this && !block.blendOverride(this);
protected BiPredicate<Tile, Tile> tileBlends = (tile, other) -> false;
protected boolean blend = true;
public Floor(String name){
@ -178,7 +180,7 @@ public class Floor extends Block{
Floor floor = other.floor();
if((floor.id <= this.id && !(tile.getElevation() != -1 && other.getElevation() > tile.getElevation())) || !blends.test(floor) || (floor.cacheLayer.ordinal() > this.cacheLayer.ordinal() && !sameLayer) ||
if((floor.id <= this.id && !(tile.getElevation() != -1 && other.getElevation() > tile.getElevation())) || (!blends.test(floor) && !tileBlends.test(tile, other)) || (floor.cacheLayer.ordinal() > this.cacheLayer.ordinal() && !sameLayer) ||
(sameLayer && floor.cacheLayer == this.cacheLayer)) continue;
TextureRegion region = floor.edgeRegions[i];

View File

@ -19,6 +19,7 @@ public class OreBlock extends Floor{
this.variants = 3;
this.minimapColor = ore.color;
this.blends = block -> block instanceof OreBlock && ((OreBlock) block).base != base;
this.tileBlends = (tile, other) -> tile.getElevation() < other.getElevation();
this.edge = base.name;
}