From d766d8c1a5cefe535f20184e387198429e67461f Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 22 Sep 2014 05:14:44 +1200 Subject: [PATCH] Fixed setSleeping a ltitle --- .../disguisetypes/watchers/PlayerWatcher.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/PlayerWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/PlayerWatcher.java index d5ae3b28..c17adb50 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/PlayerWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/PlayerWatcher.java @@ -34,6 +34,14 @@ public class PlayerWatcher extends LivingWatcher { } public BlockFace getSleepingDirection() { + if (sleepingDirection == null) { + if (this.getDisguise().getEntity() != null && isSleeping()) { + this.sleepingDirection = BlockFace.values()[Math + .round(this.getDisguise().getEntity().getLocation().getYaw() / 90F) & 0x3]; + } else { + return BlockFace.EAST; + } + } return sleepingDirection; } @@ -77,13 +85,6 @@ public class PlayerWatcher extends LivingWatcher { public void setSleeping(boolean sleeping, BlockFace sleepingDirection) { if (sleepingDirection != null) { this.sleepingDirection = BlockFace.values()[sleepingDirection.ordinal() % 4]; - } else if (sleeping) { - if (this.getDisguise().getEntity() != null) { - this.sleepingDirection = BlockFace.values()[Math - .round(this.getDisguise().getEntity().getLocation().getYaw() / 90F) & 0x3]; - } else { - this.sleepingDirection = BlockFace.EAST; - } } if (sleeping != isSleeping()) { isInBed = sleeping;