From c37c6da42db473ce97e919e1fb6567d7b14b0661 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 7 Jun 2013 12:51:12 +0200 Subject: [PATCH] Fixed #339 Creative players have their inventory cleared on death [gh#339] --- src/world/Entity.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/world/Entity.php b/src/world/Entity.php index f74ef4d6f2..5dd1be3acb 100644 --- a/src/world/Entity.php +++ b/src/world/Entity.php @@ -143,12 +143,11 @@ class Entity extends Position{ } 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(); - $air = BlockAPI::getItem(AIR, 0, 0); for($i = 0; $i < PLAYER_SURVIVAL_SLOTS; ++$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){ $inv[] = array($slot->getID(), $slot->getMetadata(), $slot->count); }