public function readTag()
{
switch ($this->getByte()) {
case NBT::TAG_Byte:
$tag = new ByteTag($this->getString());
$tag->read($this);
break;
case NBT::TAG_Short:
$tag = new ShortTag($this->getString());
$tag->read($this);
break;
case NBT::TAG_Int:
$tag = new IntTag($this->getString());
$tag->read($this);
break;
case NBT::TAG_Long:
$tag = new LongTag($this->getString());
$tag->read($this);
break;
case NBT::TAG_Float:
$tag = new FloatTag($this->getString());
$tag->read($this);
break;
case NBT::TAG_Double:
$tag = new DoubleTag($this->getString());
$tag->read($this);
break;
case NBT::TAG_ByteArray:
$tag = new ByteArrayTag($this->getString());
$tag->read($this);
break;
case NBT::TAG_String:
$tag = new StringTag($this->getString());
$tag->read($this);
break;
case NBT::TAG_List:
$tag = new ListTag($this->getString());
$tag->read($this);
break;
case NBT::TAG_Compound:
$tag = new CompoundTag($this->getString());
$tag->read($this);
break;
case NBT::TAG_IntArray:
$tag = new IntArrayTag($this->getString());
$tag->read($this);
break;
case NBT::TAG_End:
//No named tag
//No named tag
default:
$tag = new EndTag();
break;
}
return $tag;
}