mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 21:45:35 +00:00
Fixed #339 Creative players have their inventory cleared on death [gh#339]
This commit is contained in:
parent
3fa1bd3a05
commit
c37c6da42d
@ -143,12 +143,11 @@ class Entity extends Position{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getDrops(){
|
public function getDrops(){
|
||||||
if($this->class === ENTITY_PLAYER and ($this->player->gamemode & 0x00) === 0){
|
if($this->class === ENTITY_PLAYER and ($this->player->gamemode & 0x01) === 0){
|
||||||
$inv = array();
|
$inv = array();
|
||||||
$air = BlockAPI::getItem(AIR, 0, 0);
|
|
||||||
for($i = 0; $i < PLAYER_SURVIVAL_SLOTS; ++$i){
|
for($i = 0; $i < PLAYER_SURVIVAL_SLOTS; ++$i){
|
||||||
$slot = $this->player->getSlot($i);
|
$slot = $this->player->getSlot($i);
|
||||||
$this->player->setSlot($i, $air);
|
$this->player->setSlot($i, BlockAPI::getItem(AIR, 0, 0));
|
||||||
if($slot->getID() !== AIR and $slot->count > 0){
|
if($slot->getID() !== AIR and $slot->count > 0){
|
||||||
$inv[] = array($slot->getID(), $slot->getMetadata(), $slot->count);
|
$inv[] = array($slot->getID(), $slot->getMetadata(), $slot->count);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user