Releases: pmmp/NBT
Releases · pmmp/NBT
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.0
Changes since 0.0.1
General changes
- Package name has changed from
pocketmine/pocketmine-nbt
topocketmine/nbt
. EndTag
andTag
classes have been removed. All remaining tags now extendNamedTag
.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()
andempty()
. - 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
andLITTLE_ENDIAN
constants have been removed.matchList()
andmatchTree()
have been removed. PreferNamedTag->equals()
instead.
NBTStream
changes
read()
andreadCompressed()
now directly return the decoded NBT instead, eliminating calls togetData()
.write()
andwriteCompressed()
now directly accept NamedTag parameters instead, eliminating calls tosetData()
.getData()
andsetData()
have been removed.NBTStream
objects no longer retain references to their decoded data.
JSON NBT parser changes
JsonNBTParser
has been renamed toJsonNbtParser
.JsonNbtParser->parseJSON()
has been renamed toparseJson()
.- Fixed several bugs with spaces with regards to string handling.
- Quoting keys is now properly supported.