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

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

View File

@ -740,12 +740,15 @@ class CustomPacketHandler{
$this->data["windowid"] = ord($this->get(1));
$this->data["type"] = 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{
$this->raw .= chr($this->data["windowid"]);
$this->raw .= chr($this->data["type"]);
$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;
case MC_CONTAINER_CLOSE:

View File

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