Merge branch 'stable' into next-minor

This commit is contained in:
Dylan K. Taylor 2019-05-02 16:39:05 +01:00
commit fdaf9dce73
3 changed files with 16 additions and 9 deletions

12
composer.lock generated
View File

@ -201,16 +201,16 @@
}, },
{ {
"name": "pocketmine/raklib", "name": "pocketmine/raklib",
"version": "0.12.3", "version": "0.12.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/pmmp/RakLib.git", "url": "https://github.com/pmmp/RakLib.git",
"reference": "9df7dbcdafeb29403af6a7fa22c8785f758a1145" "reference": "fc1ccc8e61b9033e5372436b2e28a7a95388373f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/pmmp/RakLib/zipball/9df7dbcdafeb29403af6a7fa22c8785f758a1145", "url": "https://api.github.com/repos/pmmp/RakLib/zipball/fc1ccc8e61b9033e5372436b2e28a7a95388373f",
"reference": "9df7dbcdafeb29403af6a7fa22c8785f758a1145", "reference": "fc1ccc8e61b9033e5372436b2e28a7a95388373f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -235,10 +235,10 @@
], ],
"description": "A RakNet server implementation written in PHP", "description": "A RakNet server implementation written in PHP",
"support": { "support": {
"source": "https://github.com/pmmp/RakLib/tree/0.12.3", "source": "https://github.com/pmmp/RakLib/tree/0.12.4",
"issues": "https://github.com/pmmp/RakLib/issues" "issues": "https://github.com/pmmp/RakLib/issues"
}, },
"time": "2019-04-21T12:15:38+00:00" "time": "2019-05-02T14:53:51+00:00"
}, },
{ {
"name": "pocketmine/snooze", "name": "pocketmine/snooze",

View File

@ -1065,6 +1065,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
return; //avoid player spawning twice (this can only happen on 3.x with a custom malicious client) return; //avoid player spawning twice (this can only happen on 3.x with a custom malicious client)
} }
$this->spawned = true; $this->spawned = true;
$this->setImmobile(false);
if($this->hasPermission(Server::BROADCAST_CHANNEL_USERS)){ if($this->hasPermission(Server::BROADCAST_CHANNEL_USERS)){
PermissionManager::getInstance()->subscribeToPermission(Server::BROADCAST_CHANNEL_USERS, $this); PermissionManager::getInstance()->subscribeToPermission(Server::BROADCAST_CHANNEL_USERS, $this);
@ -1083,7 +1084,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$this->server->broadcastMessage($ev->getJoinMessage()); $this->server->broadcastMessage($ev->getJoinMessage());
} }
$this->setImmobile(false);
$this->noDamageTicks = 60; $this->noDamageTicks = 60;
foreach($this->usedChunks as $index => $c){ foreach($this->usedChunks as $index => $c){
@ -2061,7 +2061,13 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
case ResourcePackClientResponsePacket::STATUS_SEND_PACKS: case ResourcePackClientResponsePacket::STATUS_SEND_PACKS:
$manager = $this->server->getResourcePackManager(); $manager = $this->server->getResourcePackManager();
foreach($packet->packIds as $uuid){ foreach($packet->packIds as $uuid){
$pack = $manager->getPackById(substr($uuid, 0, strpos($uuid, "_"))); //dirty hack for mojang's dirty hack for versions //dirty hack for mojang's dirty hack for versions
$splitPos = strpos($uuid, "_");
if($splitPos !== false){
$uuid = substr($uuid, 0, $splitPos);
}
$pack = $manager->getPackById($uuid);
if(!($pack instanceof ResourcePack)){ if(!($pack instanceof ResourcePack)){
//Client requested a resource pack but we don't have it available on the server //Client requested a resource pack but we don't have it available on the server
$this->close("", "disconnectionScreen.resourcePack", true); $this->close("", "disconnectionScreen.resourcePack", true);

View File

@ -26,6 +26,7 @@ declare(strict_types=1);
*/ */
namespace pocketmine\level; namespace pocketmine\level;
use pocketmine\block\Air;
use pocketmine\block\Block; use pocketmine\block\Block;
use pocketmine\block\BlockFactory; use pocketmine\block\BlockFactory;
use pocketmine\entity\Entity; use pocketmine\entity\Entity;
@ -1797,7 +1798,7 @@ class Level implements ChunkManager, Metadatable{
if($player !== null){ if($player !== null){
$ev = new BlockBreakEvent($player, $target, $item, $player->isCreative(), $drops, $xpDrop); $ev = new BlockBreakEvent($player, $target, $item, $player->isCreative(), $drops, $xpDrop);
if(($player->isSurvival() and !$target->isBreakable($item)) or $player->isSpectator()){ if($target instanceof Air or ($player->isSurvival() and !$target->isBreakable($item)) or $player->isSpectator()){
$ev->setCancelled(); $ev->setCancelled();
}elseif($this->checkSpawnProtection($player, $target)){ }elseif($this->checkSpawnProtection($player, $target)){
$ev->setCancelled(); //set it to cancelled so plugins can bypass this $ev->setCancelled(); //set it to cancelled so plugins can bypass this