diff --git a/src/main/java/net/h31ix/anticheat/event/BlockListener.java b/src/main/java/net/h31ix/anticheat/event/BlockListener.java index 7380758..e2b00cc 100644 --- a/src/main/java/net/h31ix/anticheat/event/BlockListener.java +++ b/src/main/java/net/h31ix/anticheat/event/BlockListener.java @@ -75,7 +75,7 @@ public class BlockListener extends EventListener { final Block block = event.getBlock(); boolean noHack = true; if (player != null) { - if (checkManager.willCheck(player, CheckType.FAST_BREAK) && !backend.isInstantBreakExempt(player) && backend.checkFastBreak(player, block)) { + if (checkManager.willCheck(player, CheckType.FAST_BREAK) && backend.checkFastBreak(player, block)) { event.setCancelled(!config.silentMode()); log("tried to break a block of " + block.getType().name() + " too fast.", player, CheckType.FAST_BREAK); noHack = false; diff --git a/src/main/java/net/h31ix/anticheat/util/BlockHardness.java b/src/main/java/net/h31ix/anticheat/util/BlockHardness.java index 7342c9a..fe37f91 100644 --- a/src/main/java/net/h31ix/anticheat/util/BlockHardness.java +++ b/src/main/java/net/h31ix/anticheat/util/BlockHardness.java @@ -1,3 +1,21 @@ +/* + * AntiCheat for Bukkit. + * Copyright (C) 2012 AntiCheat Team | http://gravitydevelopment.net + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package net.h31ix.anticheat.util; import org.bukkit.Material; diff --git a/src/main/java/net/h31ix/anticheat/util/ToolHardness.java b/src/main/java/net/h31ix/anticheat/util/ToolHardness.java index 1a3c6e1..109a05b 100644 --- a/src/main/java/net/h31ix/anticheat/util/ToolHardness.java +++ b/src/main/java/net/h31ix/anticheat/util/ToolHardness.java @@ -1,3 +1,21 @@ +/* + * AntiCheat for Bukkit. + * Copyright (C) 2012 AntiCheat Team | http://gravitydevelopment.net + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package net.h31ix.anticheat.util; import org.bukkit.Material; diff --git a/src/main/java/net/h31ix/anticheat/util/Utilities.java b/src/main/java/net/h31ix/anticheat/util/Utilities.java index 357e718..fd154a0 100644 --- a/src/main/java/net/h31ix/anticheat/util/Utilities.java +++ b/src/main/java/net/h31ix/anticheat/util/Utilities.java @@ -26,8 +26,10 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; +import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffectType; import org.bukkit.util.NumberConversions; public final class Utilities { @@ -182,10 +184,15 @@ public final class Utilities { public static long calcSurvivalFastBreak(ItemStack tool, Material block) { double bhardness = BlockHardness.getBlockHardness(block); double thardness = ToolHardness.getToolHardness(tool.getType()); + long enchantlvl = (long) tool.getEnchantmentLevel(Enchantment.DIG_SPEED); long result = (long) ((long) Math.round((bhardness * thardness) * 0.10 * 10000)); + result += 150; + if (enchantlvl > 0) + result /= enchantlvl * enchantlvl + 1L; + if (result > 25000) result = 25000; else if (result < 0) result = 0;