mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Added item pickup delay
This commit is contained in:
parent
08b67428a0
commit
5096cdcde8
@ -66,7 +66,7 @@ class BlockAPI{
|
||||
$amount = (int) $params[2];
|
||||
}
|
||||
if(isset($params[3])){
|
||||
$meta = (int) $params[3];
|
||||
$meta = ((int) $params[3]) & 0xFFFF;
|
||||
}
|
||||
if(($player = $this->server->api->player->get($username)) !== false){
|
||||
$this->drop($player->entity->x - 0.5, $player->entity->y, $player->entity->z - 0.5, $block, $meta, $amount);
|
||||
|
@ -131,11 +131,12 @@ class Entity extends stdClass{
|
||||
|
||||
public function environmentUpdate(){
|
||||
if($this->class === ENTITY_ITEM){
|
||||
if((microtime(true) - $this->spawntime) >= 300){
|
||||
$time = microtime(true);
|
||||
if(($time - $this->spawntime) >= 300){
|
||||
$this->close(); //Despawn timer
|
||||
return false;
|
||||
}
|
||||
if($this->server->gamemode === 0){
|
||||
if($this->server->gamemode === 0 and ($time - $this->spawntime) >= 2){
|
||||
$player = $this->server->query("SELECT EID FROM entities WHERE class == ".ENTITY_PLAYER." AND abs(x - {$this->x}) <= 1.5 AND abs(y - {$this->y}) <= 1.5 AND abs(z - {$this->z}) <= 1.5 LIMIT 1;", true);
|
||||
if($player !== true and $player !== false){
|
||||
if($this->server->api->dhandle("player.pickup", array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user