Skip to content

Commit

Permalink
Fix #430
Browse files Browse the repository at this point in the history
  • Loading branch information
NichtStudioCode committed Aug 21, 2024
1 parent b0d1e89 commit 387cfa6
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import net.minecraft.core.HolderSet
import net.minecraft.core.component.DataComponents
import net.minecraft.tags.BlockTags
import net.minecraft.tags.TagKey
import net.minecraft.world.item.SwordItem
import net.minecraft.world.level.block.state.pattern.BlockInWorld
import org.bukkit.GameMode
import org.bukkit.Material
Expand All @@ -19,6 +20,7 @@ import org.bukkit.potion.PotionEffectType
import xyz.xenondevs.commons.collections.takeUnlessEmpty
import xyz.xenondevs.nova.util.eyeInWater
import xyz.xenondevs.nova.util.hardness
import xyz.xenondevs.nova.util.nmsItem
import xyz.xenondevs.nova.util.nmsState
import xyz.xenondevs.nova.util.novaBlock
import xyz.xenondevs.nova.util.roundToDecimalPlaces
Expand Down Expand Up @@ -94,6 +96,11 @@ object ToolUtils {
else -> Unit
}

// hardcoded in BambooSaplingBlock and BambooStalkBlock, ignores block break speed attribute
// https://bugs.mojang.com/browse/MC-275705
if ((block.type == Material.BAMBOO || block.type == Material.BAMBOO_SAPLING) && tool?.type?.nmsItem is SwordItem)
return 1.0

var damage = calculateDamage(
hardness = block.hardness,
correctForDrops = isCorrectToolForDrops(block, tool),
Expand Down

0 comments on commit 387cfa6

Please sign in to comment.