mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-04 14:38:47 +00:00
Fix for false-positive flyhack detection.
This commit is contained in:
1 parent
ee90cede65
commit
721c618b26
2 files changed
+44
-19
No files matched your search
@@ -323,24 +323,6 @@ public class PlayerListener implements Listener {
|
|||||||
if(!player.hasPermission("anticheat.flyhack") && !player.isFlying() && player.getVehicle() == null)
|
if(!player.hasPermission("anticheat.flyhack") && !player.isFlying() && player.getVehicle() == null)
|
||||||
{
|
{
|
||||||
Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
|
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)))
|
|
||||||
{
|
|
||||||
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(!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))
|
||||||
@@ -359,7 +341,6 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canStand(Block block)
|
public boolean canStand(Block block)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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