mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
This commit is contained in:
1 parent
c59d93b0a7
commit
68acc41398
2 files changed
+19
No files matched your search
@@ -189,6 +189,10 @@ public class PlayerListener extends EventListener
|
||||
event.setCancelled(true);
|
||||
log("tried to interact with an object that they couldn't see", player, CheckType.VISUAL); //boring description though.
|
||||
}
|
||||
else
|
||||
{
|
||||
backend.logInteraction(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ public class Backend
|
||||
private static final int FASTPLACE_MAXVIOLATIONTIME = 10000;
|
||||
|
||||
private static final double VISUALS_MAXOFFSET = 2;
|
||||
private static final long VISUALS_DELAY = 20L;
|
||||
|
||||
private static final int BLOCK_PUNCH_MIN = 5;
|
||||
|
||||
@@ -128,6 +129,7 @@ public class Backend
|
||||
private List<String> isAscending = new ArrayList<String>();
|
||||
private List<String> trackingProjectiles = new ArrayList<String>();
|
||||
private List<String> velocitizing = new ArrayList<String>();
|
||||
private List<String> interacting = new ArrayList<String>();
|
||||
private Map<String, Integer> ascensionCount = new HashMap<String, Integer>();
|
||||
private Map<String, String> oldMessage = new HashMap<String, String>();
|
||||
private Map<String, String> lastMessage = new HashMap<String, String>();
|
||||
@@ -276,6 +278,9 @@ public class Backend
|
||||
|
||||
public boolean checkInteraction(Player player, Block targetBlock, Block playerClick)
|
||||
{
|
||||
if (isInteracting(player) && !Utilities.isInteractable(targetBlock.getType()))
|
||||
return false;
|
||||
|
||||
int strikes = 0;
|
||||
|
||||
double x = targetBlock.getX() - playerClick.getX() * ((targetBlock.getX() - playerClick.getX() * 1) < 0 ? -1 : 1);
|
||||
@@ -700,6 +705,16 @@ public class Backend
|
||||
logEvent(healed, player, HEAL_MIN);
|
||||
}
|
||||
|
||||
public void logInteraction(Player player)
|
||||
{
|
||||
logEvent(interacting, player, VISUALS_DELAY);
|
||||
}
|
||||
|
||||
public boolean isInteracting(Player player)
|
||||
{
|
||||
return interacting.contains(player.getName());
|
||||
}
|
||||
|
||||
public boolean justHealed(Player player)
|
||||
{
|
||||
return healed.contains(player.getName());
|
||||
|
||||
Reference in new issue
Block a user