Class GuiHooks
java.lang.Object
com.thecsdev.commonmc.api.client.hooks.GuiHooks
Utility methods for hooking into GUI-related activities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic final voidregisterVanillaButtonMod(@NotNull Class<? extends net.minecraft.client.gui.screens.Screen> screen, @NotNull net.minecraft.network.chat.Component btnText, @NotNull BiConsumer<net.minecraft.client.gui.components.Button, Runnable> btnOnClickSupplier) Registers a modification of aButton's on-click functionality on for given vanillaScreen.
-
Method Details
-
registerVanillaButtonMod
public static final void registerVanillaButtonMod(@NotNull @NotNull Class<? extends net.minecraft.client.gui.screens.Screen> screen, @NotNull @NotNull net.minecraft.network.chat.Component btnText, @NotNull @NotNull BiConsumer<net.minecraft.client.gui.components.Button, Runnable> btnOnClickSupplier) throws NullPointerException, IllegalArgumentException Registers a modification of aButton's on-click functionality on for given vanillaScreen.- Parameters:
screen- TheScreenwhere theButtonis located.btnText- The text of the targeted button.btnOnClickSupplier- TheBiConsumerwhose inputs are theButtoninstance and its current (now old) on-clickRunnable.- Throws:
NullPointerException- If an argument isnull.IllegalArgumentException- If the providedClassisabstract.
-