From 53214f0ddc4a02ea263fa082fccce60147b66caf Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Fri, 23 Jul 2021 15:51:26 -0400 Subject: [PATCH] Enable mining of sand when double click to mine is enabled (#4788) * Sand mineable with double click to mine enabled Since the only reason sand is un-mineable in the first place is because accidentally mining it is annoying, it should be enabled for double click to mine. * only show sand as mineable when double click mine is enabled Co-authored-by: Anuken --- core/src/mindustry/input/InputHandler.java | 2 +- core/src/mindustry/type/UnitType.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index 0882c39dea..bc385af592 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -1027,7 +1027,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ return !Core.scene.hasMouse() && tile.drop() != null && player.unit().validMine(tile) - && !(tile.floor().playerUnmineable && tile.overlay().itemDrop == null) + && !((!Core.settings.getBool("doubletapmine") && tile.floor().playerUnmineable) && tile.overlay().itemDrop == null) && player.unit().acceptsItem(tile.drop()) && tile.block() == Blocks.air; } diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 7e0b55ce65..da238f0584 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -279,7 +279,7 @@ public class UnitType extends UnlockableContent{ if(mineTier >= 1){ stats.addPercent(Stat.mineSpeed, mineSpeed); - stats.add(Stat.mineTier, StatValues.blocks(b -> b instanceof Floor f && f.itemDrop != null && f.itemDrop.hardness <= mineTier && !f.playerUnmineable)); + stats.add(Stat.mineTier, StatValues.blocks(b -> b instanceof Floor f && f.itemDrop != null && f.itemDrop.hardness <= mineTier && (!f.playerUnmineable || Core.settings.getBool("doubletapmine")))); } if(buildSpeed > 0){ stats.addPercent(Stat.buildSpeed, buildSpeed);