当前位置: 首页>>代码示例>>PHP>>正文


PHP NBT::get方法代码示例

本文整理汇总了PHP中pocketmine\nbt\NBT::get方法的典型用法代码示例。如果您正苦于以下问题:PHP NBT::get方法的具体用法?PHP NBT::get怎么用?PHP NBT::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\nbt\NBT的用法示例。


在下文中一共展示了NBT::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: read

 public function read(NBT $nbt)
 {
     $this->value = [];
     $size = $nbt->endianness === 1 ? \PHP_INT_SIZE === 8 ? \unpack("N", $nbt->get(4))[1] << 32 >> 32 : \unpack("N", $nbt->get(4))[1] : (\PHP_INT_SIZE === 8 ? \unpack("V", $nbt->get(4))[1] << 32 >> 32 : \unpack("V", $nbt->get(4))[1]);
     $value = \unpack($nbt->endianness === NBT::LITTLE_ENDIAN ? "V*" : "N*", $nbt->get($size * 4));
     foreach ($value as $i => $v) {
         $this->value[$i - 1] = $v;
     }
 }
开发者ID:Edwardthedog2,项目名称:Steadfast2,代码行数:9,代码来源:IntArray.php

示例2: read

 public function read(NBT $nbt)
 {
     $this->value = [];
     $size = $nbt->getInt();
     $value = unpack($nbt->endianness === NBT::LITTLE_ENDIAN ? "V*" : "N*", $nbt->get($size * 4));
     foreach ($value as $i => $v) {
         $this->value[$i - 1] = $v;
     }
 }
开发者ID:TylerGames,项目名称:PocketMine-MP,代码行数:9,代码来源:IntArray.php

示例3: read

 public function read(NBT $nbt)
 {
     $this->value = $nbt->get($nbt->getInt());
 }
开发者ID:Creeperface01,项目名称:ImagicalMine,代码行数:4,代码来源:ByteArrayTag.php

