mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 22:16:03 +00:00
Added Visual check (via @SuperSpyTX), fixes issue #26
This commit is contained in:
1 parent
77c8b57afb
commit
bb7b43afdb
7 files changed
+23
-26
No files matched your search
@@ -177,19 +177,18 @@ public class PlayerListener extends EventListener
|
||||
}
|
||||
|
||||
/* Interactions Check */
|
||||
//TODO: Extend this into block place/break and if working, change to visuals check.
|
||||
|
||||
Block block = event.getClickedBlock();
|
||||
if(block != null) {
|
||||
if(checkManager.willCheck(player, CheckType.INTERACTION) && Utilities.isInteractable(block.getType()))
|
||||
{
|
||||
// save load and actually call the backend check here.
|
||||
if(backend.checkInteraction(player, block))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
log("tried to interact with an object that couldn't see", player, CheckType.INTERACTION); //boring description though.
|
||||
}
|
||||
}
|
||||
if(block != null)
|
||||
{
|
||||
if(checkManager.willCheck(player, CheckType.VISUAL) && Utilities.isInteractable(block.getType()))
|
||||
{
|
||||
if(backend.checkInteraction(player, block))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
log("tried to interact with an object that they couldn't see", player, CheckType.VISUAL); //boring description though.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user