java.lang.Object
com.hammy275.immersivemc.client.config.screen.ScreenUtils

public class ScreenUtils extends Object
  • Constructor Details

    • ScreenUtils

      public ScreenUtils()
  • Method Details

    • createIntSlider

      public static net.minecraft.client.OptionInstance<Integer> createIntSlider(String titleTranslationKey, Function<Integer,net.minecraft.network.chat.Component> displayTextCreator, int minValue, int maxValue, Supplier<Integer> valueGetter, Consumer<Integer> valueSetter)
    • createOption

      public static net.minecraft.client.OptionInstance<Boolean> createOption(String keyName, Function<ActiveConfig,Boolean> valueGetter, BiConsumer<ActiveConfig,Boolean> valueSetter)
    • createOption

      public static net.minecraft.client.OptionInstance<Boolean> createOption(String keyName, @Nullable @Nullable net.minecraft.network.chat.Component tooltip, Supplier<Boolean> getter, Consumer<Boolean> setter)
    • createEnumOption

      public static <E extends Enum<E>> net.minecraft.client.OptionInstance<E> createEnumOption(Class<E> enumClass, String titleTranslationKey, Function<E,net.minecraft.network.chat.Component> displayTextCreator, Function<E,net.minecraft.network.chat.Component> tooltipTextCreator, Supplier<E> valueGetter, BiConsumer<Integer,E> valueSetter)
    • createScreenButton

      public static net.minecraft.client.gui.components.Button createScreenButton(int x, int y, int width, int height, String translationString, net.minecraft.client.gui.screens.Screen screen)
    • createDoneButton

      public static net.minecraft.client.gui.components.Button createDoneButton(int x, int y, int width, int height, net.minecraft.client.gui.screens.Screen currentScreen)
    • createButton

      public static net.minecraft.client.gui.components.Button createButton(int x, int y, int width, int height, String translationString, Consumer<net.minecraft.client.gui.components.Button> clickHandler)
    • createButton

      public static net.minecraft.client.gui.components.Button createButton(int x, int y, int width, int height, String translationString, String tooltipTranslationString, Consumer<net.minecraft.client.gui.components.Button> clickHandler)
    • addOptionIfModLoaded

      public static void addOptionIfModLoaded(String modId, String keyName, Function<ActiveConfig,Boolean> valueGetter, BiConsumer<ActiveConfig,Boolean> valueSetter, net.minecraft.client.gui.components.OptionsList list)
    • addOption

      public static void addOption(String keyName, Function<ActiveConfig,Boolean> valueGetter, BiConsumer<ActiveConfig,Boolean> valueSetter, net.minecraft.client.gui.components.OptionsList list)
    • addOptionIfClient

      public static void addOptionIfClient(String keyName, Function<ClientActiveConfig,Boolean> valueGetter, BiConsumer<ClientActiveConfig,Boolean> valueSetter, net.minecraft.client.gui.components.OptionsList list)
    • mouseInBox

      public static boolean mouseInBox(int mouseX, int mouseY, int leftX, int bottomY, int rightX, int topY)