mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 14:05:35 +00:00
Creative players pickup item sound
This commit is contained in:
parent
393b57c535
commit
7e67f50da5
@ -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){
|
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){
|
foreach($this->server->api->entity->getRadius($this, 1.5, ENTITY_ITEM) as $item){
|
||||||
if(($time - $item->spawntime) >= 0.6){
|
if(($time - $item->spawntime) >= 0.6){
|
||||||
if(($this->player->gamemode & 0x01) === 0x00){
|
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(
|
||||||
if($this->player->hasSpace($item->type, $item->meta, $item->stack) === true and $this->server->api->dhandle("player.pickup", array(
|
"eid" => $this->player->eid,
|
||||||
"eid" => $this->player->eid,
|
"player" => $this->player,
|
||||||
"player" => $this->player,
|
"entity" => $item,
|
||||||
"entity" => $item,
|
"block" => $item->type,
|
||||||
"block" => $item->type,
|
"meta" => $item->meta,
|
||||||
"meta" => $item->meta,
|
"target" => $item->eid
|
||||||
"target" => $item->eid
|
)) !== false){
|
||||||
)) !== false){
|
|
||||||
$item->close();
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
$item->close();
|
$item->close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user