diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 30c58e23b1..4eec090d97 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1585,7 +1585,7 @@ lenum.sin = Sine, in degrees. lenum.cos = Cosine, in degrees. lenum.tan = Tangent, in degrees. #not a typo, look up 'range notation' -lenum.rand = Random number in range [0, value). +lenum.rand = Random decimal in range [0, value). lenum.log = Natural logarithm (ln). lenum.log10 = Base 10 logarithm. lenum.noise = 2D simplex noise. diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 638353b982..c4731befe9 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -859,6 +859,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ req.animScale = 1f; lineRequests.add(req); }); + block.handlePlacementLine(lineRequests); if(Core.settings.getBool("blockreplace")){ lineRequests.each(req -> { diff --git a/core/src/mindustry/input/Placement.java b/core/src/mindustry/input/Placement.java index 85d14f2416..bc17d9eb97 100644 --- a/core/src/mindustry/input/Placement.java +++ b/core/src/mindustry/input/Placement.java @@ -12,16 +12,16 @@ import mindustry.world.blocks.distribution.*; import static mindustry.Vars.*; public class Placement{ - private final static Seq tmpPoints = new Seq<>(), tmpPoints2 = new Seq<>(); + private static final Seq tmpPoints = new Seq<>(), tmpPoints2 = new Seq<>(); private static final NormalizeResult result = new NormalizeResult(); private static final NormalizeDrawResult drawResult = new NormalizeDrawResult(); - private static Bresenham2 bres = new Bresenham2(); - private static Seq points = new Seq<>(); + private static final Bresenham2 bres = new Bresenham2(); + private static final Seq points = new Seq<>(); //for pathfinding - private static IntFloatMap costs = new IntFloatMap(); - private static IntIntMap parents = new IntIntMap(); - private static IntSet closed = new IntSet(); + private static final IntFloatMap costs = new IntFloatMap(); + private static final IntIntMap parents = new IntIntMap(); + private static final IntSet closed = new IntSet(); /** Normalize a diagonal line into points. */ public static Seq pathfindLine(boolean conveyors, int startX, int startY, int endX, int endY){ diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 17f86f69b7..66f64c5e4a 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -403,6 +403,11 @@ public class Block extends UnlockableContent{ } + /** Mutates the given list of requests used during line placement. */ + public void handlePlacementLine(Seq plans){ + + } + public Object nextConfig(){ if(saveConfig && lastConfig != null){ return lastConfig; diff --git a/core/src/mindustry/world/blocks/distribution/ItemBridge.java b/core/src/mindustry/world/blocks/distribution/ItemBridge.java index 2ab0c9b047..8d4b952038 100644 --- a/core/src/mindustry/world/blocks/distribution/ItemBridge.java +++ b/core/src/mindustry/world/blocks/distribution/ItemBridge.java @@ -176,11 +176,11 @@ public class ItemBridge extends Block{ public void playerPlaced(Object config){ super.playerPlaced(config); - if(config != null) return; - - Tile link = findLink(tile.x, tile.y); - if(linkValid(tile, link) && !proximity.contains(link.build)){ - link.build.configure(tile.pos()); + if(config == null){ + Tile link = findLink(tile.x, tile.y); + if(linkValid(tile, link) && !proximity.contains(link.build)){ + link.build.configure(tile.pos()); + } } lastBuild = this;