tweaked delay when picking up items, experimental hotbar is now disabled by default

This commit is contained in:
GameHerobrine 2024-11-23 03:10:26 +03:00
parent a4a5f1dfdf
commit 46efebaf67
8 changed files with 11 additions and 9 deletions

View file

@ -275,7 +275,7 @@ class EntityAPI{
}
}
public function drop(Position $pos, Item $item){
public function drop(Position $pos, Item $item, $pickupDelay = 10){
if($item->getID() === AIR or $item->count <= 0){
return;
}
@ -295,6 +295,7 @@ class EntityAPI{
$item->count = min($item->getMaxStackSize(), $count);
$count -= $item->count;
$e = $this->add($pos->level, ENTITY_ITEM, ENTITY_ITEM_TYPE, $data);
$e->delayBeforePickup = $pickupDelay;
$this->spawnToAll($e);
$this->server->api->handle("entity.motion", $e);
}