diff --git a/nbt/snbt_scanner.go b/nbt/snbt_scanner.go index 9277f9a..437625c 100644 --- a/nbt/snbt_scanner.go +++ b/nbt/snbt_scanner.go @@ -115,9 +115,9 @@ func stateBeginValue(s *scanner, c byte) int { return s.pushParseState(c, parseListValue, scanBeginList) case '"', '\'': // beginning of TAG_String return stateBeginString(s, c) - case '-': // beginning of negative number - s.step = stateNeg - return scanBeginLiteral + //case '-': // beginning of negative number + //s.step = stateNeg + //return scanBeginLiteral default: if isNumber(c) { stateNum0(s, c) diff --git a/nbt/snbt_scanner_test.go b/nbt/snbt_scanner_test.go index c241943..f6c26d5 100644 --- a/nbt/snbt_scanner_test.go +++ b/nbt/snbt_scanner_test.go @@ -43,12 +43,16 @@ func TestSNBT_number(t *testing.T) { //go:embed bigTest_test.snbt var bigTestSNBT string +//go:embed 1-dimension_codec.snbt +var dimensionCodecSNBT string + func TestSNBT_compound(t *testing.T) { goods := []string{ `{}`, `{name:3.14f}`, `{ "name" : 12345 }`, `{ abc: { }}`, `{ "a b\"c": {}, def: 12345}`, `{ ghi: [], klm: 1}`, bigTestSNBT, + dimensionCodecSNBT, } var s scanner for _, str := range goods {