4 Commits

Author SHA1 Message Date
Oliver
22f5ccca29 fancydialogs: Fixed player getting kicked when no button or action is defined
Updated version to 1.0.1
2025-11-23 11:36:50 +01:00
Oliver
1422d42322 docs: More docs for FancyDialogs 2025-11-23 11:12:12 +01:00
Oliver
474a1c3e54 fancydialogs: Update version to 1.0.0 2025-11-23 11:06:17 +01:00
Oliver
169ec91269 docs: Polish docs for FancyDialogs 2025-11-23 11:05:15 +01:00
11 changed files with 90 additions and 74 deletions

View File

@@ -0,0 +1,23 @@
---
icon: dot
order: 2
---
![](../../static/changelog_v1_x_x.png)
#
## v1.0.1 [!badge variant="info" text="2025-11-23"] [!badge variant="danger" text="Hotfix"]
- Fixed player kick issue when no button or action is defined. ([#147](https://github.com/FancyInnovations/FancyPlugins/issues/147))
## v1.0.0 [!badge variant="info" text="2025-11-23"]
- Create dialogs using the [JSON schema](https://docs.fancyinnovations.com/fancydialogs/tutorials/json-schema/)
- PlaceholderAPI and MiniMessage support in dialog texts
- Execute actions when dialog buttons are clicked
- Open a dialog when the user joins the server for the first time (see `welcome_dialog_id` in the config)
- A quick actions dialog which can be opened with the `/qa` or `/quickactions` commands
- FancyNpcs ingegration to open dialogs when interacting with NPCs (see [docs](https://docs.fancyinnovations.com/fancydialogs/tutorials/open-dialog-npc-action/))
- API for other plugins to open dialogs (see [docs](https://docs.fancyinnovations.com/fancydialogs/api/getting-started/))

View File

@@ -71,7 +71,7 @@ Unregisters a dialog by its ID.
## Joined Players Cache
## Clear joined players cache
### Clear joined players cache
Clears the cache of players who have joined a dialog.

View File

@@ -1,5 +1,5 @@
---
title: FancyDialogs [WIP]
title: FancyDialogs
icon: browser
order: 90
---
@@ -21,11 +21,6 @@ FancyDialogs uses the new dialog feature, Minecraft introduced in **1.21.6** and
The plugin will only for **Paper** servers on **1.21.6** or newer!
!!!
!!!warning
FancyDialogs is still in development and some features are not yet implemented.
See the [TODO](#todo) section for more information.
!!!
**Core advantages of FancyDialogs:**
- Simple custom dialog creation (in JSON format or in code)
- A lot of different dialog components (text, buttons, input fields, etc.)
@@ -52,17 +47,3 @@ Common use cases are:
- Confirmation dialogs for critical actions
- Shop UIs (replacing inventories UIs)
- Dialogs for quests
## TODO
- [X] Create dialogs in JSON format
- [X] Create dialogs in code
- [X] Customize dialog content and buttons
- [X] Open dialogs for players (via commands or code)
- [X] Welcome dialog for new players
- [X] FancyNpcs integration (open_dialog action)
- [X] Confirmation and notice dialogs (API)
- [x] Add button action system
- [ ] Add support for the quick action hotkey
- [ ] Add tutorial features
- [ ] Add input controls

View File

@@ -1,6 +1,6 @@
---
icon: dot
order: 9
order: 7
---
# Open dialog npc action

View File

@@ -0,0 +1,13 @@
---
icon: dot
order: 8
---
# Quick actions
FancyDialogs doesn't support the quick-actions hotkey, but has a command to open a quick action dialog.
To open the quick actions dialog, use the command: `/qa` or `/quickactions`.
You can customize the quick actions dialog in the `plugins/FancyDialogs/data/dialogs/quick_actions.json` file.
If you want to disable the quick actions dialog, you can set the `disable-quick-actions-dialog` option to true in the `plugins/FancyDialogs/featureFlags.yml` file.

View File

@@ -0,0 +1,16 @@
---
icon: dot
order: 9
---
# Welcome dialog
You can configure a dialog to be shown to players when they join the server for the first time.
A default welcome dialog is included with FancyDialogs, but you can customize it or create your own welcome dialog.
You can find the default welcome dialog in the `plugins/FancyDialogs/data/dialogs/welcome.json` file.
Feel free to edit this file to customize the welcome dialog to your liking.
If you want to use another dialog as the welcome dialog, you can change the id in the `plugins/FancyDialogs/config.yml` file by changing the `welcome_dialog_id` option to the ID of your desired dialog.
To completely disable the welcome dialog, you can set the `disable-welcome-dialog` to true in the `plugins/FancyDialogs/featureFlags.yml` file.

View File

@@ -0,0 +1 @@
- Fixed player kick issue when no button or action is defined. ([#147](https://github.com/FancyInnovations/FancyPlugins/issues/147))

View File

@@ -1 +1 @@
0.0.32
1.0.1

View File

@@ -9,13 +9,12 @@
"1.21.7",
"1.21.8",
"1.21.9",
"1.21.10",
"1.21.11"
"1.21.10"
],
"channel": "RELEASE",
"loaders": [
"paper",
"folia"
],
"featured": false
"featured": true
}

View File

@@ -10,6 +10,7 @@ import com.fancyinnovations.fancydialogs.api.data.inputs.DialogInput;
import com.fancyinnovations.fancydialogs.api.data.inputs.DialogSelect;
import com.fancyinnovations.fancydialogs.api.data.inputs.DialogTextField;
import de.oliver.fancysitula.api.dialogs.FS_CommonDialogData;
import de.oliver.fancysitula.api.dialogs.FS_Dialog;
import de.oliver.fancysitula.api.dialogs.FS_DialogAction;
import de.oliver.fancysitula.api.dialogs.actions.FS_CommonButtonData;
import de.oliver.fancysitula.api.dialogs.actions.FS_DialogActionButton;
@@ -18,6 +19,7 @@ import de.oliver.fancysitula.api.dialogs.body.FS_DialogBody;
import de.oliver.fancysitula.api.dialogs.body.FS_DialogTextBody;
import de.oliver.fancysitula.api.dialogs.inputs.*;
import de.oliver.fancysitula.api.dialogs.types.FS_MultiActionDialog;
import de.oliver.fancysitula.api.dialogs.types.FS_NoticeDialog;
import de.oliver.fancysitula.api.entities.FS_RealPlayer;
import de.oliver.fancysitula.factories.FancySitula;
import org.bukkit.entity.Player;
@@ -35,7 +37,7 @@ public class DialogImpl extends Dialog {
super(id, data);
}
private FS_MultiActionDialog buildForPlayer(Player player) {
private FS_Dialog buildForPlayer(Player player) {
List<FS_DialogBody> body = new ArrayList<>();
for (DialogBodyData bodyData : data.body()) {
FS_DialogTextBody fsDialogTextBody = new FS_DialogTextBody(
@@ -109,6 +111,30 @@ public class DialogImpl extends Dialog {
actions.add(fsDialogActionButton);
}
if (actions.isEmpty()) {
return new FS_NoticeDialog(
new FS_CommonDialogData(
ChatColorHandler.translate(data.title(), player, ParserTypes.placeholder()),
ChatColorHandler.translate(data.title(), player, ParserTypes.placeholder()),
data.canCloseWithEscape(),
false,
FS_DialogAction.CLOSE,
body,
inputs
),
new FS_DialogActionButton(
new FS_CommonButtonData(
"Close",
null,
150 // default button width
),
new FS_DialogCustomAction(
"fancydialogs_dialog_action--none",
Map.of())
)
);
}
return new FS_MultiActionDialog(
new FS_CommonDialogData(
ChatColorHandler.translate(data.title(), player, ParserTypes.placeholder()),
@@ -118,53 +144,6 @@ public class DialogImpl extends Dialog {
FS_DialogAction.CLOSE,
body,
inputs
// List.of(
// new FS_DialogInput(
// "input1",
// new FS_DialogTextInput(
// 200,
// "Enter something",
// true,
// "default text",
// 100,
// null
// )
// ),
// new FS_DialogInput(
// "input2",
// new FS_DialogBooleanInput(
// "input2",
// false,
// "true",
// "false"
// )
// ),
// new FS_DialogInput(
// "input3",
// new FS_DialogNumberRangeInput(
// 200,
// "Number Input",
// "options.generic_value",
// 0,
// 100,
// 50.f,
// 1.0f
// )
// ),
// new FS_DialogInput(
// "input4",
// new FS_DialogSingleOptionInput(
// 200,
// List.of(
// new FS_DialogSingleOptionInput.Entry("option1", "Option 1", true),
// new FS_DialogSingleOptionInput.Entry("option2", "Option 2", false),
// new FS_DialogSingleOptionInput.Entry("option3", "Option 3", false)
// ),
// "Select an option",
// true
// )
// )
// )
),
actions, // actions
null,

View File

@@ -46,6 +46,10 @@ public class CustomClickActionPacketListener {
String dialogId = packet.getPayload().get("dialog_id");
String buttonId = packet.getPayload().get("button_id");
if (dialogId == null || buttonId == null) {
return; // Missing necessary information
}
new DialogButtonClickedEvent(event.player(), dialogId, buttonId, packet.getPayload()).callEvent();
if (dialogId.startsWith("confirmation_dialog_")) {