mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 16:49:53 +00:00
Fixed creative players dropping their inventory
This commit is contained in:
parent
422262d585
commit
5a756d215d
@ -1053,6 +1053,22 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
$this->dataPacket($pk);
|
$this->dataPacket($pk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isCreative(){
|
||||||
|
return ($this->gamemode & 0x01) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isAdventure(){
|
||||||
|
return ($this->gamemode & 0x02) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDrops(){
|
||||||
|
if(!$this->isCreative()){
|
||||||
|
return parent::getDrops();
|
||||||
|
}
|
||||||
|
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
protected function getCreativeBlock(Item $item){
|
protected function getCreativeBlock(Item $item){
|
||||||
foreach(Block::$creative as $i => $d){
|
foreach(Block::$creative as $i => $d){
|
||||||
if($d[0] === $item->getID() and $d[1] === $item->getDamage()){
|
if($d[0] === $item->getID() and $d[1] === $item->getDamage()){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user