diff --git a/src/PocketMinecraftServer.php b/src/PocketMinecraftServer.php index b29346508..45cf51d47 100644 --- a/src/PocketMinecraftServer.php +++ b/src/PocketMinecraftServer.php @@ -38,7 +38,7 @@ class PocketMinecraftServer{ console("[INFO] \x1b[31;1mThis is a Development version"); } console("[INFO] Starting Minecraft PE Server at ".$this->serverip.":".$this->port); - if($this->port < 19132 or $this->port > 19135){ + if($this->port < 19132 or $this->port > 19135){ //Mojang =( console("[WARNING] You've selected a not-standard port. Normal port range is from 19132 to 19135 included"); } $this->serverID = $this->serverID === false ? Utils::readLong(Utils::getRandomBytes(8, false)):$this->serverID; diff --git a/src/world/Entity.php b/src/world/Entity.php index eed1d8bbb..106d7a967 100644 --- a/src/world/Entity.php +++ b/src/world/Entity.php @@ -321,16 +321,14 @@ class Entity extends stdClass{ if ($rotation < 0) { $rotation += 360.0; } - if(0 <= $rotation && $rotation < 45) { - return 2; - }elseif(45 <= $rotation && $rotation < 135) { - return 3; - }elseif(135 <= $rotation && $rotation < 225) { - return 0; - }elseif(225 <= $rotation && $rotation < 315) { - return 1; - }elseif(315 <= $rotation && $rotation < 360) { - return 2; + if((0 <= $rotation and $rotation < 45) or (315 <= $rotation and $rotation < 360)) { + return 2; //North + }elseif(45 <= $rotation and $rotation < 135) { + return 3; //East + }elseif(135 <= $rotation and $rotation < 225) { + return 0; //South + }elseif(225 <= $rotation and $rotation < 315) { + return 1; //West }else{ return null; }