Class PaperDialogActionBuilder
java.lang.Object
io.github.projectunified.unidialog.paper.action.PaperDialogActionBuilder
- All Implemented Interfaces:
AdventureDialogActionBuilder<PaperDialog<?>,
,PaperDialogActionBuilder> AdventureSupport
,DialogActionBuilder<PaperDialog<?>,
PaperDialogActionBuilder>
public class PaperDialogActionBuilder
extends Object
implements AdventureDialogActionBuilder<PaperDialog<?>,PaperDialogActionBuilder>
-
Field Summary
Fields inherited from interface io.github.projectunified.unidialog.core.action.DialogActionBuilder
DEFAULT_WIDTH
-
Constructor Summary
ConstructorsConstructorDescriptionPaperDialogActionBuilder
(String defaultNamespace, Function<String, net.kyori.adventure.text.Component> componentDeserializer) -
Method Summary
Modifier and TypeMethodDescriptioncopyToClipboard
(String value) Set the action to be a copy-to-clipboard actiondynamicCustom
(String id) Set the action to be a dynamic custom actiondynamicCustom
(String namespace, String id) Set the action to be a dynamic custom action with a namespacedynamicRunCommand
(String template) Set the action to be a dynamic run command actionio.papermc.paper.registry.data.dialog.ActionButton
Get the deserializer function that converts a string to aComponent
label
(net.kyori.adventure.text.Component label) Set the label for the dialog actionSet the action to be an open-URL actionrunCommand
(String command) Set the action to be a run command actionshowDialog
(DialogOpener dialogOpener) Set the action to be a show dialog actionshowDialog
(PaperDialog<?> dialog) Set the action to be a show dialog actionshowDialog
(String namespace, String dialogId) Set the action to be a show dialog actionsuggestCommand
(String command) Set the action to be a suggest command actiontooltip
(@Nullable net.kyori.adventure.text.Component tooltip) Set the tooltip for the dialog actionwidth
(int width) Set the width for the dialog actionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.projectunified.unidialog.adventure.action.AdventureDialogActionBuilder
label, tooltip
Methods inherited from interface io.github.projectunified.unidialog.adventure.support.AdventureSupport
deserialize
-
Constructor Details
-
PaperDialogActionBuilder
-
-
Method Details
-
label
Description copied from interface:AdventureDialogActionBuilder
Set the label for the dialog action- Specified by:
label
in interfaceAdventureDialogActionBuilder<PaperDialog<?>,
PaperDialogActionBuilder> - Parameters:
label
- the label to set- Returns:
- the current instance of the builder for method chaining
-
tooltip
public PaperDialogActionBuilder tooltip(@Nullable @Nullable net.kyori.adventure.text.Component tooltip) Description copied from interface:AdventureDialogActionBuilder
Set the tooltip for the dialog action- Specified by:
tooltip
in interfaceAdventureDialogActionBuilder<PaperDialog<?>,
PaperDialogActionBuilder> - Parameters:
tooltip
- the tooltip to set, can be null- Returns:
- the current instance of the builder for method chaining
-
getComponentDeserializer
Description copied from interface:AdventureSupport
Get the deserializer function that converts a string to aComponent
- Specified by:
getComponentDeserializer
in interfaceAdventureSupport
- Returns:
- the function that deserializes a string into a Component
-
width
Description copied from interface:DialogActionBuilder
Set the width for the dialog action- Specified by:
width
in interfaceDialogActionBuilder<PaperDialog<?>,
PaperDialogActionBuilder> - Parameters:
width
- the width to set- Returns:
- the current instance of the builder for method chaining
-
copyToClipboard
Description copied from interface:DialogActionBuilder
Set the action to be a copy-to-clipboard action- Specified by:
copyToClipboard
in interfaceDialogActionBuilder<PaperDialog<?>,
PaperDialogActionBuilder> - Parameters:
value
- the value to copy to the clipboard- Returns:
- the current instance of the builder for method chaining
-
dynamicCustom
Description copied from interface:DialogActionBuilder
Set the action to be a dynamic custom action- Specified by:
dynamicCustom
in interfaceDialogActionBuilder<PaperDialog<?>,
PaperDialogActionBuilder> - Parameters:
id
- the identifier for the dynamic custom action- Returns:
- the current instance of the builder for method chaining
-
dynamicCustom
Description copied from interface:DialogActionBuilder
Set the action to be a dynamic custom action with a namespace- Specified by:
dynamicCustom
in interfaceDialogActionBuilder<PaperDialog<?>,
PaperDialogActionBuilder> - Parameters:
namespace
- the namespace for the dynamic custom actionid
- the identifier for the dynamic custom action- Returns:
- the current instance of the builder for method chaining
-
dynamicRunCommand
Description copied from interface:DialogActionBuilder
Set the action to be a dynamic run command action- Specified by:
dynamicRunCommand
in interfaceDialogActionBuilder<PaperDialog<?>,
PaperDialogActionBuilder> - Parameters:
template
- the command template to run- Returns:
- the current instance of the builder for method chaining
-
openUrl
Description copied from interface:DialogActionBuilder
Set the action to be an open-URL action- Specified by:
openUrl
in interfaceDialogActionBuilder<PaperDialog<?>,
PaperDialogActionBuilder> - Parameters:
url
- the URL to open- Returns:
- the current instance of the builder for method chaining
-
runCommand
Description copied from interface:DialogActionBuilder
Set the action to be a run command action- Specified by:
runCommand
in interfaceDialogActionBuilder<PaperDialog<?>,
PaperDialogActionBuilder> - Parameters:
command
- the command to run- Returns:
- the current instance of the builder for method chaining
-
suggestCommand
Description copied from interface:DialogActionBuilder
Set the action to be a suggest command action- Specified by:
suggestCommand
in interfaceDialogActionBuilder<PaperDialog<?>,
PaperDialogActionBuilder> - Parameters:
command
- the command to suggest- Returns:
- the current instance of the builder for method chaining
-
showDialog
Description copied from interface:DialogActionBuilder
Set the action to be a show dialog action- Specified by:
showDialog
in interfaceDialogActionBuilder<PaperDialog<?>,
PaperDialogActionBuilder> - Parameters:
dialog
- the dialog to show- Returns:
- the current instance of the builder for method chaining
-
showDialog
Description copied from interface:DialogActionBuilder
Set the action to be a show dialog action- Specified by:
showDialog
in interfaceDialogActionBuilder<PaperDialog<?>,
PaperDialogActionBuilder> - Parameters:
namespace
- the namespace of the dialogdialogId
- the identifier of the dialog to show- Returns:
- the current instance of the builder for method chaining
-
showDialog
Description copied from interface:DialogActionBuilder
Set the action to be a show dialog action- Specified by:
showDialog
in interfaceDialogActionBuilder<PaperDialog<?>,
PaperDialogActionBuilder> - Parameters:
dialogOpener
- the dialog opener to use for showing the dialog- Returns:
- the current instance of the builder for method chaining
-
getAction
public io.papermc.paper.registry.data.dialog.ActionButton getAction()
-