Pmmp NBT Versions Save

PHP library for working with the NBT (Named Binary Tag) data storage format, as designed by Mojang.

0.2.15

3 years ago

Changes since 0.2.14

  • Cleaned out useless @param and @return annotations that didn't provide any information not already visible from native types.
  • Code is now analysed using PHPStan level 8 and phpstan-strict-rules.
  • NBTStream->read() now throws UnexpectedValueException instead of InvalidArgumentException when encountering a TAG_End at the beginning of a NBT buffer.
  • NBTStream->readCompressed() now throws UnexpectedValueException() on decompression failures instead of passing false to read() and exploding things.
  • Fixed some issues with NBTStream::fromArray() and NBTStream::toArray() mishandling IntArrayTags.
  • CompoundTag and ListTag now throw OutOfBoundsException when calling current() or key() when their iterators are invalid.

0.2.13

4 years ago

Changes since 0.2.12

  • Fixed loss of data when zero-length keys are used in TAG_Compound.
  • An error is now thrown when repeated keys are detected in a TAG_Compound during decoding.
  • Now scanned by PHPStan level 5.

0.2.12

4 years ago

Changes since 0.2.11

  • Fixed asymmetrical behaviour of NBTStream->read() and NBTStream->write() with non-compound root tags. These had never been seen before Minecraft Bedrock 1.13.

0.2.11

4 years ago

Changes since 0.2.10

  • NBTStream->get() now throws BinaryDataException when there are not enough bytes left to read.
  • Fixed incorrect parameter documentation for CompoundTag->getTag().

0.2.10

4 years ago

Changes since 0.2.9

  • Fixed automatic type inference applying to quoted strings (values inside quotes should always be considered strings).

0.2.9

4 years ago

Changes since 0.2.8

  • pocketmine/binaryutils ^0.1.9 is now required.
  • Fixed bugs in some unit tests.

0.2.8

4 years ago

Changes since 0.2.7

  • Now tested on PHP 7.3 and 7.4 snapshots.
  • Fixed compatibility with 7.4 (use of deprecated features).

0.2.7

4 years ago

Changes since 0.2.6

  • NBTStream->read() now supports an optional $maxDepth parameter.

0.2.6

5 years ago

Changes since 0.2.5

  • JsonNbtParser now throws more specific exceptions.
  • NBTStream->read() now accepts a reference $offset parameter which can be used to start reading from a specific point in a string payload.
  • Tag names are now explicitly limited to 32767 bytes. Previously this was allowed but would crash when attempting to encode.

0.2.5

5 years ago

Changes since 0.2.4

  • Decoding no longer silently stops when encountering unexpected end-of-stream. This might cause new errors to be thrown on bad data (EOF case is currently not explicitly handled when reading).