mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +00:00
Prevent block-picking unknown blocks
This commit is contained in:
parent
96857c65b6
commit
3a18bdd6a0
@ -26,6 +26,7 @@ namespace pocketmine;
|
|||||||
use pocketmine\block\Bed;
|
use pocketmine\block\Bed;
|
||||||
use pocketmine\block\Block;
|
use pocketmine\block\Block;
|
||||||
use pocketmine\block\BlockFactory;
|
use pocketmine\block\BlockFactory;
|
||||||
|
use pocketmine\block\UnknownBlock;
|
||||||
use pocketmine\command\Command;
|
use pocketmine\command\Command;
|
||||||
use pocketmine\command\CommandSender;
|
use pocketmine\command\CommandSender;
|
||||||
use pocketmine\entity\Effect;
|
use pocketmine\entity\Effect;
|
||||||
@ -2714,6 +2715,9 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
|
|
||||||
public function handleBlockPickRequest(BlockPickRequestPacket $packet) : bool{
|
public function handleBlockPickRequest(BlockPickRequestPacket $packet) : bool{
|
||||||
$block = $this->level->getBlockAt($packet->blockX, $packet->blockY, $packet->blockZ);
|
$block = $this->level->getBlockAt($packet->blockX, $packet->blockY, $packet->blockZ);
|
||||||
|
if($block instanceof UnknownBlock){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
$item = $block->getPickedItem();
|
$item = $block->getPickedItem();
|
||||||
if($packet->addUserData){
|
if($packet->addUserData){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user