示例4: read

 public function read(NBT $nbt)
 {
     $this->value = [];
     $this->tagType = \ord($nbt->get(1));
     $size = $nbt->endianness === 1 ? \PHP_INT_SIZE === 8 ? \unpack("N", $nbt->get(4))[1] << 32 >> 32 : \unpack("N", $nbt->get(4))[1] : (\PHP_INT_SIZE === 8 ? \unpack("V", $nbt->get(4))[1] << 32 >> 32 : \unpack("V", $nbt->get(4))[1]);
     for ($i = 0; $i < $size and !$nbt->feof(); ++$i) {
         switch ($this->tagType) {
             case NBT::TAG_Byte:
                 $tag = new Byte("");
                 $tag->read($nbt);
                 $this->{$i} = $tag;
                 break;
             case NBT::TAG_Short:
                 $tag = new Short("");
                 $tag->read($nbt);
                 $this->{$i} = $tag;
                 break;
             case NBT::TAG_Int:
                 $tag = new Int("");
                 $tag->read($nbt);
                 $this->{$i} = $tag;
                 break;
             case NBT::TAG_Long:
                 $tag = new Long("");
                 $tag->read($nbt);
                 $this->{$i} = $tag;
                 break;
             case NBT::TAG_Float:
                 $tag = new Float("");
                 $tag->read($nbt);
                 $this->{$i} = $tag;
                 break;
             case NBT::TAG_Double:
                 $tag = new Double("");
                 $tag->read($nbt);
                 $this->{$i} = $tag;
                 break;
             case NBT::TAG_ByteArray:
                 $tag = new ByteArray("");
                 $tag->read($nbt);
                 $this->{$i} = $tag;
                 break;
             case NBT::TAG_String:
                 $tag = new String("");
                 $tag->read($nbt);
                 $this->{$i} = $tag;
                 break;
             case NBT::TAG_Enum:
                 $tag = new TagEnum("");
                 $tag->read($nbt);
                 $this->{$i} = $tag;
                 break;
             case NBT::TAG_Compound:
                 $tag = new Compound("");
                 $tag->read($nbt);
                 $this->{$i} = $tag;
                 break;
             case NBT::TAG_IntArray:
                 $tag = new IntArray("");
                 $tag->read($nbt);
                 $this->{$i} = $tag;
                 break;
         }
     }
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:65,代码来源:Enum.php

示例5: read

 public function read(NBT $nbt)
 {
     $this->value = $nbt->endianness === 1 ? \ENDIANNESS === 0 ? \unpack("d", $nbt->get(8))[1] : \unpack("d", \strrev($nbt->get(8)))[1] : (\ENDIANNESS === 0 ? \unpack("d", \strrev($nbt->get(8)))[1] : \unpack("d", $nbt->get(8))[1]);
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:4,代码来源:Double.php

示例6: read

 public function read(NBT $nbt)
 {
     [];
     $size = $nbt->getInt();
     $this->value = array_values(unpack($nbt->endianness === NBT::LITTLE_ENDIAN ? "V*" : "N*", $nbt->get($size * 4)));
 }
开发者ID:TexusDark,项目名称:Ananas-MP,代码行数:6,代码来源:IntArray.php

示例7: read

 public function read(NBT $nbt)
 {
     $this->value = $nbt->endianness === 1 ? \unpack("N", $nbt->get(4))[1] << 32 >> 32 : \unpack("V", $nbt->get(4))[1] << 32 >> 32;
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:4,代码来源:Int__64bit.php

示例8: read

 public function read(NBT $nbt)
 {
     $this->value = $nbt->endianness === 1 ? Binary::readLong($nbt->get(8)) : Binary::readLLong($nbt->get(8));
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:4,代码来源:Long__64bit.php

示例9: read

 public function read(NBT $nbt)
 {
     $this->value = $nbt->endianness === 1 ? unpack("n", $nbt->get(2))[1] : unpack("v", $nbt->get(2))[1];
 }
开发者ID:Hydreon,项目名称:PMSoft238,代码行数:4,代码来源:Short.php

示例10: read

 public function read(NBT $nbt)
 {
     $this->value = $nbt->endianness === 1 ? \PHP_INT_SIZE === 8 ? \unpack("N", $nbt->get(4))[1] << 32 >> 32 : \unpack("N", $nbt->get(4))[1] : (\PHP_INT_SIZE === 8 ? \unpack("V", $nbt->get(4))[1] << 32 >> 32 : \unpack("V", $nbt->get(4))[1]);
 }
开发者ID:xpyctum,项目名称:PocketMinePlusPlus,代码行数:4,代码来源:Int.php

示例11: read

 public function read(NBT $nbt)
 {
     [];
     $size = $nbt->endianness === 1 ? \unpack("N", $nbt->get(4))[1] : \unpack("V", $nbt->get(4))[1];
     $this->value = \array_values(\unpack($nbt->endianness === NBT::LITTLE_ENDIAN ? "V*" : "N*", $nbt->get($size * 4)));
 }
开发者ID:ken77731,项目名称:PocketMine-0.13.0,代码行数:6,代码来源:IntArray__32bit.php

示例12: read

 public function read(NBT $nbt)
 {
     $this->value = $nbt->endianness === 1 ? \ENDIANNESS === 0 ? unpack("f", $nbt->get(4))[1] : unpack("f", strrev($nbt->get(4)))[1] : (\ENDIANNESS === 0 ? unpack("f", strrev($nbt->get(4)))[1] : unpack("f", $nbt->get(4))[1]);
 }
开发者ID:Hydreon,项目名称:PMSoft238,代码行数:4,代码来源:Float.php

示例13: read

 public function read(NBT $nbt)
 {
     $this->value = [];
     $size = $nbt->endianness === 1 ? PHP_INT_SIZE === 8 ? unpack("N", $nbt->get(4))[1] << 32 >> 32 : unpack("N", $nbt->get(4))[1] : (PHP_INT_SIZE === 8 ? unpack("V", $nbt->get(4))[1] << 32 >> 32 : unpack("V", $nbt->get(4))[1]);
     $this->value = unpack($nbt->endianness === NBT::LITTLE_ENDIAN ? "V*" : "N*", $nbt->get($size * 4));
 }
开发者ID:TylerAndrew,项目名称:Steadfast2,代码行数:6,代码来源:IntArray.php

示例14: read

 public function read(NBT $nbt, bool $network = false)
 {
     $this->value = $nbt->get($nbt->getInt($network));
 }
开发者ID:ClearSkyTeam,项目名称:ClearSky,代码行数:4,代码来源:ByteArrayTag.php

示例15: read

 public function read(NBT $nbt)
 {
     $this->value = \ord($nbt->get(1));
 }
开发者ID:kazuemon,项目名称:NIGHTMARE,代码行数:4,代码来源:Byte.php


注:本文中的pocketmine\nbt\NBT::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。