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

"Argument range" class has typo in JsonObject serialization

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 18w43b
    • Fix Version/s: Minecraft 18w44a
    • Labels:
      None
    • Confirmation Status:
      Confirmed

      Description

      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);
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                CHK: