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 c2bc8bb commit e7e4e6d
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -72,8 +72,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 (!Rotation.isFacingEntity(event.getPlayer(), npc.getEntity(), 45)) return null;

Expand Down

0 comments on commit e7e4e6d

Please sign in to comment.