()
| 453 | } |
| 454 | |
| 455 | public NBTBase parse() throws NBTException |
| 456 | { |
| 457 | try |
| 458 | { |
| 459 | if (DOUBLE.matcher(this.jsonValue).matches()) |
| 460 | { |
| 461 | return new NBTTagDouble(Double.parseDouble(this.jsonValue.substring(0, this.jsonValue.length() - 1))); |
| 462 | } |
| 463 | |
| 464 | if (FLOAT.matcher(this.jsonValue).matches()) |
| 465 | { |
| 466 | return new NBTTagFloat(Float.parseFloat(this.jsonValue.substring(0, this.jsonValue.length() - 1))); |
| 467 | } |
| 468 | |
| 469 | if (BYTE.matcher(this.jsonValue).matches()) |
| 470 | { |
| 471 | return new NBTTagByte(Byte.parseByte(this.jsonValue.substring(0, this.jsonValue.length() - 1))); |
| 472 | } |
| 473 | |
| 474 | if (LONG.matcher(this.jsonValue).matches()) |
| 475 | { |
| 476 | return new NBTTagLong(Long.parseLong(this.jsonValue.substring(0, this.jsonValue.length() - 1))); |
| 477 | } |
| 478 | |
| 479 | if (SHORT.matcher(this.jsonValue).matches()) |
| 480 | { |
| 481 | return new NBTTagShort(Short.parseShort(this.jsonValue.substring(0, this.jsonValue.length() - 1))); |
| 482 | } |
| 483 | |
| 484 | if (INTEGER.matcher(this.jsonValue).matches()) |
| 485 | { |
| 486 | return new NBTTagInt(Integer.parseInt(this.jsonValue)); |
| 487 | } |
| 488 | |
| 489 | if (DOUBLE_UNTYPED.matcher(this.jsonValue).matches()) |
| 490 | { |
| 491 | return new NBTTagDouble(Double.parseDouble(this.jsonValue)); |
| 492 | } |
| 493 | |
| 494 | if (this.jsonValue.equalsIgnoreCase("true") || this.jsonValue.equalsIgnoreCase("false")) |
| 495 | { |
| 496 | return new NBTTagByte((byte)(Boolean.parseBoolean(this.jsonValue) ? 1 : 0)); |
| 497 | } |
| 498 | } |
| 499 | catch (NumberFormatException var6) |
| 500 | { |
| 501 | this.jsonValue = this.jsonValue.replaceAll("\\\\\"", "\""); |
| 502 | return new NBTTagString(this.jsonValue); |
| 503 | } |
| 504 | |
| 505 | if (this.jsonValue.startsWith("[") && this.jsonValue.endsWith("]")) |
| 506 | { |
| 507 | String s = this.jsonValue.substring(1, this.jsonValue.length() - 1); |
| 508 | String[] astring = Iterables.toArray(SPLITTER.split(s), String.class); |
| 509 | |
| 510 | try |
| 511 | { |
| 512 | int[] aint = new int[astring.length]; |
nothing calls this directly
no test coverage detected