Ignore ladder placing for now, they seem to be causing issues

This commit is contained in:
Adam committed 2012-04-26 23:31:04 -04:00
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.checks.EyeCheck;
import net.h31ix.anticheat.checks.LengthCheck;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@@ -65,14 +66,17 @@ public class BlockListener implements Listener {
Block block = event.getBlock();
if(player != null)
{
//Check if the player can see the block they are placing
//This is mostly used for preventing build/autobuild hacks (Logic not yet finished)
if(!e.canSee(player, block) && !player.getWorld().getBlockAt(player.getLocation()).isLiquid())
if(block.getType() != Material.LADDER)
{
//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);
//Check if the player can see the block they are placing
//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?
//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?
LengthCheck c = new LengthCheck(block.getLocation(),event.getPlayer().getLocation());
@@ -259,7 +259,7 @@ public class PlayerListener implements Listener {
}
}
//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.
if(player.getGameMode() != GameMode.CREATIVE && player.getVehicle() == null)
@@ -273,7 +273,12 @@ public class PlayerListener implements Listener {
tracker.increaseLevel(player);
}
}
}
}
//No change in Y
else
{
}
}
}
}