AXES_BREAK_LEAVES_INSTANTLY config option

This commit is contained in:
DBotThePony 2023-02-08 23:26:21 +07:00
parent 89609b45f6
commit d56cf36fb9
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 7 additions and 1 deletions

View File

@ -237,6 +237,10 @@ object ServerConfig {
}
}
object Tools {
val AXES_BREAK_LEAVES_INSTANTLY: Boolean by specBuilder.define("AXES_BREAK_LEAVES_INSTANTLY", true)
}
init {
// access instances so spec is built
NanobotsRegeneration
@ -244,6 +248,7 @@ object ServerConfig {
AndroidJumpBoost
AndroidItemMagnet
Shockwave
Tools
specBuilder.pop()

View File

@ -5,10 +5,11 @@ import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Tier
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.material.Material
import ru.dbotthepony.mc.otm.ServerConfig
class MatteryAxeItem(pTier: Tier, pAttackDamageModifier: Float, pAttackSpeedModifier: Float, pProperties: Properties) : AxeItem(pTier, pAttackDamageModifier, pAttackSpeedModifier, pProperties) {
override fun getDestroySpeed(pStack: ItemStack, pState: BlockState): Float {
if (pState.material == Material.LEAVES)
if (pState.material == Material.LEAVES && ServerConfig.Tools.AXES_BREAK_LEAVES_INSTANTLY)
return 64f
return super.getDestroySpeed(pStack, pState)