mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Fixed instant break false-positive
This commit is contained in:
1 parent
5b0d53c01e
commit
0a6ac986b0
2 files changed
+4
-4
No files matched your search
@@ -76,7 +76,7 @@ public class BlockListener extends EventListener
|
||||
{
|
||||
if(checkManager.willCheck(player, CheckType.NO_SWING))
|
||||
{
|
||||
if(backend.checkSwing(player))
|
||||
if(backend.checkSwing(player,block))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
log("tried to break a block of "+block.getType().name()+" without swinging their arm.",player,CheckType.NO_SWING);
|
||||
@@ -106,7 +106,7 @@ public class BlockListener extends EventListener
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
backend.checkSwing(player);
|
||||
backend.checkSwing(player,block);
|
||||
}
|
||||
}, 2L);
|
||||
}
|
||||
|
||||
@@ -384,9 +384,9 @@ public class Backend
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean checkSwing(Player player)
|
||||
public boolean checkSwing(Player player, Block block)
|
||||
{
|
||||
return !player.getInventory().getItemInHand().containsEnchantment(Enchantment.DIG_SPEED) && !justAnimated(player);
|
||||
return !player.getInventory().getItemInHand().containsEnchantment(Enchantment.DIG_SPEED) && !Utilities.isInstantBreak(block.getType()) && !justAnimated(player);
|
||||
}
|
||||
|
||||
public boolean checkFastBreak(Player player, Block block)
|
||||
|
||||
Reference in new issue
Block a user