mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 04:59:46 +00:00
Remove items from Player inventory on drop
This commit is contained in:
parent
b259ed2532
commit
ad11851c61
1 changed files with 6 additions and 1 deletions
|
|
@ -548,10 +548,12 @@ class Player{
|
||||||
if($c !== false){
|
if($c !== false){
|
||||||
$c->close("logged in from another location");
|
$c->close("logged in from another location");
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->server->api->dhandle("player.join", $this) === false){
|
if($this->server->api->dhandle("player.join", $this) === false){
|
||||||
$this->close();
|
$this->close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->server->api->player->add($this->CID);
|
$this->server->api->player->add($this->CID);
|
||||||
$this->auth = true;
|
$this->auth = true;
|
||||||
if(!isset($this->data["inventory"]) or $this->gamemode === CREATIVE){
|
if(!isset($this->data["inventory"]) or $this->gamemode === CREATIVE){
|
||||||
|
|
@ -769,8 +771,11 @@ class Player{
|
||||||
if($this->loggedIn === false){
|
if($this->loggedIn === false){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
$item = BlockAPI::getItem($data["block"], $data["meta"], $data["stack"]);
|
||||||
|
$data["item"] = $item;
|
||||||
if($this->server->handle("player.drop", $data) !== false){
|
if($this->server->handle("player.drop", $data) !== false){
|
||||||
$this->server->api->block->drop(new Vector3($this->entity->x, $this->entity->y, $this->entity->z), BlockAPI::getItem($data["block"], $data["meta"], $data["stack"]));
|
$this->removeItem($item->getID(), $item->getMetadata(), $item->count);
|
||||||
|
$this->server->api->block->drop(new Vector3($this->entity->x, $this->entity->y, $this->entity->z), $item);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MC_SIGN_UPDATE:
|
case MC_SIGN_UPDATE:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue