Fix improper treatment of unbreakable blocks
This commit is contained in:
@@ -77,7 +77,7 @@ public class ToolSet implements Helper {
|
||||
|
||||
/**
|
||||
* Calculates how long would it take to mine the specified block given the best tool
|
||||
* in this toolset is used.
|
||||
* in this toolset is used. A negative value is returned if the specified block is unbreakable.
|
||||
*
|
||||
* @param state the blockstate to be mined
|
||||
* @return how long it would take in ticks
|
||||
@@ -87,9 +87,8 @@ public class ToolSet implements Helper {
|
||||
ItemStack contents = player().inventory.getStackInSlot(slot);
|
||||
|
||||
float blockHard = state.getBlockHardness(null, null);
|
||||
if (blockHard < 0) {
|
||||
return 0;
|
||||
}
|
||||
if (blockHard < 0)
|
||||
return -1;
|
||||
|
||||
float speed = contents.getDestroySpeed(state);
|
||||
if (speed > 1) {
|
||||
|
||||
Reference in New Issue
Block a user