Visuals Check is now bulletproof. Will work on any block interaction. Also improved location checks for visuals.

This commit is contained in:
Super Spy committed 2012-06-12 19:26:28 -05:00
1 parent bb7b43afdb
commit 659d73752c
2 files changed
+17 -16

No files matched your search

@@ -157,6 +157,7 @@ public class PlayerListener extends EventListener
public void onPlayerInteract(PlayerInteractEvent event)
{
Player player = event.getPlayer();
Block playerClick = player.getTargetBlock(null, 5);
PlayerInventory inv = player.getInventory();
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)
{
@@ -181,9 +182,9 @@ public class PlayerListener extends EventListener
Block block = event.getClickedBlock();
if(block != null)
{
if(checkManager.willCheck(player, CheckType.VISUAL) && Utilities.isInteractable(block.getType()))
if(checkManager.willCheck(player, CheckType.VISUAL))
{
if(backend.checkInteraction(player, block))
if(backend.checkInteraction(player, block, playerClick))
{
event.setCancelled(true);
log("tried to interact with an object that they couldn't see", player, CheckType.VISUAL); //boring description though.