本文整理汇总了PHP中pocketmine\utils\Binary::writeByte方法的典型用法代码示例。如果您正苦于以下问题:PHP Binary::writeByte方法的具体用法?PHP Binary::writeByte怎么用?PHP Binary::writeByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pocketmine\utils\Binary
的用法示例。
在下文中一共展示了Binary::writeByte方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateChunk
public function generateChunk($x, $z)
{
$nbt = new Compound("Level", []);
$nbt->xPos = new Int("xPos", $this->getX() * 32 + $x);
$nbt->zPos = new Int("zPos", $this->getZ() * 32 + $z);
$nbt->LastUpdate = new Long("LastUpdate", 0);
$nbt->LightPopulated = new Byte("LightPopulated", 0);
$nbt->TerrainPopulated = new Byte("TerrainPopulated", 0);
$nbt->V = new Byte("V", self::VERSION);
$nbt->InhabitedTime = new Long("InhabitedTime", 0);
$biomes = str_repeat(Binary::writeByte(-1), 256);
$nbt->Biomes = new ByteArray("Biomes", $biomes);
$nbt->BiomeColors = new IntArray("BiomeColors", array_fill(0, 156, Binary::readInt("…²J")));
$nbt->HeightMap = new IntArray("HeightMap", array_fill(0, 256, 127));
$nbt->Sections = new Enum("Sections", []);
$nbt->Sections->setTagType(NBT::TAG_Compound);
$nbt->Entities = new Enum("Entities", []);
$nbt->Entities->setTagType(NBT::TAG_Compound);
$nbt->TileEntities = new Enum("TileEntities", []);
$nbt->TileEntities->setTagType(NBT::TAG_Compound);
$nbt->TileTicks = new Enum("TileTicks", []);
$nbt->TileTicks->setTagType(NBT::TAG_Compound);
$writer = new NBT(NBT::BIG_ENDIAN);
$nbt->setName("Level");
$writer->setData(new Compound("", ["Level" => $nbt]));
$chunkData = $writer->writeCompressed(ZLIB_ENCODING_DEFLATE, RegionLoader::$COMPRESSION_LEVEL);
$this->saveChunk($x, $z, $chunkData);
}
示例2: putByte
public function putByte($v)
{
$this->buffer .= Binary::writeByte($v);
}