From 68d71b367d4a9a5d740db2edcf19691d1c0189e1 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Tue, 5 Mar 2013 18:00:54 +0100 Subject: [PATCH] Force drops on Creative mode --- src/world/Entity.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/world/Entity.php b/src/world/Entity.php index f422490c4..3680f007f 100644 --- a/src/world/Entity.php +++ b/src/world/Entity.php @@ -173,9 +173,9 @@ class Entity extends stdClass{ return array(); } - public function spawnDrops(){ + private function spawnDrops(){ foreach($this->getDrops() as $drop){ - $this->server->api->block->drop(new Vector3($this->x, $this->y, $this->z), BlockAPI::getItem($drop[0] & 0xFFFF, $drop[1] & 0xFFFF, $drop[2] & 0xFF)); + $this->server->api->block->drop(new Vector3($this->x, $this->y, $this->z), BlockAPI::getItem($drop[0] & 0xFFFF, $drop[1] & 0xFFFF, $drop[2] & 0xFF), true); } } @@ -592,6 +592,7 @@ class Entity extends stdClass{ )); } if($this->health <= 0 and $this->dead === false){ + $this->spawnDrops(); $this->air = 300; $this->fire = 0; $this->crouched = false; @@ -603,7 +604,6 @@ class Entity extends stdClass{ if($this->player instanceof Player){ $this->server->api->dhandle("player.death", array("name" => $this->name, "cause" => $cause)); }else{ - $this->spawnDrops(); $this->close(); } }elseif($this->health > 0){