From ec1afdfdc48d1c30abcbae217a9792ab5689fc07 Mon Sep 17 00:00:00 2001 From: Sunny Kim <58885089+sk7725@users.noreply.github.com> Date: Sun, 22 Aug 2021 00:29:16 +0900 Subject: [PATCH] Hidden blocks only in the Placement UI (#5806) * placeablePlayer * placeablePlayer unlocked --- core/src/mindustry/ui/fragments/PlacementFragment.java | 2 +- core/src/mindustry/world/Block.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/ui/fragments/PlacementFragment.java b/core/src/mindustry/ui/fragments/PlacementFragment.java index 04684a2b70..f63ed7b45b 100644 --- a/core/src/mindustry/ui/fragments/PlacementFragment.java +++ b/core/src/mindustry/ui/fragments/PlacementFragment.java @@ -443,7 +443,7 @@ public class PlacementFragment extends Fragment{ } boolean unlocked(Block block){ - return block.unlockedNow(); + return block.unlockedNow() && block.placeablePlayer; } boolean hasInfoBox(){ diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index d6e7605f76..37595ee0d6 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -100,6 +100,8 @@ public class Block extends UnlockableContent{ public boolean requiresWater = false; /** whether this block can be placed on any liquids, anywhere */ public boolean placeableLiquid = false; + /** whether this block can be placed directly by the player via PlacementFragment */ + public boolean placeablePlayer = true; /** whether this floor can be placed on. */ public boolean placeableOn = true; /** whether this block has insulating properties. */