Skip to content

Conversation

@illyrius666
Copy link
Member

@illyrius666 illyrius666 commented Jan 15, 2026

Description

Adds the server information and faq via dialogs using the paper api.

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual testing
  • Other (please describe)

Summary by CodeRabbit

Release Notes

  • New Features

    • Added FAQ dialog accessible via command for quick information reference
    • Added server link configuration support
  • Bug Fixes

    • Fixed portal creation to properly handle denial cases with player feedback
    • Improved door toggling to prevent unnecessary state changes
  • Chores

    • Updated IDE configuration for enhanced development support

✏️ Tip: You can customize this high-level summary in your review settings.

…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>
@illyrius666 illyrius666 self-assigned this Jan 15, 2026
@github-actions github-actions bot changed the title Feat/server info module feat/ServerInfoModule Jan 15, 2026
@github-actions github-actions bot changed the base branch from main to dev January 15, 2026 09:57
illyrius666 and others added 14 commits January 15, 2026 11:33
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>
…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>
@illyrius666
Copy link
Member Author

blocked due to paper api bug:
PaperMC/Paper#13555

illyrius666 and others added 9 commits January 23, 2026 07:30
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>
…stency across modules

Signed-off-by: Illyrius <fitimq@live.nl>
…r reuse

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>
@illyrius666 illyrius666 linked an issue Jan 23, 2026 that may be closed by this pull request
@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

This 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 it instead of explicit names.

Changes

Cohort / File(s) Summary
Dialog System & Infrastructure
src/main/kotlin/org/xodium/vanillaplus/interfaces/DialogInterface.kt, src/main/kotlin/org/xodium/vanillaplus/dialogs/FaqDialog.kt
New internal interface DialogInterface defines contract for dialog registration and retrieval via config, key, invoke, and get() operations. New FaqDialog object implements the interface with serializable Config and FaqItem data classes, buildFaqItems() helper, and default FAQ entries (Rules, Gamerules, Nickname, etc.) with materials, display names, and lore.
ServerInfoModule
src/main/kotlin/org/xodium/vanillaplus/modules/ServerInfoModule.kt
New internal ServerInfoModule implementing ModuleInterface; exposes /faq command gated by permission that opens FaqDialog. Includes serializable Config with serverLinks mappings and faqDialogConfig, plus serverLinks() helper for safe URL parsing and application.
Bootstrap & Module Integration
src/main/kotlin/org/xodium/vanillaplus/VanillaPlusBootstrap.kt, src/main/kotlin/org/xodium/vanillaplus/VanillaPlus.kt
VanillaPlusBootstrap adds DIALOG registry handler for FaqDialog, declares public TOOLS/WEAPONS/TOOLS\_WEAPONS TagKey companions, refactors preFlatten lambda, reworks enchantment registrations with invoke(it), and extends post-flatten lifecycle to tag FaqDialog into QUICK\_ACTIONS. VanillaPlus adds ServerInfoModule to module list and standardizes forEach lambdas.
Configuration Extension
src/main/kotlin/org/xodium/vanillaplus/data/ConfigData.kt
Added serverInfoModule field of type ServerInfoModule.Config with default initialization to ConfigData data class.
Interface Refactoring
src/main/kotlin/org/xodium/vanillaplus/interfaces/EnchantmentInterface.kt, src/main/kotlin/org/xodium/vanillaplus/interfaces/ModuleInterface.kt, src/main/kotlin/org/xodium/vanillaplus/interfaces/RecipeInterface.kt
EnchantmentInterface now uses toRegistryKeyFragment() utility for key derivation. ModuleInterface and RecipeInterface updated with implicit it lambda parameters.
Enchantment Lambda Refactoring
src/main/kotlin/org/xodium/vanillaplus/enchantments/FeatherFallingEnchantment.kt, src/main/kotlin/org/xodium/vanillaplus/enchantments/NightVisionEnchantment.kt, src/main/kotlin/org/xodium/vanillaplus/enchantments/SilkTouchEnchantment.kt
Replaced explicit lambda parameter names with implicit it; isValidTool logic simplified using Elvis operator for null safety.
Module Lambda Refactoring & Logic
src/main/kotlin/org/xodium/vanillaplus/modules/ArmorStandModule.kt, src/main/kotlin/org/xodium/vanillaplus/modules/ChatModule.kt, src/main/kotlin/org/xodium/vanillaplus/modules/DimensionsModule.kt, src/main/kotlin/org/xodium/vanillaplus/modules/InventoryModule.kt, src/main/kotlin/org/xodium/vanillaplus/modules/SitModule.kt, src/main/kotlin/org/xodium/vanillaplus/modules/TabListModule.kt
Standardized lambda parameters to use implicit it. DimensionsModule: added player teleport and action bar message when denying portal creation. OpenableModule: added conditional check to toggle door only when states differ.
Utilities
src/main/kotlin/org/xodium/vanillaplus/utils/Utils.kt, src/main/kotlin/org/xodium/vanillaplus/utils/CommandUtils.kt
Replaced Range data class with inline reified toRegistryKeyFragment() extension on Class\<*\> for key name transformation. CommandUtils refactored to use implicit it in executesCatching and playerExecuted blocks.
IDE Configuration
.idea/dictionaries/project.xml, .idea/externalDependencies.xml
Added words "Gamerules", "gamerule", "serverlink" to project dictionary. Added org.jetbrains.kotlin plugin to ExternalDependencies.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Hop, hop—the dialogs now take flight,
FAQ answers glowing ever bright,
ServerInfo joins the module dance,
While lambdas leap with cleaner stance,
Registry keys transform with grace,
New features hop into their place!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat/ServerInfoModule' accurately describes the main addition—a new ServerInfoModule feature—and aligns with the primary changes in the changeset.
Description check ✅ Passed The PR description includes both required sections: a clear description of the changes and a testing methodology section with manual testing confirmed.
Docstring Coverage ✅ Passed Docstring coverage is 88.46% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@illyrius666
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a 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.

illyrius666 and others added 2 commits January 23, 2026 17:35
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>
@illyrius666 illyrius666 requested review from a team and gaia-03 and removed request for a team January 23, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ServerInfoModule

2 participants