Interface FabricScreenHandlerFactory
public interface FabricScreenHandlerFactory
An extension to
MenuProvider.
Unlike ExtendedScreenHandlerFactory, this can be used by any screen
handlers, and is implemented via interface injection.-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanReturns whether the server should sendClientboundContainerClosePacketwhen opening the screen.
-
Method Details
-
shouldCloseCurrentScreen
default boolean shouldCloseCurrentScreen()Returns whether the server should sendClientboundContainerClosePacketwhen opening the screen.In vanilla, opening a new screen will always send the close screen packet. This, among other things, causes the mouse cursor to move to the center of the screen, which might not be expected in some cases. If this returns
false, the packet is not sent to the client, stopping the behavior.- Returns:
- whether the server should send
ClientboundContainerClosePacketwhen opening the screen
-