diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index d1e4ae8b9..deb8e26ee 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1691,7 +1691,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade if($this->isCreative()){ $this->inventory->setHeldItemSlot(0); }else{ - $this->inventory->setHeldItemSlot(0); + $this->inventory->setHeldItemSlot($this->inventory->getHotbarSlotIndex(0)); } $pk = new PlayStatusPacket(); diff --git a/src/pocketmine/event/Cancellable.php b/src/pocketmine/event/Cancellable.php index ea7f18268..81d2abca9 100644 --- a/src/pocketmine/event/Cancellable.php +++ b/src/pocketmine/event/Cancellable.php @@ -28,5 +28,5 @@ namespace pocketmine\event; interface Cancellable{ public function isCancelled(); - public function setCancelled($forceCancel = false); -} \ No newline at end of file + public function setCancelled($value = true); +} diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 465e8a313..dc0a76e8d 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -872,7 +872,7 @@ class Level implements ChunkManager, Metadatable{ } if(count($this->blockCache) > 2048){ - $this->chunkCache = []; + $this->blockCache = []; } } @@ -2340,7 +2340,7 @@ class Level implements ChunkManager, Metadatable{ $this->server->getPluginManager()->callEvent(new SpawnChangeEvent($this, $previousSpawn)); } - public function requestChunk($x, $z, Player $player, $order = LevelProvider::ORDER_ZXY){ + public function requestChunk($x, $z, Player $player){ $index = Level::chunkHash($x, $z); if(!isset($this->chunkSendQueue[$index])){ $this->chunkSendQueue[$index] = []; diff --git a/src/pocketmine/level/sound/EndermanTeleportSound.php b/src/pocketmine/level/sound/EndermanTeleportSound.php new file mode 100644 index 000000000..c4e43130e --- /dev/null +++ b/src/pocketmine/level/sound/EndermanTeleportSound.php @@ -0,0 +1,31 @@ +buffer .= Binary::writeLInt($v); } - public function getShort($signed = true){ - return $signed ? Binary::readSignedShort($this->get(2)) : Binary::readShort($this->get(2)); + public function getSignedShort(){ + return Binary::readSignedShort($this->get(2)); } public function putShort($v){ $this->buffer .= Binary::writeShort($v); } + public function getShort(){ + return Binary::readShort($this->get(2)); + } + + public function putSignedShort($v){ + $this->buffer .= Binary::writeShort($v); + } + public function getFloat(){ return Binary::readFloat($this->get(4)); } @@ -188,7 +196,7 @@ class BinaryStream extends \stdClass{ } public function getSlot(){ - $id = $this->getShort(true); + $id = $this->getSignedShort(); if($id <= 0){ return Item::get(0, 0, 0); diff --git a/src/pocketmine/utils/ServerKiller.php b/src/pocketmine/utils/ServerKiller.php index d5c710f07..2e3326ebb 100644 --- a/src/pocketmine/utils/ServerKiller.php +++ b/src/pocketmine/utils/ServerKiller.php @@ -33,11 +33,11 @@ class ServerKiller extends Thread{ public function run(){ sleep($this->time); - echo "\nTook to long to stop, server was killed forcefully!\n"; + echo "\nTook too long to stop, server was killed forcefully!\n"; @\pocketmine\kill(getmypid()); } public function getThreadName(){ return "Server Killer"; } -} \ No newline at end of file +}