Record Class ViaDialogOpener
java.lang.Object
java.lang.Record
io.github.projectunified.unidialog.viaversion.opener.ViaDialogOpener
- All Implemented Interfaces:
DialogOpener
A ViaVersion-based implementation of
DialogOpener for opening dialogs.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanclearDialog(com.viaversion.viaversion.api.connection.UserConnection connection) Clear the dialog for a user connection, automatically determining the phase from the connection statestatic booleanclearDialog(com.viaversion.viaversion.api.connection.UserConnection connection, boolean configuration) Clear the dialog for a user connectionViaDialog<?> dialog()Get the dialog held by this openerfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanopen(com.viaversion.viaversion.api.connection.UserConnection connection) Open the dialog for a user connection, automatically determining the phase from the connection statebooleanopen(com.viaversion.viaversion.api.connection.UserConnection connection, boolean configuration, com.viaversion.viaversion.api.protocol.version.ProtocolVersion baseVersion, com.viaversion.viaversion.api.protocol.version.ProtocolVersion targetVersion) Open the dialog for a user connection, using the given base and target versionsbooleanopen(com.viaversion.viaversion.api.connection.UserConnection connection, com.viaversion.viaversion.api.protocol.version.ProtocolVersion baseVersion, com.viaversion.viaversion.api.protocol.version.ProtocolVersion targetVersion) Open the dialog for a user connection, using the given base and target versions and automatically determining the phase from the connection statebooleanOpen the dialog for the given player UUIDbooleanopen(UUID uuid, com.viaversion.viaversion.api.protocol.version.ProtocolVersion baseVersion, com.viaversion.viaversion.api.protocol.version.ProtocolVersion targetVersion) Open the dialog for the given player, using the given base and target versionsfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ViaDialogOpener
Constructor for ViaDialogOpener- Parameters:
dialog- the dialog to open
-
-
Method Details
-
clearDialog
public static boolean clearDialog(com.viaversion.viaversion.api.connection.UserConnection connection, boolean configuration) Clear the dialog for a user connection- Parameters:
connection- the user connectionconfiguration- if true, clears the configuration-phase dialog; if false, the play-phase dialog- Returns:
- true if the clear packet was sent, false otherwise
-
clearDialog
public static boolean clearDialog(com.viaversion.viaversion.api.connection.UserConnection connection) Clear the dialog for a user connection, automatically determining the phase from the connection state- Parameters:
connection- the user connection- Returns:
- true if the clear packet was sent, false otherwise
-
dialog
Get the dialog held by this opener- Returns:
- the dialog
-
open
public boolean open(com.viaversion.viaversion.api.connection.UserConnection connection, boolean configuration, com.viaversion.viaversion.api.protocol.version.ProtocolVersion baseVersion, com.viaversion.viaversion.api.protocol.version.ProtocolVersion targetVersion) Open the dialog for a user connection, using the given base and target versions- Parameters:
connection- the user connectionconfiguration- if true, sends the configuration-phase dialog; if false, the play-phase dialogbaseVersion- the protocol version of the server the dialog is created fortargetVersion- the protocol version of the player the dialog is sent to- Returns:
- true if the dialog was sent, false otherwise
-
open
public boolean open(com.viaversion.viaversion.api.connection.UserConnection connection, com.viaversion.viaversion.api.protocol.version.ProtocolVersion baseVersion, com.viaversion.viaversion.api.protocol.version.ProtocolVersion targetVersion) Open the dialog for a user connection, using the given base and target versions and automatically determining the phase from the connection state- Parameters:
connection- the user connectionbaseVersion- the protocol version of the server the dialog is created fortargetVersion- the protocol version of the player the dialog is sent to- Returns:
- true if the dialog was sent, false otherwise
-
open
public boolean open(UUID uuid, com.viaversion.viaversion.api.protocol.version.ProtocolVersion baseVersion, com.viaversion.viaversion.api.protocol.version.ProtocolVersion targetVersion) Open the dialog for the given player, using the given base and target versions- Parameters:
uuid- the UUID of the player to open the dialog forbaseVersion- the protocol version of the server the dialog is created fortargetVersion- the protocol version of the player the dialog is sent to- Returns:
- true if the dialog was sent, false otherwise
-
open
public boolean open(com.viaversion.viaversion.api.connection.UserConnection connection) Open the dialog for a user connection, automatically determining the phase from the connection state- Parameters:
connection- the user connection- Returns:
- true if the dialog was sent, false otherwise
-
open
Description copied from interface:DialogOpenerOpen the dialog for the given player UUID- Specified by:
openin interfaceDialogOpener- Parameters:
uuid- the UUID of the player to open the dialog for- Returns:
- true if the dialog was opened successfully, false otherwise
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object).
-