mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
Inventory saving (without checks)
This commit is contained in:
parent
e4bf449198
commit
7723e3784f
4 changed files with 139 additions and 3 deletions
|
|
@ -250,6 +250,7 @@ class BlockAPI{
|
|||
if($data["face"] < 0 or $data["face"] > 5){
|
||||
return false;
|
||||
}
|
||||
$data["original"] = array($data["block"], $data["meta"]);
|
||||
$target = $this->server->api->level->getBlock($data["x"], $data["y"], $data["z"]);
|
||||
if($target[0] === 0){ //If no block exists
|
||||
$this->cancelAction($target);
|
||||
|
|
@ -296,7 +297,7 @@ class BlockAPI{
|
|||
if($data["block"] === 292){ //Hoe
|
||||
$data["block"] = 60;
|
||||
$data["meta"] = 0;
|
||||
$this->server->handle("player.block.place", $data);
|
||||
$this->server->handle("player.block.update", $data);
|
||||
$cancelPlace = true;
|
||||
}
|
||||
case 59:
|
||||
|
|
|
|||
|
|
@ -220,6 +220,7 @@ class PlayerAPI{
|
|||
"y" => $this->server->spawn["y"],
|
||||
"z" => $this->server->spawn["z"],
|
||||
),
|
||||
"inventory" => array_fill(0, 36, array(0, 0, 0)),
|
||||
"health" => 20,
|
||||
"lastIP" => "",
|
||||
"lastID" => 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue