mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 14:38:45 +00:00
Beautiful application of formatting, Thank's @mbax!
This commit is contained in:
1 parent
b1e4f0505f
commit
c59d93b0a7
2 files changed
+14
-14
No files matched your search
@@ -180,11 +180,11 @@ public class PlayerListener extends EventListener
|
|||||||
/* Interactions Check */
|
/* Interactions Check */
|
||||||
|
|
||||||
Block block = event.getClickedBlock();
|
Block block = event.getClickedBlock();
|
||||||
if(block != null)
|
if (block != null)
|
||||||
{
|
{
|
||||||
if(checkManager.willCheck(player, CheckType.VISUAL))
|
if (checkManager.willCheck(player, CheckType.VISUAL))
|
||||||
{
|
{
|
||||||
if(backend.checkInteraction(player, block, playerClick))
|
if (backend.checkInteraction(player, block, playerClick))
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
log("tried to interact with an object that they couldn't see", player, CheckType.VISUAL); //boring description though.
|
log("tried to interact with an object that they couldn't see", player, CheckType.VISUAL); //boring description though.
|
||||||
|
|||||||
@@ -276,20 +276,20 @@ public class Backend
|
|||||||
|
|
||||||
public boolean checkInteraction(Player player, Block targetBlock, Block playerClick)
|
public boolean checkInteraction(Player player, Block targetBlock, Block playerClick)
|
||||||
{
|
{
|
||||||
int strikes = 0;
|
int strikes = 0;
|
||||||
|
|
||||||
double x = targetBlock.getX() - playerClick.getX() * ((targetBlock.getX() - playerClick.getX() * 1) < 0 ? -1 : 1);
|
double x = targetBlock.getX() - playerClick.getX() * ((targetBlock.getX() - playerClick.getX() * 1) < 0 ? -1 : 1);
|
||||||
double y = targetBlock.getY() - playerClick.getY() * ((targetBlock.getY() - playerClick.getY() * 1) < 0 ? -1 : 1);
|
double y = targetBlock.getY() - playerClick.getY() * ((targetBlock.getY() - playerClick.getY() * 1) < 0 ? -1 : 1);
|
||||||
double z = targetBlock.getZ() - playerClick.getZ() * ((targetBlock.getZ() - playerClick.getZ() * 1) < 0 ? -1 : 1);
|
double z = targetBlock.getZ() - playerClick.getZ() * ((targetBlock.getZ() - playerClick.getZ() * 1) < 0 ? -1 : 1);
|
||||||
|
|
||||||
player.sendMessage("X: " + x + " Y: " + y + " Z: " + z);
|
if (x >= VISUALS_MAXOFFSET)
|
||||||
|
strikes++;
|
||||||
|
if (y >= VISUALS_MAXOFFSET)
|
||||||
|
strikes++;
|
||||||
|
if (z >= VISUALS_MAXOFFSET)
|
||||||
|
strikes++;
|
||||||
|
|
||||||
if (x >= VISUALS_MAXOFFSET) strikes++;
|
return strikes > 0;
|
||||||
if (y >= VISUALS_MAXOFFSET) strikes++;
|
|
||||||
if (z >= VISUALS_MAXOFFSET) strikes++;
|
|
||||||
|
|
||||||
|
|
||||||
return strikes > 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkWaterWalk(Player player, double x, double z)
|
public boolean checkWaterWalk(Player player, double x, double z)
|
||||||
|
|||||||
Reference in new issue
Block a user