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.ActionButtonGet the deserializer function that converts a string to aComponentlabel(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, waitMethods inherited from interface io.github.projectunified.unidialog.adventure.action.AdventureDialogActionBuilder
label, tooltipMethods inherited from interface io.github.projectunified.unidialog.adventure.support.AdventureSupport
deserialize
-
Constructor Details
-
PaperDialogActionBuilder
-
-
Method Details
-
label
Description copied from interface:AdventureDialogActionBuilderSet the label for the dialog action- Specified by:
labelin 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:AdventureDialogActionBuilderSet the tooltip for the dialog action- Specified by:
tooltipin 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:AdventureSupportGet the deserializer function that converts a string to aComponent- Specified by:
getComponentDeserializerin interfaceAdventureSupport- Returns:
- the function that deserializes a string into a Component
-
width
Description copied from interface:DialogActionBuilderSet the width for the dialog action- Specified by:
widthin interfaceDialogActionBuilder<PaperDialog<?>,PaperDialogActionBuilder> - Parameters:
width- the width to set- Returns:
- the current instance of the builder for method chaining
-
copyToClipboard
Description copied from interface:DialogActionBuilderSet the action to be a copy-to-clipboard action- Specified by:
copyToClipboardin 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:DialogActionBuilderSet the action to be a dynamic custom action- Specified by:
dynamicCustomin 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:DialogActionBuilderSet the action to be a dynamic custom action with a namespace- Specified by:
dynamicCustomin 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:DialogActionBuilderSet the action to be a dynamic run command action- Specified by:
dynamicRunCommandin 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:DialogActionBuilderSet the action to be an open-URL action- Specified by:
openUrlin interfaceDialogActionBuilder<PaperDialog<?>,PaperDialogActionBuilder> - Parameters:
url- the URL to open- Returns:
- the current instance of the builder for method chaining
-
runCommand
Description copied from interface:DialogActionBuilderSet the action to be a run command action- Specified by:
runCommandin interfaceDialogActionBuilder<PaperDialog<?>,PaperDialogActionBuilder> - Parameters:
command- the command to run- Returns:
- the current instance of the builder for method chaining
-
suggestCommand
Description copied from interface:DialogActionBuilderSet the action to be a suggest command action- Specified by:
suggestCommandin interfaceDialogActionBuilder<PaperDialog<?>,PaperDialogActionBuilder> - Parameters:
command- the command to suggest- Returns:
- the current instance of the builder for method chaining
-
showDialog
Description copied from interface:DialogActionBuilderSet the action to be a show dialog action- Specified by:
showDialogin interfaceDialogActionBuilder<PaperDialog<?>,PaperDialogActionBuilder> - Parameters:
dialog- the dialog to show- Returns:
- the current instance of the builder for method chaining
-
showDialog
Description copied from interface:DialogActionBuilderSet the action to be a show dialog action- Specified by:
showDialogin 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:DialogActionBuilderSet the action to be a show dialog action- Specified by:
showDialogin 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()
-