Updated chests to 0.7.4 RC

This commit is contained in:
Shoghi Cervantes 2013-08-30 17:09:15 +02:00
parent 77c35dd18e
commit f6bbedbe91
3 changed files with 14 additions and 8 deletions

View File

@ -60,11 +60,10 @@ class ChestBlock extends TransparentBlock{
"z" => $this->z "z" => $this->z
)); ));
/* 0.7.4 bug, waiting for Mojang...
if($chest instanceof Tile){ if($chest instanceof Tile){
$chest->pairWith($tile); $chest->pairWith($tile);
$tile->pairWith($chest); $tile->pairWith($chest);
}*/ }
return true; return true;
} }

View File

@ -740,12 +740,15 @@ class CustomPacketHandler{
$this->data["windowid"] = ord($this->get(1)); $this->data["windowid"] = ord($this->get(1));
$this->data["type"] = ord($this->get(1)); $this->data["type"] = ord($this->get(1));
$this->data["slots"] = ord($this->get(1)); $this->data["slots"] = ord($this->get(1));
$this->data["title"] = $this->get(Utils::readShort($this->get(2), false));
//$this->data["title"] = $this->get(Utils::readShort($this->get(2), false));
}else{ }else{
$this->raw .= chr($this->data["windowid"]); $this->raw .= chr($this->data["windowid"]);
$this->raw .= chr($this->data["type"]); $this->raw .= chr($this->data["type"]);
$this->raw .= chr($this->data["slots"]); $this->raw .= chr($this->data["slots"]);
$this->raw .= Utils::writeShort(strlen($this->data["title"])).$this->data["title"]; $this->raw .= Utils::writeInt($this->data["x"]);
$this->raw .= Utils::writeInt($this->data["y"]);
$this->raw .= Utils::writeInt($this->data["z"]);
} }
break; break;
case MC_CONTAINER_CLOSE: case MC_CONTAINER_CLOSE:

View File

@ -146,7 +146,9 @@ class Tile extends Position{
"windowid" => $id, "windowid" => $id,
"type" => WINDOW_CHEST, "type" => WINDOW_CHEST,
"slots" => is_array($player->windows[$id]) ? CHEST_SLOTS << 1:CHEST_SLOTS, "slots" => is_array($player->windows[$id]) ? CHEST_SLOTS << 1:CHEST_SLOTS,
"title" => "Chest", "x" => $this->x,
"y" => $this->y,
"z" => $this->z,
)); ));
$slots = array(); $slots = array();
@ -189,7 +191,10 @@ class Tile extends Position{
$player->dataPacket(MC_CONTAINER_SET_CONTENT, array( $player->dataPacket(MC_CONTAINER_SET_CONTENT, array(
"windowid" => $id, "windowid" => $id,
"count" => count($slots), "count" => count($slots),
"slots" => $slots "slots" => $slots,
"x" => $this->x,
"y" => $this->y,
"z" => $this->z
)); ));
return true; return true;
}elseif($this->class === TILE_FURNACE){ }elseif($this->class === TILE_FURNACE){
@ -200,7 +205,6 @@ class Tile extends Position{
"windowid" => $id, "windowid" => $id,
"type" => WINDOW_FURNACE, "type" => WINDOW_FURNACE,
"slots" => FURNACE_SLOTS, "slots" => FURNACE_SLOTS,
"title" => "Furnace",
)); ));
$slots = array(); $slots = array();
for($s = 0; $s < FURNACE_SLOTS; ++$s){ for($s = 0; $s < FURNACE_SLOTS; ++$s){