From 000c660802b5e2e412a2241f89d4b81b7a7a5e25 Mon Sep 17 00:00:00 2001 From: qodshai <431403052@qq.com> Date: Wed, 8 Oct 2025 16:24:14 +0800 Subject: [PATCH] Move tile display condition check into Tile#displayable --- core/src/mindustry/ui/fragments/PlacementFragment.java | 3 +-- core/src/mindustry/world/Tile.java | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/ui/fragments/PlacementFragment.java b/core/src/mindustry/ui/fragments/PlacementFragment.java index eb8baf410b..495a6aaf55 100644 --- a/core/src/mindustry/ui/fragments/PlacementFragment.java +++ b/core/src/mindustry/ui/fragments/PlacementFragment.java @@ -774,8 +774,7 @@ public class PlacementFragment{ return nextFlowBuild = hoverTile.build; } - //if the tile has a drop, display the drop - if((hoverTile.drop() != null && hoverTile.block() == Blocks.air) || hoverTile.wallDrop() != null || hoverTile.floor().liquidDrop != null){ + if(hoverTile.displayable()){ return hoverTile; } } diff --git a/core/src/mindustry/world/Tile.java b/core/src/mindustry/world/Tile.java index 2ab4a4ab73..5ddcc90b43 100644 --- a/core/src/mindustry/world/Tile.java +++ b/core/src/mindustry/world/Tile.java @@ -696,6 +696,12 @@ public class Tile implements Position, QuadTreeObject, Displayable{ overlayData = PackedTileData.overlayData(packed); } + @Override + public boolean displayable(){ + //if the tile has a drop, display the drop + return (drop() != null && block == Blocks.air) || wallDrop() != null || floor.liquidDrop != null; + } + @Override public void display(Table table){