From 7ed243a8087a3852633668d7c53063a8bacb7d40 Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 18 Jul 2025 18:16:06 -0400 Subject: [PATCH] let's not do that --- core/src/mindustry/world/Block.java | 4 ---- core/src/mindustry/world/Build.java | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index 33ada2e966..ae73e23450 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -701,10 +701,6 @@ public class Block extends UnlockableContent implements Senseable{ return liquidFilter[liq.id]; } - public boolean canReplace(Tile tile, Block other){ - return canReplace(other); - } - public boolean canReplace(Block other){ if(other.alwaysReplace) return true; if(other.privileged) return false; diff --git a/core/src/mindustry/world/Build.java b/core/src/mindustry/world/Build.java index 402684dde6..6948e6910e 100644 --- a/core/src/mindustry/world/Build.java +++ b/core/src/mindustry/world/Build.java @@ -216,7 +216,7 @@ public class Build{ //floors have different checks if(type.isFloor()){ - return type.isOverlay() ? type.canReplace(tile, tile.overlay()) : type.canReplace(tile, tile.floor()); + return type.isOverlay() ? tile.overlay() != type : tile.floor() != type; } //campaign darkness check @@ -247,7 +247,7 @@ public class Build{ !check.floor().placeableOn && !type.ignoreBuildDarkness || //solid floor //when you have a payload, you cannot place blocks on things, even if normal placement rules allow it. this is a hack that assumes checkVisible = true means it's coming from a payload (!checkVisible && checkCoreRadius && !check.block().alwaysReplace) || //replacing a block that should be replaced (e.g. payload placement) - !(((type.canReplace(check, check.block()) || (check.build != null && check.build.canBeReplaced(type)) || (type == check.block && team != Team.derelict && state.rules.derelictRepair && check.team() == Team.derelict)) || //can replace type OR can replace derelict block of same type + !(((type.canReplace(check.block()) || (check.build != null && check.build.canBeReplaced(type)) || (type == check.block && team != Team.derelict && state.rules.derelictRepair && check.team() == Team.derelict)) || //can replace type OR can replace derelict block of same type (check.build instanceof ConstructBuild build && build.current == type && check.centerX() == tile.x && check.centerY() == tile.y)) && //same type in construction type.bounds(tile.x, tile.y, Tmp.r1).grow(0.01f).contains(check.block.bounds(check.centerX(), check.centerY(), Tmp.r2))) || //no replacement (type.requiresWater && check.floor().liquidDrop != Liquids.water) //requires water but none found