Class ScreenRegistry
java.lang.Object
net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry
Deprecated.
An API for registering handled screens that represent screen handlers on the client.
Exposes vanilla's private
HandledScreens.register()
to modders as ScreenRegistry.register()
.
Example
// In a client-side initialization method:
ScreenRegistry.register(MyScreenHandlers.OVEN, OvenScreen::new);
// Screen class
public class OvenScreen extends HandledScreen<OvenScreenHandler> {
public OvenScreen(OvenScreenHandler handler, PlayerInventory inventory, Text title) {
super(handler, inventory, title);
}
}
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
ScreenRegistry.Factory<H extends ScreenHandler,
S extends Screen & ScreenHandlerProvider<H>> Deprecated.A factory for handled screens. -
Method Summary
Modifier and TypeMethodDescriptionstatic <H extends ScreenHandler,
S extends Screen & ScreenHandlerProvider<H>>
voidregister
(ScreenHandlerType<? extends H> type, ScreenRegistry.Factory<H, S> screenFactory) Deprecated.Registers a new screen factory for a screen handler type.
-
Method Details
-
register
public static <H extends ScreenHandler,S extends Screen & ScreenHandlerProvider<H>> void register(ScreenHandlerType<? extends H> type, ScreenRegistry.Factory<H, S> screenFactory) Deprecated.Registers a new screen factory for a screen handler type.- Type Parameters:
H
- the screen handler typeS
- the screen type- Parameters:
type
- the screen handler type objectscreenFactory
- the screen handler factory
-
HandledScreens.register(ScreenHandlerType, HandledScreens.Provider)
andinvalid @link