Inventory saving (without checks)

This commit is contained in:
Shoghi Cervantes Pueyo
2013-01-18 23:59:51 +01:00
parent e4bf449198
commit 7723e3784f
4 changed files with 139 additions and 3 deletions

View File

@@ -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:

View File

@@ -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,