diff --git a/src/API/BanAPI.php b/src/API/BanAPI.php index 1dd90c2041..7111b30fe1 100644 --- a/src/API/BanAPI.php +++ b/src/API/BanAPI.php @@ -298,13 +298,13 @@ class BanAPI{ } public function kick($username, $reason = "No Reason"){ - $this->commandHandler("kick", array($username, $reason)); + $this->commandHandler("kick", array($username, $reason), "console", ""); } public function reload(){ - $this->commandHandler("ban", array("reload")); - $this->commandHandler("banip", array("reload")); - $this->commandHandler("whitelist", array("reload")); + $this->commandHandler("ban", array("reload"), "console", ""); + $this->commandHandler("banip", array("reload"), "console", ""); + $this->commandHandler("whitelist", array("reload"), "console", ""); } public function isIPBanned($ip){ diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index 6134b40f60..3c659047b5 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -283,7 +283,7 @@ class BlockAPI{ if(($player->gamemode & 0x01) === 0x00 and count($drops) > 0){ foreach($drops as $drop){ - $this->server->api->entity->drop($target, BlockAPI::getItem($drop[0] & 0xFFFF, $drop[1] & 0xFFFF, $drop[2] & 0xFF)); + $this->server->api->entity->drop(new Position($target->x + 0.5, $target->y, $target->z + 0.5, $target->level), BlockAPI::getItem($drop[0] & 0xFFFF, $drop[1] & 0xFFFF, $drop[2] & 0xFF)); } } return false; diff --git a/src/API/EntityAPI.php b/src/API/EntityAPI.php index 64cd41c17c..1cc4deb39d 100644 --- a/src/API/EntityAPI.php +++ b/src/API/EntityAPI.php @@ -107,9 +107,12 @@ class EntityAPI{ return; } $data = array( - "x" => $pos->x + mt_rand(2, 8) / 10, + "x" => $pos->x, "y" => $pos->y + 0.19, - "z" => $pos->z + mt_rand(2, 8) / 10, + "z" => $pos->z, + "speedX" => mt_rand(-2, 2) / 6, + "speedY" => mt_rand(5, 8) / 2, + "speedZ" => mt_rand(-2, 2) / 6, "item" => $item, ); if($this->server->api->handle("item.drop", $data) !== false){ @@ -117,10 +120,8 @@ class EntityAPI{ $item->count = min($item->getMaxStackSize(), $count); $count -= $item->count; $e = $this->add($pos->level, ENTITY_ITEM, $item->getID(), $data); - $e->speedX = mt_rand(-10, 10) / 100; - $e->speedY = mt_rand(0, 5) / 100; - $e->speedZ = mt_rand(-10, 10) / 100; $this->spawnToAll($pos->level, $e->eid); + $this->server->api->handle("entity.motion", $e); } } } diff --git a/src/world/Entity.php b/src/world/Entity.php index 2839f8d05c..ac42ea5825 100644 --- a/src/world/Entity.php +++ b/src/world/Entity.php @@ -131,6 +131,7 @@ class Entity extends Position{ $this->size = 1; break; } + $this->updateLast(); } public function getDrops(){ @@ -421,7 +422,7 @@ class Entity extends Position{ $this->server->api->handle("entity.motion", $this); } - }elseif($this->class === ENTITY_PLAYER){ + }elseif($this->class === ENTITY_PLAYER and ($this->player instanceof Player)){ if($support === false and ($this->player->gamemode & 0x01) === 0x00){ if($this->fallY === false or $this->fallStart === false){ $this->fallY = $y;