diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/ServerConfig.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/ServerConfig.kt index e096700d2..44c4018cc 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/ServerConfig.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/ServerConfig.kt @@ -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() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/MatteryAxeItem.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/MatteryAxeItem.kt index b55940d8a..a2de91551 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/MatteryAxeItem.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/MatteryAxeItem.kt @@ -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)