From f6bbedbe91352256c01d29a619feab0bad8f31c1 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Fri, 30 Aug 2013 17:09:15 +0200 Subject: [PATCH] Updated chests to 0.7.4 RC --- src/material/block/solid/Chest.php | 5 ++--- src/network/CustomPacketHandler.php | 7 +++++-- src/world/Tile.php | 10 +++++++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/material/block/solid/Chest.php b/src/material/block/solid/Chest.php index ff725304..b76168cc 100644 --- a/src/material/block/solid/Chest.php +++ b/src/material/block/solid/Chest.php @@ -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; } diff --git a/src/network/CustomPacketHandler.php b/src/network/CustomPacketHandler.php index e6987b7f..157007e1 100644 --- a/src/network/CustomPacketHandler.php +++ b/src/network/CustomPacketHandler.php @@ -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: diff --git a/src/world/Tile.php b/src/world/Tile.php index 3bf934ff..bfc43d03 100644 --- a/src/world/Tile.php +++ b/src/world/Tile.php @@ -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){