mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Fastbreak fix
This commit is contained in:
1 parent
cea645b3c5
commit
5f9c8a0fd1
2 files changed
+7
-5
No files matched your search
@@ -4,6 +4,7 @@ import net.h31ix.anticheat.Anticheat;
|
||||
import net.h31ix.anticheat.PlayerTracker;
|
||||
import net.h31ix.anticheat.checks.*;
|
||||
import net.h31ix.anticheat.manage.*;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
@@ -65,7 +66,7 @@ public class BlockListener implements Listener {
|
||||
tracker.decreaseLevel(player);
|
||||
}
|
||||
}
|
||||
if (!player.hasPermission("anticheat.fastbreak"))
|
||||
if (!player.hasPermission("anticheat.fastbreak") && player.getGameMode() != GameMode.CREATIVE)
|
||||
{
|
||||
if(!player.getInventory().getItemInHand().containsEnchantment(Enchantment.DIG_SPEED))
|
||||
{
|
||||
@@ -88,6 +89,7 @@ public class BlockListener implements Listener {
|
||||
&& block.getType() != Material.DIODE_BLOCK_ON
|
||||
&& block.getType() != Material.SAPLING
|
||||
&& block.getType() != Material.TORCH
|
||||
&& block.getType() != Material.TNT
|
||||
&& block.getType() != Material.SNOW)
|
||||
{
|
||||
if (!blm.justBroke(player))
|
||||
@@ -96,7 +98,7 @@ public class BlockListener implements Listener {
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin.log(player.getName() + " tried to break a block too fast!");
|
||||
plugin.log(player.getName() + " tried to break a block too fast! Block: "+block.getType().name());
|
||||
tracker.increaseLevel(player, 2);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@@ -121,7 +123,7 @@ public class BlockListener implements Listener {
|
||||
if(block.getType() != Material.LADDER && !e.canSee(player, block) && !player.getWorld().getBlockAt(player.getLocation()).isLiquid())
|
||||
{
|
||||
plugin.log(player.getName()+" tried to place a block that they couldn't see!");
|
||||
event.setCancelled(true);
|
||||
//event.setCancelled(true);
|
||||
}
|
||||
if(!player.hasPermission("anticheat.longreach"))
|
||||
{
|
||||
@@ -146,7 +148,7 @@ public class BlockListener implements Listener {
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin.log(player.getName() + " tried to place a block too fast!");
|
||||
plugin.log(player.getName() + " tried to place a block too fast! Block: "+block.getType().name());
|
||||
tracker.increaseLevel(player, 2);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ public class PlayerListener implements Listener {
|
||||
//No change in Y
|
||||
else
|
||||
{
|
||||
if(!player.hasPermission("anticheat.flyhack") && !player.isFlying() && player.getVehicle() == null)
|
||||
if(!player.hasPermission("anticheat.flyhack") && !player.hasPermission("anticheat.zombe.fly") && !player.isFlying() && player.getVehicle() == null)
|
||||
{
|
||||
Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
|
||||
if(!canStand(block) && !canStand(block.getRelative(BlockFace.NORTH)) && !canStand(block.getRelative(BlockFace.EAST)) && !canStand(block.getRelative(BlockFace.SOUTH)) && !canStand(block.getRelative(BlockFace.WEST)) && !canStand(block.getRelative(BlockFace.NORTH_WEST)) && !canStand(block.getRelative(BlockFace.NORTH_EAST)) && !canStand(block.getRelative(BlockFace.SOUTH_WEST)) && !canStand(block.getRelative(BlockFace.SOUTH_EAST)))
|
||||
|
||||
Reference in new issue
Block a user