Complete ChunkData sending!

This commit is contained in:
Shoghi Cervantes Pueyo 2012-12-14 00:08:14 +01:00
parent 6ef600942b
commit e76734628a
2 changed files with 7 additions and 4 deletions

View File

@ -60,6 +60,9 @@ class LevelAPI{
for($i = 0;$i < 0xff; ){
$ordered[$i] = str_repeat("\x00", $i);
for($j = 0; $j < $columnsPerPacket; ++$j){
if(($i + $j) >= 0xff){
break;
}
$ordered[$i] .= "\xff";
for($k = 0; $k < 8; ++$k){
$ordered[$i] .= substr($c[0][$i+$j], $k << 4, 16); //Block data

View File

@ -375,21 +375,21 @@ class CustomPacketHandler{
break;
case MC_REQUEST_CHUNK:
if($this->c === false){
$this->data["x"] = Utils::readInt($this->get(4));
$this->data["z"] = Utils::readInt($this->get(4));
$this->data["x"] = Utils::readInt($this->get(4));
}else{
$this->raw .= Utils::writeInt($this->data["x"]);
$this->raw .= Utils::writeInt($this->data["z"]);
$this->raw .= Utils::writeInt($this->data["x"]);
}
break;
case MC_CHUNK_DATA:
if($this->c === false){
$this->data["x"] = Utils::readInt($this->get(4));
$this->data["z"] = Utils::readInt($this->get(4));
$this->data["x"] = Utils::readInt($this->get(4));
$this->data["data"] = $this->get(true);
}else{
$this->raw .= Utils::writeInt($this->data["x"]);
$this->raw .= Utils::writeInt($this->data["z"]);
$this->raw .= Utils::writeInt($this->data["x"]);
$this->raw .= $this->data["data"];
}
break;