mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 06:28:52 +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
+10
-1
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;
|
||||||
@@ -64,6 +65,8 @@ public class BlockListener implements Listener {
|
|||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
if(player != null)
|
if(player != null)
|
||||||
|
{
|
||||||
|
if(block.getType() != Material.LADDER)
|
||||||
{
|
{
|
||||||
//Check if the player can see the block they are placing
|
//Check if the player can see the block they are placing
|
||||||
//This is mostly used for preventing build/autobuild hacks (Logic not yet finished)
|
//This is mostly used for preventing build/autobuild hacks (Logic not yet finished)
|
||||||
@@ -74,6 +77,7 @@ public class BlockListener implements Listener {
|
|||||||
plugin.log(player.getName()+" tried to place a block that they couldn't see!");
|
plugin.log(player.getName()+" tried to place a block that they couldn't see!");
|
||||||
event.setCancelled(true);
|
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());
|
||||||
if(c.getXDifference() > 6.0D || c.getZDifference() > 6.0D || c.getYDifference() > 6.0D)
|
if(c.getXDifference() > 6.0D || c.getZDifference() > 6.0D || c.getYDifference() > 6.0D)
|
||||||
|
|||||||
@@ -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)
|
||||||
@@ -274,6 +274,11 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//No change in Y
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user