diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 69600c9f16..1f3f6ba00a 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -256,6 +256,10 @@ public class Block extends UnlockableContent{ /** Drawn when you are placing a block. */ public void drawPlace(int x, int y, int rotation, boolean valid){ + drawPotentialLinks(x, y); + } + + public void drawPotentialLinks(int x, int y){ if((consumesPower || outputsPower) && hasPower){ Tile tile = world.tile(x, y); if(tile != null){ diff --git a/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java b/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java index 44d4f63f93..0742348e5d 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java @@ -41,6 +41,8 @@ public class BaseTurret extends Block{ @Override public void drawPlace(int x, int y, int rotation, boolean valid){ + super.drawPlace(x, y, rotation, valid); + Drawf.dashCircle(x * tilesize + offset, y * tilesize + offset, range, Pal.placing); } diff --git a/core/src/mindustry/world/blocks/distribution/ItemBridge.java b/core/src/mindustry/world/blocks/distribution/ItemBridge.java index 527acbe78a..5047b5e8ba 100644 --- a/core/src/mindustry/world/blocks/distribution/ItemBridge.java +++ b/core/src/mindustry/world/blocks/distribution/ItemBridge.java @@ -90,6 +90,8 @@ public class ItemBridge extends Block{ @Override public void drawPlace(int x, int y, int rotation, boolean valid){ + super.drawPlace(x, y, rotation, valid); + Tile link = findLink(x, y); Lines.stroke(2f, Pal.placing); diff --git a/core/src/mindustry/world/blocks/distribution/MassDriver.java b/core/src/mindustry/world/blocks/distribution/MassDriver.java index 67c4c23191..5b9d4e6f13 100644 --- a/core/src/mindustry/world/blocks/distribution/MassDriver.java +++ b/core/src/mindustry/world/blocks/distribution/MassDriver.java @@ -57,6 +57,8 @@ public class MassDriver extends Block{ @Override public void drawPlace(int x, int y, int rotation, boolean valid){ + super.drawPlace(x, y, rotation, valid); + Drawf.dashCircle(x * tilesize, y * tilesize, range, Pal.accent); //check if a mass driver is selected while placing this driver diff --git a/core/src/mindustry/world/blocks/power/PowerNode.java b/core/src/mindustry/world/blocks/power/PowerNode.java index a48647b03f..960c106bf3 100644 --- a/core/src/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/mindustry/world/blocks/power/PowerNode.java @@ -263,7 +263,8 @@ public class PowerNode extends PowerBlock{ //add conducting graphs to prevent double link for(var p : Edges.getEdges(block.size)){ Tile other = tile.nearby(p); - if(other != null && other.team() == team && other.build != null && other.build.power != null){ + if(other != null && other.team() == team && other.build != null && other.build.power != null + && !(block.consumesPower && other.block().consumesPower && !block.outputsPower && !other.block().outputsPower)){ graphs.add(other.build.power.graph); } } diff --git a/core/src/mindustry/world/blocks/power/ThermalGenerator.java b/core/src/mindustry/world/blocks/power/ThermalGenerator.java index 154bd02a0c..c57284c667 100644 --- a/core/src/mindustry/world/blocks/power/ThermalGenerator.java +++ b/core/src/mindustry/world/blocks/power/ThermalGenerator.java @@ -27,6 +27,8 @@ public class ThermalGenerator extends PowerGenerator{ @Override public void drawPlace(int x, int y, int rotation, boolean valid){ + super.drawPlace(x, y, rotation, valid); + drawPlaceText(Core.bundle.formatFloat("bar.efficiency", sumAttribute(attribute, x, y) * 100, 1), x, y, valid); } diff --git a/core/src/mindustry/world/blocks/production/Cultivator.java b/core/src/mindustry/world/blocks/production/Cultivator.java index 57b2372f6c..57f79a98a0 100644 --- a/core/src/mindustry/world/blocks/production/Cultivator.java +++ b/core/src/mindustry/world/blocks/production/Cultivator.java @@ -47,6 +47,8 @@ public class Cultivator extends GenericCrafter{ @Override public void drawPlace(int x, int y, int rotation, boolean valid){ + super.drawPlace(x, y, rotation, valid); + drawPlaceText(Core.bundle.formatFloat("bar.efficiency", (1 + sumAttribute(attribute, x, y)) * 100, 1), x, y, valid); } diff --git a/core/src/mindustry/world/blocks/production/Drill.java b/core/src/mindustry/world/blocks/production/Drill.java index bfefd96050..4186dca2f7 100644 --- a/core/src/mindustry/world/blocks/production/Drill.java +++ b/core/src/mindustry/world/blocks/production/Drill.java @@ -113,6 +113,8 @@ public class Drill extends Block{ @Override public void drawPlace(int x, int y, int rotation, boolean valid){ + super.drawPlace(x, y, rotation, valid); + Tile tile = world.tile(x, y); if(tile == null) return; diff --git a/core/src/mindustry/world/blocks/production/Pump.java b/core/src/mindustry/world/blocks/production/Pump.java index c31d346c80..692b637428 100644 --- a/core/src/mindustry/world/blocks/production/Pump.java +++ b/core/src/mindustry/world/blocks/production/Pump.java @@ -31,6 +31,8 @@ public class Pump extends LiquidBlock{ @Override public void drawPlace(int x, int y, int rotation, boolean valid){ + super.drawPlace(x, y, rotation, valid); + Tile tile = world.tile(x, y); if(tile == null) return; diff --git a/core/src/mindustry/world/blocks/production/SolidPump.java b/core/src/mindustry/world/blocks/production/SolidPump.java index 78a423dcec..e13090ec4e 100644 --- a/core/src/mindustry/world/blocks/production/SolidPump.java +++ b/core/src/mindustry/world/blocks/production/SolidPump.java @@ -35,6 +35,8 @@ public class SolidPump extends Pump{ @Override public void drawPlace(int x, int y, int rotation, boolean valid){ + drawPotentialLinks(x, y); + if(attribute != null){ drawPlaceText(Core.bundle.formatFloat("bar.efficiency", Math.max(sumAttribute(attribute, x, y) / size / size + baseEfficiency, 0f) * 100 * percentSolid(x, y), 1), x, y, valid); } diff --git a/core/src/mindustry/world/blocks/units/RepairPoint.java b/core/src/mindustry/world/blocks/units/RepairPoint.java index 9833276112..905c1c63f7 100644 --- a/core/src/mindustry/world/blocks/units/RepairPoint.java +++ b/core/src/mindustry/world/blocks/units/RepairPoint.java @@ -56,6 +56,8 @@ public class RepairPoint extends Block{ @Override public void drawPlace(int x, int y, int rotation, boolean valid){ + super.drawPlace(x, y, rotation, valid); + Drawf.dashCircle(x * tilesize + offset, y * tilesize + offset, repairRadius, Pal.accent); } diff --git a/gradle.properties b/gradle.properties index 92097f8f77..cc383fd0f4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=9f916a1b401216c68e39635f6c99769391c8555a +archash=768529cbe1cd450df16f08431e71d6280ddc5f0e