Skip to content

Commit

Permalink
Make Chat Trigger stop being completely broken in 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcernat committed Jul 2, 2013
1 parent def298a commit 0848ddb
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -71,8 +71,12 @@ public Boolean call() {
// Should we check 'line of sight'? Players cannot talk to NPCs through walls
// if enabled. Should the Player chat only when looking at the NPC? This may
// reduce accidental chats with NPCs.
if (Settings.ChatMustSeeNPC())
if (!npc.getEntity().hasLineOfSight(event.getPlayer())) return null;

// TODO: CraftBukkit 1.6 broke the two lines below. Think of a workaround.

//if (Settings.ChatMustSeeNPC())
// if (!npc.getEntity().hasLineOfSight(event.getPlayer())) return null;

if (Settings.ChatMustLookAtNPC())
if (!Utilities.isFacingEntity(event.getPlayer(), npc.getEntity(), 45)) return null;

Expand Down

0 comments on commit 0848ddb

Please sign in to comment.