mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 04:17:48 +00:00
Updated chests to 0.7.4 RC
This commit is contained in:
parent
77c35dd18e
commit
f6bbedbe91
@ -59,12 +59,11 @@ class ChestBlock extends TransparentBlock{
|
|||||||
"y" => $this->y,
|
"y" => $this->y,
|
||||||
"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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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:
|
||||||
|
@ -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){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user