Anuken/Mindustry · error · RuntimeException

Unknown operation '${op}', check PartProgress class for a li

Error message

Unknown operation '${op}', check PartProgress class for a list of methods.

What it means

parseProgressOp() applies a named transformation to a PartProgress value (inv, slope, clamp, delay, sustain, shorten, compress, add, blend, mul, min, sin, absin, mod, loop, curve). An unrecognized op string hits the default branch; the message directs the author to the PartProgress class for the canonical method list.

Source

Thrown at core/src/mindustry/mod/ContentParser.java:1178

        //I have to hard-code this, no easy way of getting parameter names, unfortunately
        return switch(op){
            case "inv" -> base.inv();
            case "slope" -> base.slope();
            case "clamp" -> base.clamp();
            case "delay" -> base.delay(data.getFloat("amount"));
            case "sustain" -> base.sustain(data.getFloat("offset", 0f), data.getFloat("grow", 0f), data.getFloat("sustain"));
            case "shorten" -> base.shorten(data.getFloat("amount"));
            case "compress" -> base.compress(data.getFloat("start"), data.getFloat("end"));
            case "add" -> data.has("amount") ? base.add(data.getFloat("amount")) : base.add(parser.readValue(PartProgress.class, data.get("other")));
            case "blend" -> base.blend(parser.readValue(PartProgress.class, data.get("other")), data.getFloat("amount"));
            case "mul" -> data.has("amount") ? base.mul(data.getFloat("amount")) : base.mul(parser.readValue(PartProgress.class, data.get("other")));
            case "min" -> base.min(parser.readValue(PartProgress.class, data.get("other")));
            case "sin" -> base.sin(data.has("offset") ? data.getFloat("offset") : 0f, data.getFloat("scl"), data.getFloat("mag"));
            case "absin" -> base.absin(data.getFloat("scl"), data.getFloat("mag"));
            case "mod" -> base.mod(data.getFloat("amount"));
            case "loop" -> base.loop(data.getFloat("time"));
            case "curve" -> data.has("interp") ? base.curve(parser.readValue(Interp.class, data.get("interp"))) : base.curve(data.getFloat("offset"), data.getFloat("duration"));
            default -> throw new RuntimeException("Unknown operation '" + op + "', check PartProgress class for a list of methods.");
        };
    }

    <T> T make(Class<T> type){
        try{
            Constructor<T> cons = type.getDeclaredConstructor();
            cons.setAccessible(true);
            return cons.newInstance();
        }catch(Exception e){
            throw new RuntimeException(e);
        }
    }

    private <T> T make(Class<T> type, String name){
        try{
            Constructor<T> cons = type.getDeclaredConstructor(String.class);
            cons.setAccessible(true);
            return cons.newInstance(name);

View on GitHub (pinned to f695ad7e60)

Solutions

  1. Use one of the supported ops: inv, slope, clamp, delay, sustain, shorten, compress, add, blend, mul, min, sin, absin, mod, loop, curve.
  2. Cross-check against the PartProgress class methods.
  3. Supply any required parameters (amount, scl, mag, etc.) for the chosen op.

Example fix

// before
{ "op": "ease", "amount": 0.5 }
// after
{ "op": "clamp", "amount": 0.5 }
Defensive patterns

Strategy: validation

Validate before calling

Set<String> ops = Set.of("inv","slope","clamp","delay","sustain","shorten","compress","add","blend","mul","min","sin","absin","mod","loop","curve");
if(!ops.contains(op)) throw new IllegalStateException("Unsupported PartProgress op '" + op + "'");

Prevention

When it happens

Trigger: A progress operation name in a unit/block part JSON does not match any case in the switch (e.g. "ease", "lerp", "wave").

Common situations: Guessing an op name; using a name from a different build; typo.

Related errors


AI-assisted analysis of Anuken/Mindustry@f695ad7e60 (2026-08-14). Data as JSON: /api/errors/04191504d14ed756. Report an issue: GitHub.