From 6357c17f8aa8305b3eb701d8f455d88d790833ef Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 29 Dec 2020 10:13:27 -0500 Subject: [PATCH] Fixed #4164 / Fixed #4159 --- core/src/mindustry/editor/MapEditorDialog.java | 3 +-- .../maps/planet/SerpuloPlanetGenerator.java | 14 ++++++++------ core/src/mindustry/world/blocks/Autotiler.java | 3 +-- .../world/blocks/distribution/ArmoredConveyor.java | 3 ++- .../world/blocks/liquid/ArmoredConduit.java | 5 +++-- gradle.properties | 2 +- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/core/src/mindustry/editor/MapEditorDialog.java b/core/src/mindustry/editor/MapEditorDialog.java index e73442497d..316d29f5e6 100644 --- a/core/src/mindustry/editor/MapEditorDialog.java +++ b/core/src/mindustry/editor/MapEditorDialog.java @@ -258,6 +258,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ player.clearUnit(); Groups.unit.clear(); Groups.build.clear(); + Groups.weather.clear(); logic.play(); if(player.team().core() == null){ @@ -700,8 +701,6 @@ public class MapEditorDialog extends Dialog implements Disposable{ if(core != 0) return core; int synth = Boolean.compare(b1.synthetic(), b2.synthetic()); if(synth != 0) return synth; - int editorVis = Boolean.compare(b1.buildVisibility == BuildVisibility.editorOnly, b2.buildVisibility == BuildVisibility.editorOnly); - if(editorVis != 0) return editorVis; int ore = Boolean.compare(b1 instanceof OverlayFloor, b2 instanceof OverlayFloor); if(ore != 0) return ore; return Integer.compare(b1.id, b2.id); diff --git a/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java b/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java index bf64f54193..cc0b1ea934 100644 --- a/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java +++ b/core/src/mindustry/maps/planet/SerpuloPlanetGenerator.java @@ -427,12 +427,14 @@ public class SerpuloPlanetGenerator extends PlanetGenerator{ //actually place the part if(part != null && BaseGenerator.tryPlace(part, x, y, Team.derelict, (cx, cy) -> { Tile other = tiles.getn(cx, cy); - other.setOverlay(Blocks.oreScrap); - for(int j = 1; j <= 2; j++){ - for(Point2 p : Geometry.d8){ - Tile t = tiles.get(cx + p.x*j, cy + p.y*j); - if(t != null && t.floor().hasSurface() && rand.chance(j == 1 ? 0.4 : 0.2)){ - t.setOverlay(Blocks.oreScrap); + if(other.floor().hasSurface()){ + other.setOverlay(Blocks.oreScrap); + for(int j = 1; j <= 2; j++){ + for(Point2 p : Geometry.d8){ + Tile t = tiles.get(cx + p.x*j, cy + p.y*j); + if(t != null && t.floor().hasSurface() && rand.chance(j == 1 ? 0.4 : 0.2)){ + t.setOverlay(Blocks.oreScrap); + } } } } diff --git a/core/src/mindustry/world/blocks/Autotiler.java b/core/src/mindustry/world/blocks/Autotiler.java index 027ac93b31..44a69c13c5 100644 --- a/core/src/mindustry/world/blocks/Autotiler.java +++ b/core/src/mindustry/world/blocks/Autotiler.java @@ -219,9 +219,8 @@ public interface Autotiler{ /** * Check if a position is facing the secondary position at a rotation * - * @param tile The origin tile that is or is not facing the destinated `otherblock` + * @param tile The origin tile that is or is not facing the `otherblock` * @param rotation The rotation of the tile on (x, y) - * * @param otherx The x coordinate of position 2 * @param othery The y coordinate of position 2 * @return whether this tile is looking at the other tile. diff --git a/core/src/mindustry/world/blocks/distribution/ArmoredConveyor.java b/core/src/mindustry/world/blocks/distribution/ArmoredConveyor.java index 496f140e53..af7e2c985b 100644 --- a/core/src/mindustry/world/blocks/distribution/ArmoredConveyor.java +++ b/core/src/mindustry/world/blocks/distribution/ArmoredConveyor.java @@ -12,7 +12,8 @@ public class ArmoredConveyor extends Conveyor{ @Override public boolean blends(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){ - return otherblock.outputsItems() && blendsArmored(tile, rotation, otherx, othery, otherrot, otherblock); + return (otherblock.outputsItems() && blendsArmored(tile, rotation, otherx, othery, otherrot, otherblock)) || + (lookingAt(tile, rotation, otherx, othery, otherblock) && otherblock.hasItems); } public class ArmoredConveyorBuild extends ConveyorBuild{ diff --git a/core/src/mindustry/world/blocks/liquid/ArmoredConduit.java b/core/src/mindustry/world/blocks/liquid/ArmoredConduit.java index c2af911324..e404b36b44 100644 --- a/core/src/mindustry/world/blocks/liquid/ArmoredConduit.java +++ b/core/src/mindustry/world/blocks/liquid/ArmoredConduit.java @@ -16,7 +16,8 @@ public class ArmoredConduit extends Conduit{ @Override public boolean blends(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){ - return otherblock.outputsLiquid && blendsArmored(tile, rotation, otherx, othery, otherrot, otherblock); + return (otherblock.outputsLiquid && blendsArmored(tile, rotation, otherx, othery, otherrot, otherblock)) || + (lookingAt(tile, rotation, otherx, othery, otherblock) && otherblock.hasLiquids); } public class ArmoredConduitBuild extends ConduitBuild{ @@ -24,7 +25,7 @@ public class ArmoredConduit extends Conduit{ public void draw(){ super.draw(); - // draw the cap when a conduit would normally leak + //draw the cap when a conduit would normally leak Building next = front(); if(next != null && next.team == team && next.block.hasLiquids) return; diff --git a/gradle.properties b/gradle.properties index 315f310592..e0edd857ff 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=172b5df0a7258f7195d4b1f4c5b5724108f13ab0 +archash=c1f1b3d22d98cd850e648f2bd7fbc73b1ced8624