Interface FabricScreenHandlerFactory
public interface FabricScreenHandlerFactory
An extension to
NamedScreenHandlerFactory
.
Unlike ExtendedScreenHandlerFactory
, this can be used by any screen
handlers, and is implemented via interface injection.-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Returns whether the server should sendCloseScreenS2CPacket
when opening the screen.
-
Method Details
-
shouldCloseCurrentScreen
default boolean shouldCloseCurrentScreen()Returns whether the server should sendCloseScreenS2CPacket
when 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
CloseScreenS2CPacket
when opening the screen
-