Fixed NBT parsing on false properties

This commit is contained in:
Shoghi Cervantes
2015-04-20 13:57:16 +02:00
parent 6ed63edd89
commit f88aed1208
14 changed files with 37 additions and 39 deletions

View File

@ -106,7 +106,7 @@ class Anvil extends McRegion{
}
public static function createChunkSection($Y){
return new ChunkSection(new Compound(null, [
return new ChunkSection(new Compound("", [
"Y" => new Byte("Y", $Y),
"Blocks" => new ByteArray("Blocks", str_repeat("\x00", 4096)),
"Data" => new ByteArray("Data", str_repeat("\x00", 2048)),

View File

@ -118,7 +118,7 @@ abstract class BaseLevelProvider implements LevelProvider{
public function saveLevelData(){
$nbt = new NBT(NBT::BIG_ENDIAN);
$nbt->setData(new Compound(null, [
$nbt->setData(new Compound("", [
"Data" => $this->levelData
]));
$buffer = $nbt->writeCompressed();

View File

@ -96,7 +96,7 @@ class LevelDB extends BaseLevelProvider{
mkdir($path . "/db", 0777, true);
}
//TODO, add extra details
$levelData = new Compound(null, [
$levelData = new Compound("", [
"hardcore" => new Byte("hardcore", 0),
"initialized" => new Byte("initialized", 1),
"GameType" => new Int("GameType", 0),

View File

@ -100,7 +100,7 @@ class McRegion extends BaseLevelProvider{
"GameRules" => new Compound("GameRules", [])
]);
$nbt = new NBT(NBT::BIG_ENDIAN);
$nbt->setData(new Compound(null, [
$nbt->setData(new Compound("", [
"Data" => $levelData
]));
$buffer = $nbt->writeCompressed();