mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-12-16 15:38:14 +01:00
Fixed setSleeping a ltitle
This commit is contained in:
parent
286a1bde89
commit
d766d8c1a5
@ -34,6 +34,14 @@ public class PlayerWatcher extends LivingWatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BlockFace getSleepingDirection() {
|
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;
|
return sleepingDirection;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,13 +85,6 @@ public class PlayerWatcher extends LivingWatcher {
|
|||||||
public void setSleeping(boolean sleeping, BlockFace sleepingDirection) {
|
public void setSleeping(boolean sleeping, BlockFace sleepingDirection) {
|
||||||
if (sleepingDirection != null) {
|
if (sleepingDirection != null) {
|
||||||
this.sleepingDirection = BlockFace.values()[sleepingDirection.ordinal() % 4];
|
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()) {
|
if (sleeping != isSleeping()) {
|
||||||
isInBed = sleeping;
|
isInBed = sleeping;
|
||||||
|
Loading…
Reference in New Issue
Block a user