Mojira Archive
MC-137934

"Argument range" class has typo in JsonObject serialization

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

Fixed

Adrian Siekierka

[Mojang] Bartosz Bok

2018-10-25, 07:40 PM

2018-10-30, 11:24 AM

2018-10-30, 11:24 AM

2

1

Confirmed

Minecraft 18w43b

Minecraft 18w44a