Class ForcedFailure

java.lang.Object
dev.xichil.mvui.ForcedFailure

public final class ForcedFailure extends Object
Test switch for the fail-safe paths (D9): with -Dxis_mvui.forceError=true every backend hook that calls check(String) fails as if Minecraft had changed under it, so integration tests can show that the game and sync keep working without the menu. Mod authors can use it the same way, to see that their mod copes when the library's menus are off. Not for production use.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The system property, "xis_mvui.forceError": launch with -Dxis_mvui.forceError=true to make every hook fail.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    check(String hook)
    Throws if the switch is on; backends call it at the start of each hook, inside Failsafe's guard.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • PROPERTY

      public static final String PROPERTY
      The system property, "xis_mvui.forceError": launch with -Dxis_mvui.forceError=true to make every hook fail.
      See Also:
  • Method Details

    • check

      public static void check(String hook)
      Throws if the switch is on; backends call it at the start of each hook, inside Failsafe's guard.
      Parameters:
      hook - names the failing hook in the error, e.g. "OptionsScreen.init"
      Throws:
      IllegalStateException - if -Dxis_mvui.forceError=true