mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 22:16:03 +00:00
Ignore ladder placing for now, they seem to be causing issues
This commit is contained in:
1 parent
cb95833da5
commit
b1d37ecdfd
2 files changed
+18
-9
No files matched your search
@@ -5,6 +5,7 @@ import net.h31ix.anticheat.Anticheat;
|
|||||||
import net.h31ix.anticheat.PlayerTracker;
|
import net.h31ix.anticheat.PlayerTracker;
|
||||||
import net.h31ix.anticheat.checks.EyeCheck;
|
import net.h31ix.anticheat.checks.EyeCheck;
|
||||||
import net.h31ix.anticheat.checks.LengthCheck;
|
import net.h31ix.anticheat.checks.LengthCheck;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@@ -65,14 +66,17 @@ public class BlockListener implements Listener {
|
|||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
if(player != null)
|
if(player != null)
|
||||||
{
|
{
|
||||||
//Check if the player can see the block they are placing
|
if(block.getType() != Material.LADDER)
|
||||||
//This is mostly used for preventing build/autobuild hacks (Logic not yet finished)
|
|
||||||
if(!e.canSee(player, block) && !player.getWorld().getBlockAt(player.getLocation()).isLiquid())
|
|
||||||
{
|
{
|
||||||
//TODO: this is causing false alerts. Re-work the vision logic?
|
//Check if the player can see the block they are placing
|
||||||
//tracker.increaseLevel(player);
|
//This is mostly used for preventing build/autobuild hacks (Logic not yet finished)
|
||||||
plugin.log(player.getName()+" tried to place a block that they couldn't see!");
|
if(!e.canSee(player, block) && !player.getWorld().getBlockAt(player.getLocation()).isLiquid())
|
||||||
event.setCancelled(true);
|
{
|
||||||
|
//TODO: this is causing false alerts. Re-work the vision logic?
|
||||||
|
//tracker.increaseLevel(player);
|
||||||
|
plugin.log(player.getName()+" tried to place a block that they couldn't see!");
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//Is the player too far away?
|
//Is the player too far away?
|
||||||
LengthCheck c = new LengthCheck(block.getLocation(),event.getPlayer().getLocation());
|
LengthCheck c = new LengthCheck(block.getLocation(),event.getPlayer().getLocation());
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//If they are falling
|
//If they are falling
|
||||||
if(event.getFrom().getY() > event.getTo().getY())
|
else if(event.getFrom().getY() > event.getTo().getY())
|
||||||
{
|
{
|
||||||
//Ignore players in creative or in vehicles, they give a fall distance of 0 naturally.
|
//Ignore players in creative or in vehicles, they give a fall distance of 0 naturally.
|
||||||
if(player.getGameMode() != GameMode.CREATIVE && player.getVehicle() == null)
|
if(player.getGameMode() != GameMode.CREATIVE && player.getVehicle() == null)
|
||||||
@@ -273,7 +273,12 @@ public class PlayerListener implements Listener {
|
|||||||
tracker.increaseLevel(player);
|
tracker.increaseLevel(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//No change in Y
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user