Silent Gear

Silent Gear

36M Downloads

AoE tools instamine when crouching

TheChosenEvilOne opened this issue ยท 0 comments

commented

Versions

  • Silent Gear: 4.0.29
  • Silent Lib: 10.5.1
  • NeoForge: 21.1.211
  • Modpack: N/A

Expected Behavior

AoE tools not to instantly mine.

Actual Behavior

division by zero (infinity by IEEE754 spec):
https://github.com/SilentChaos512/Silent-Gear/blob/1.21.1/src/main/java/net/silentchaos512/gear/util/IAoeTool.java#L144
https://github.com/SilentChaos512/Silent-Gear/blob/1.21.1/src/main/java/net/silentchaos512/gear/util/IAoeTool.java#L133
https://github.com/SilentChaos512/Silent-Gear/blob/1.21.1/src/main/java/net/silentchaos512/gear/util/IAoeTool.java#L144
maxHardness is set to zero by default and getExtraBlocks defaults empty list by default when crouching, because targetBlockHardness is not 0 setNewSpeed gets called with whatever float divided by zero.

A simple fix would be to check if maxHardness is larger than targetBlockHardness, rather than checking that they aren't equal.

Steps to Reproduce the Problem

  1. Take any AoE tool
  2. Hold shift
  3. Click block