Skip to content

Commit

Permalink
Fix tag player.location
Browse files Browse the repository at this point in the history
(That bug is no longer valid!)
  • Loading branch information
mcmonkey4eva committed Sep 15, 2013
1 parent 4fc51bf commit 30687b6
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/main/java/net/aufdemrand/denizen/objects/dEntity.java
Expand Up @@ -916,21 +916,8 @@ public String getAttribute(Attribute attribute) {
// Returns the dLocation of the entity.
// -->
if (attribute.startsWith("location")) {

if (entity instanceof Player) {
// Important for player yaw and direction!
//
// A player's true yaw is always 90 less than the one given by
// Bukkit's location.getYaw(), so correct it here

dLocation location = new dLocation(entity.getLocation());
location.setYaw(location.getYaw() - 90);
return location.getAttribute(attribute.fulfill(1));
}
else {
return new dLocation(entity.getLocation())
.getAttribute(attribute.fulfill(1));
}
}

// <--[tag]
Expand Down

1 comment on commit 30687b6

@davidcernat
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your change temporarily broke the <location.facing[<location>]> and <location.direction> tags when used with players.

But you were right that yaw has been changed a bit in Bukkit and yaws were no longer being handled properly in Denizen for non-players. So I corrected that in the Rotation utility class. Thank you for the find.

Please sign in to comment.