-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat/ServerInfoModule #360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
…inks configuration Signed-off-by: Illyrius <fitimq@live.nl>
…ciency Signed-off-by: Illyrius <fitimq@live.nl>
… references Signed-off-by: Illyrius <fitimq@live.nl>
Signed-off-by: Illyrius <fitimq@live.nl>
Signed-off-by: Illyrius <fitimq@live.nl>
Signed-off-by: Illyrius <fitimq@live.nl>
…Module Signed-off-by: Illyrius <fitimq@live.nl>
…ding in ServerInfoModule Signed-off-by: Illyrius <fitimq@live.nl>
Signed-off-by: Illyrius <fitimq@live.nl>
…odule Signed-off-by: Illyrius <fitimq@live.nl>
…t text Signed-off-by: Illyrius <fitimq@live.nl>
… improved dialog structure Signed-off-by: Illyrius <fitimq@live.nl>
… for custom names and lore Signed-off-by: Illyrius <fitimq@live.nl>
Signed-off-by: Illyrius <fitimq@live.nl>
…Module command structure Signed-off-by: Illyrius <fitimq@live.nl>
Signed-off-by: Illyrius <fitimq@live.nl>
|
blocked due to paper api bug: |
Signed-off-by: Illyrius <28700752+illyrius666@users.noreply.github.com>
…ty across modules Signed-off-by: Illyrius <fitimq@live.nl>
…ty across modules Signed-off-by: Illyrius <fitimq@live.nl>
Signed-off-by: Illyrius <fitimq@live.nl>
…stency across modules Signed-off-by: Illyrius <fitimq@live.nl>
Signed-off-by: Illyrius <fitimq@live.nl>
…r reuse Signed-off-by: Illyrius <fitimq@live.nl>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughThis PR introduces a new dialog system with FAQ dialog implementation, adds a ServerInfoModule for server information features, extends the bootstrap to register and manage dialogs, and refactors lambda parameters across the codebase to use implicit Changes
Sequence Diagram(s)sequenceDiagram
actor Player
participant Server
participant ServerInfoModule
participant DialogRegistry as Dialog<br/>Registry
participant FaqDialog
Player->>Server: Execute /faq command
Server->>ServerInfoModule: Invoke command handler
ServerInfoModule->>FaqDialog: FaqDialog.get()
FaqDialog->>DialogRegistry: Query DIALOG registry
DialogRegistry-->>FaqDialog: Return Dialog instance
FaqDialog-->>ServerInfoModule: Return Dialog
ServerInfoModule->>Player: Open dialog (FAQ items)
Player->>Player: View FAQ information
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/kotlin/org/xodium/vanillaplus/modules/DimensionsModule.kt (1)
55-67: Cache Overworld lookup to avoid duplicate calls.
This avoids repeated world resolution and keeps the same instance for the whole block.♻️ Proposed refactor
- if (findCorrespondingPortal(calcPortalCentre(event.blocks), getOverworld()) == null) { + val overworld = getOverworld() + if (findCorrespondingPortal(calcPortalCentre(event.blocks), overworld) == null) { event.isCancelled = true val player = event.entity as? Player ?: return - val overworld = getOverworld() val destination = player.respawnLocation?.takeIf { it.world == overworld } ?: overworld.spawnLocation
🤖 Fix all issues with AI agents
In `@src/main/kotlin/org/xodium/vanillaplus/dialogs/FaqDialog.kt`:
- Around line 25-34: invoke() currently reads faqConfig at bootstrap so
DialogBase.builder(MM.deserialize(faqConfig.faqTitle)) always uses the default
Config; change to resolve the title lazily after config is loaded (or document
immutable bootstrap behavior). Specifically, stop calling
MM.deserialize(faqConfig.faqTitle) inside invoke(); instead have invoke() supply
a title supplier or placeholder and set the real title when configData is
available (e.g., after config load hook), or move this builder creation to the
post-config registration step so faqConfig is the user-provided instance;
reference invoke(), faqConfig, and DialogBase.builder(...) to find and update
the logic.
- Around line 17-23: The current faqConfig getter swallows
UninitializedPropertyAccessException when accessing
config.serverInfoModule.faqDialogConfig; replace the exception-control-flow with
a null-safe access or lazy initialization: use a safe-call + elvis fallback
(e.g., read config?.serverInfoModule?.faqDialogConfig ?: Config()) or make the
backing config lazily initialized so faqConfig can directly return
config.serverInfoModule.faqDialogConfig; reference the faqConfig getter, config,
and serverInfoModule.faqDialogConfig symbols when applying the change and remove
the try/catch for UninitializedPropertyAccessException.
In `@src/main/kotlin/org/xodium/vanillaplus/modules/ChatModule.kt`:
- Around line 44-56: The guard that checks "if (ctx.source.sender !is Player)"
logs a warning but does not return, causing the subsequent cast to Player in the
executesCatching lambda to throw; update the executesCatching block so that
after logging the warning you immediately return from the lambda (e.g.,
return@executesCatching or equivalent) to stop execution for non-player senders,
ensuring the later code that assigns "val sender = ctx.source.sender as Player"
only runs when the sender is a Player.
In `@src/main/kotlin/org/xodium/vanillaplus/modules/ServerInfoModule.kt`:
- Around line 37-46: The init block in ServerInfoModule calls serverLinks() too
early (accessing config.serverInfoModule.serverLinks) and should not run during
construction; remove the init invocation and instead invoke serverLinks() after
configuration is loaded (e.g., from VanillaPlus.onEnable after configData is
initialized) or make serverLinks() safe to run lazily by checking config
availability before using it; also update serverLinks() to log a warning when
URI.create(url) fails (instead of silently discarding) and continue setting
links via instance.server.serverLinks.setLink(type, uri) for valid URIs.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Illyrius <28700752+illyrius666@users.noreply.github.com>
Signed-off-by: Illyrius <28700752+illyrius666@users.noreply.github.com>
Description
Adds the server information and faq via dialogs using the paper api.
How Has This Been Tested?
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.