From 7e67f50da5cd5fb2d944330812744d3238fb31e8 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Tue, 11 Jun 2013 00:55:48 +0200 Subject: [PATCH] Creative players pickup item sound --- src/world/Entity.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/world/Entity.php b/src/world/Entity.php index 893f371e2..4936ae474 100644 --- a/src/world/Entity.php +++ b/src/world/Entity.php @@ -219,18 +219,14 @@ class Entity extends Position{ if($this->class === ENTITY_PLAYER and ($this->player instanceof Player) and $this->player->spawned === true and $this->player->blocked !== true){ foreach($this->server->api->entity->getRadius($this, 1.5, ENTITY_ITEM) as $item){ if(($time - $item->spawntime) >= 0.6){ - if(($this->player->gamemode & 0x01) === 0x00){ - if($this->player->hasSpace($item->type, $item->meta, $item->stack) === true and $this->server->api->dhandle("player.pickup", array( - "eid" => $this->player->eid, - "player" => $this->player, - "entity" => $item, - "block" => $item->type, - "meta" => $item->meta, - "target" => $item->eid - )) !== false){ - $item->close(); - } - }else{ + if((($this->player->gamemode & 0x01) === 1 or $this->player->hasSpace($item->type, $item->meta, $item->stack) === true) and $this->server->api->dhandle("player.pickup", array( + "eid" => $this->player->eid, + "player" => $this->player, + "entity" => $item, + "block" => $item->type, + "meta" => $item->meta, + "target" => $item->eid + )) !== false){ $item->close(); } }