Skip to content

Releases: pmmp/NBT

0.2.4

04 Jan 15:47
Compare
Choose a tag to compare

Changes since 0.2.3

  • Import global constants and functions for enhanced performance. This may have substantial effects on runtime performance. Make sure you sync the pocketmine/binaryutils dependency to get full effect.

0.2.3

03 Dec 16:12
Compare
Choose a tag to compare

Changes since 0.2.2

  • Make dynamic field errors include the field name which attempted to be accessed
  • Fixed missing zlib dependency from composer.json

0.2.2

03 Dec 16:10
Compare
Choose a tag to compare

Changes since 0.2.1

  • Fixed CompoundTag and ListTag tags not showing their names when stringified

0.2.1

04 Sep 10:41
Compare
Choose a tag to compare

Changes since 0.2.0

  • Added CompoundTag->merge() function.
  • Fixed CompoundTag children with numeric string keys causing errors on iteration due to PHP array key casting stupidity.

0.2.0

13 Jun 09:59
Compare
Choose a tag to compare

Changes since 0.1.0

  • Now requires pocketmine/binaryutils ^0.1.0.
  • Now requires php-64bit in composer.json.

0.1.0

13 Apr 18:25
Compare
Choose a tag to compare

Changes since 0.0.1

General changes

  • Package name has changed from pocketmine/pocketmine-nbt to pocketmine/nbt.
  • EndTag and Tag classes have been removed. All remaining tags now extend NamedTag.
  • NamedTag objects no longer extend from \stdClass.
  • NamedTag->getValue() no longer returns a reference.
  • NamedTag->setValue() has been removed. Prefer creating new tag objects instead.
  • Added NamedTag->equals() to permit comparing two arbitrary tag objects.
  • NamedTag->__toString() and subclass methods have been improved to the point of actually being readable.

CompoundTag changes

  • Dynamic field API for accessing compound children has been removed (e.g. tag->SomeTag = new ..., isset(tag->SomeTag), unset(tag->SomeTag), var_dump(tag->SomeTag)). Attempting to access compound children using this API will now throw exceptions.
  • Array-access API write no longer accepts primitive values - NamedTag objects only.
  • tag[] = childTag syntax is no longer permitted and will throw an exception (the behaviour of this was previously undefined).
  • Now implements the \Iterator and \Countable interfaces.
  • Recursive tag references are now detected when cloning tags and will cause an exception to be thrown, instead of looping forever cloning.

ListTag changes

  • Now have several new API methods for accessing: push(), pop(), shift(), unshift(), insert(), remove(), get(), set(), first(), last(), isset() and empty().
  • Dynamic field API for accessing list members is also no longer supported and will throw exceptions.
  • tag[] = newTag syntax is now supported (will append to the end of the list).
  • List type is now auto-detected when inserting the first tag into an empty list.
  • All tags added to the list are now type-checked. Attempting to insert a tag of incorrect type into a non-empty list will throw a \TypeError.
  • Now implements the \Iterator interface.
  • Recursive tag references are now detected when cloning tags and will cause an exception to be thrown, instead of looping forever cloning.

StringTag changes

  • Values larger than 32767 bytes are no longer permitted (previously this would silently cause data corruption).

NBT changes

  • BIG_ENDIAN and LITTLE_ENDIAN constants have been removed.
  • matchList() and matchTree() have been removed. Prefer NamedTag->equals() instead.

NBTStream changes

  • read() and readCompressed() now directly return the decoded NBT instead, eliminating calls to getData().
  • write() and writeCompressed() now directly accept NamedTag parameters instead, eliminating calls to setData().
  • getData() and setData() have been removed. NBTStream objects no longer retain references to their decoded data.

JSON NBT parser changes

  • JsonNBTParser has been renamed to JsonNbtParser.
  • JsonNbtParser->parseJSON() has been renamed to parseJson().
  • Fixed several bugs with spaces with regards to string handling.
  • Quoting keys is now properly supported.