Repository navigation
Behavior changes
- Numbers outside the range of their type now throw
SNBTParseException, for example300b,1.5band1e400. - Tag constructors and
intsToUuid()now throwSNBTInvalidArgumentExceptionfor values outside the range, and forINFandNaN. - Unquoted values such as
0x1F,0b101and1_000are now numbers, not strings. CompoundTag::getIterator()returns\Iterator, not\ArrayIterator. All keys are strings.- Classes that extend
Tagmust add thebool $escapeControlCharactersparameter torender(). They must also add it toquote(),serializeKey()andtoSnbt()if they override them.
Added
- Typed getters on
CompoundTagandListTag:getString(),getInt(),getFloat(),getBool(),getCompound(),getList()andgetAs(). SNBTParser::parseCompound()returns aCompoundTag.Tag::fromPhp()makes tags from PHP values.with(),without()andwithAppended()return a changed copy of a compound or a list.SNBTParseExceptionhasposition,lineNumberandcolumnNumber.- The parser reads the Minecraft 1.21.5 syntax: hexadecimal and binary numbers,
_in numbers, the new string escapes, trailing commas, andbool()anduuid(). toSnbt(escapeControlCharacters: true)writes control characters as escapes.MINandMAXconstants on the integer tags, andNumberArrayTag::elementType().
Fixed
toSnbt()output with a line feed, a carriage return or a tab now parses on Minecraft 1.21.4 and earlier.- Every exception that the package throws implements
SNBTException. - Iterating a
CompoundTaggives string keys, also for numeric keys.
Package
- The package archive does not contain
composer.lock. composer.jsonsuggestsext-intl.
Full Changelog: v1.1.0...v1.2.0