Hi, I'm back :)
When using a boolean option, the game crashes with IllegalConfigException: Default value "true" for "shouldRecord" in "ShootPlayerClip" does not conform to it's constraints
Using this part for a config:
@Configurable("shoot_player_clip")
public class ShootPlayerClip extends Clip {
public static final Identifier ID = Identifier.of(Autocut.MOD_ID, "shoot_player");
@Configurable(value = "default_start_offset", min = 0)
public static long defaultStartOffset = 100;
@Configurable(value = "default_end_offset", min = 0)
public static long defaultEndOffset = 100;
@Configurable("should_record")
public static boolean shouldRecord = true;
//...
}
Generates this:
package com.bawnorton.configurable.client.autocut;
import java.lang.Long;
import java.lang.Boolean;
import com.skycatdev.autocut.clips.ShootPlayerClip;
import com.bawnorton.configurable.generated.GeneratedConfig;
import com.bawnorton.configurable.ref.constraint.*;
import com.bawnorton.configurable.ref.Reference;
public final class Config implements GeneratedConfig {
public final ShootPlayerClipConfig shoot_player_clip = new ShootPlayerClipConfig();
public static class ShootPlayerClipConfig {
public final Reference<Long> default_end_offset = new Reference<>("defaultEndOffset", ShootPlayerClip.class, long.class, ConstraintSet.builder().addClamped(0.0, 100.0));
public final Reference<Long> default_start_offset = new Reference<>("defaultStartOffset", ShootPlayerClip.class, long.class, ConstraintSet.builder().addClamped(0.0, 100.0));
public final Reference<Boolean> should_record = new Reference<>("shouldRecord", ShootPlayerClip.class, boolean.class, ConstraintSet.builder().addClamped(0.0, 100.0));
}
}
It looks like the crash is because of the ConstraintSet.build().addClamped(...) not liking the boolean.
Hi, I'm back :) When using a boolean option, the game crashes with
IllegalConfigException: Default value "true" for "shouldRecord" in "ShootPlayerClip" does not conform to it's constraints
Using this part for a config:
Generates this:
It looks like the crash is because of the
ConstraintSet.build().addClamped(...)
not liking the boolean.Log: https://mclo.gs/5oItJYq Crash log: https://mclo.gs/zVWBA38
Let me know if you would like any more information 👍