Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-137934

"Argument range" class has typo in JsonObject serialization

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 18w44a
    • Minecraft 18w43b
    • None
    • Confirmed

      Low priority, probably, but should be simple to fix.

      There's a class in Minecraft 18w43b which seems to provide number ranges, with integer and float subclasses. ("bc" obfuscated, you can probably find it by the "argument.range.empty" SimpleCommandExceptionType).

      In that class, there's a method which outputs a JsonElement ("d"). Said method's logic can be modeled roughly as follows:

              final JsonObject v1 = new JsonObject();
              if (this.min != null) {
                  v1.addProperty("min", (Number)this.min);
              }
              if (this.max != null) {
                  v1.addProperty("max", (Number)this.min);
              }
      

      The second addProperty call seems to be setting "max" to this.min, whereas this.max is probably correct judging by context.

      Essentially, a bit of code looking like

      v1.addProperty("max", (Number)this.min);
      

      should probably look more like

      v1.addProperty("max", (Number)this.max);
      

            boq [Mojang] Bartosz Bok
            asie Adrian Siekierka
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: