mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 14:38:45 +00:00
Fix for false-positive flyhack detection.
This commit is contained in:
1 parent
ee90cede65
commit
721c618b26
2 files changed
+54
-29
No files matched your search
@@ -323,38 +323,19 @@ public class PlayerListener implements Listener {
|
||||
if(!player.hasPermission("anticheat.flyhack") && !player.isFlying() && player.getVehicle() == null)
|
||||
{
|
||||
Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
|
||||
if(!player.isSneaking())
|
||||
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)))
|
||||
{
|
||||
if(!canStand(block) && !canStand(block.getRelative(BlockFace.NORTH)) && !canStand(block.getRelative(BlockFace.EAST)) && !canStand(block.getRelative(BlockFace.SOUTH)) && !canStand(block.getRelative(BlockFace.WEST)))
|
||||
{
|
||||
if (fm.checkFly(player))
|
||||
{
|
||||
event.setTo(event.getFrom().clone());
|
||||
plugin.log(player.getName()+" tried to fly!");
|
||||
tracker.increaseLevel(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
tracker.decreaseLevel(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
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)))
|
||||
if (fm.checkFly(player))
|
||||
{
|
||||
if (fm.checkFly(player))
|
||||
{
|
||||
event.setTo(event.getFrom().clone());
|
||||
plugin.log(player.getName()+" tried to fly!");
|
||||
tracker.increaseLevel(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
tracker.decreaseLevel(player);
|
||||
}
|
||||
event.setTo(event.getFrom().clone());
|
||||
plugin.log(player.getName()+" tried to fly!");
|
||||
tracker.increaseLevel(player);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tracker.decreaseLevel(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package net.h31ix.anticheat.xray;
|
||||
|
||||
/**
|
||||
* THIS CLASS NOT ACTIVE AND IS
|
||||
* IN DEVELOPMENT
|
||||
*/
|
||||
|
||||
import net.minecraft.server.EntityPlayer;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.NetServerHandler;
|
||||
import net.minecraft.server.NetworkManager;
|
||||
import net.minecraft.server.Packet;
|
||||
import net.minecraft.server.Packet51MapChunk;
|
||||
import org.bukkit.Chunk;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
public class NSH extends NetServerHandler {
|
||||
|
||||
public NSH(MinecraftServer server, NetworkManager manager, EntityPlayer player)
|
||||
{
|
||||
super(server,manager,player);
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacket(Packet packet){
|
||||
if(packet instanceof Packet51MapChunk){
|
||||
Packet51MapChunk pack = (Packet51MapChunk) packet;
|
||||
Chunk chunk = player.world.getChunkAt(pack.a,pack.b).bukkitChunk;
|
||||
Block block;
|
||||
for(int i=0;i<16;i++)
|
||||
{
|
||||
for(int i1=0;i1<16;i1++)
|
||||
{
|
||||
for(int i2=256;i2<256;i2++)
|
||||
{
|
||||
block = chunk.getBlock(i, i1, i2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
super.sendPacket(packet);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user