Interface ConfigEffect
public interface ConfigEffect
Client only: an animated effect for config screens, drawn at any of three layers. Register it with
ConfigEffects.register(Identifier, ConfigEffect) and name its id in a theme (ConfigTheme.Builder.effects, or
ConfigBuilder.effects for one config):
// Client setup:
ConfigEffects.register(Identifier.fromNamespaceAndPath("mymod", "snow"), new SnowEffect());
// Anywhere, even common code:
Config.builder("mymod", ConfigScope.CLIENT).effects(Identifier.fromNamespaceAndPath("mymod", "snow"));
Every method is optional. They run every frame on the render thread, so they should be cheap; an effect that throws is
logged once and switched off. Players can turn every effect off, and the Fast graphics preset always does.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordThe screen being drawn.static final recordOne widget, its bounds in GUI pixels as drawn, and its state.static enumThe kinds of widgets effects are told about. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidextractBackground(net.minecraft.client.gui.GuiGraphicsExtractor graphics, ConfigEffect.Context context) Behind the panels, over the theme's background (its texture, or the blurred panorama or world).default voidextractForeground(net.minecraft.client.gui.GuiGraphicsExtractor graphics, ConfigEffect.Context context) Over the whole screen, panels and widgets included, but under tooltips.default voidextractWidget(net.minecraft.client.gui.GuiGraphicsExtractor graphics, ConfigEffect.WidgetContext context) Over one widget, just after it's drawn: buttons, toggles, sliders, text fields, cards and popup panels.
-
Method Details
-
extractBackground
default void extractBackground(net.minecraft.client.gui.GuiGraphicsExtractor graphics, ConfigEffect.Context context) Behind the panels, over the theme's background (its texture, or the blurred panorama or world). -
extractForeground
default void extractForeground(net.minecraft.client.gui.GuiGraphicsExtractor graphics, ConfigEffect.Context context) Over the whole screen, panels and widgets included, but under tooltips. -
extractWidget
default void extractWidget(net.minecraft.client.gui.GuiGraphicsExtractor graphics, ConfigEffect.WidgetContext context) Over one widget, just after it's drawn: buttons, toggles, sliders, text fields, cards and popup panels.
-