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 <arnukren@gmail.com>
This commit is contained in:
buthed010203 2021-07-23 15:51:26 -04:00 committed by GitHub
parent d89a1fac70
commit 53214f0ddc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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;
}

View file

@ -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);