drop should be collectable in 2 block radius

This commit is contained in:
GameHerobrine 2023-01-09 15:19:14 +03:00
parent c961de59ba
commit 44728d21dc

View file

@ -342,8 +342,8 @@ class Entity extends Position
$hasUpdate = Entity::$updateOnTick ? $this->class === ENTITY_MOB : false; // force true for mobs
$time = microtime(true);
if($this->class === ENTITY_PLAYER and ($this->player instanceof Player) and $this->player->spawned === true and $this->player->blocked !== true && ! $this->dead){
foreach($this->server->api->entity->getRadius($this, 1, ENTITY_ITEM) as $item){
if(! $item->closed && $item->spawntime > 0 && ($time - $item->spawntime) >= 0.6){
foreach($this->server->api->entity->getRadius($this, 2, ENTITY_ITEM) as $item){ //TODO vanilla method of searching/radius
if(!$item->closed && $item->spawntime > 0 && ($time - $item->spawntime) >= 0.6){
if((($this->player->gamemode & 0x01) === 1 || $this->player->hasSpace($item->type, $item->meta, $item->stack) === true) && $this->server->api->dhandle("player.pickup", array(
"eid" => $this->player->eid,
"player" => $this->player,
@ -542,7 +542,6 @@ class Entity extends Position
}
}
}
if(!$this->isPlayer()){
$update = false;
$drag = 0.2;