Skip to content

chore: catch main up to dev for 1.21.x baseline - #26

Merged
THEROER merged 58 commits into
mainfrom
dev
Apr 26, 2026
Merged

chore: catch main up to dev for 1.21.x baseline#26
THEROER merged 58 commits into
mainfrom
dev

Conversation

@THEROER

@THEROER THEROER commented Apr 26, 2026

Copy link
Copy Markdown
Owner

Catches main up to dev. After this merge:

  • main contains everything from dev: 1.21.0, 1.21.1, 1.21.2, 1.21.3 release commits, the i18n refactor, the recent flaky-test fix, etc.
  • main now has the LICENSE that was missing from dev (already merged back).
  • main and dev are at the same SHA — divergence cleared.

After this lands, default branch can switch to main and future releases can run from main.

…dency, and introduce MagicWebSocketClient for enhanced WebSocket functionality
Changes:
- Platform API
  - Add hasPermission() method to Audience interface with default implementation
  - Default behavior allows empty permission checks only

- Platform Implementations
  - Implement hasPermission() in all console audiences (always returns true)
  - Implement hasPermission() in BukkitAudienceWrapper (delegates to sender)
  - Implement hasPermission() in VelocityAudience (delegates to source)
  - Implement hasPermission() in FabricAudience and FabricCommandAudience

- Fabric Platform
  - Add FabricPermissionBridge utility class
  - Bridge to Lucko Fabric Permissions API via reflection when available
  - Fallback to command-level permission checks when API is absent
Changes:
- Platform: Velocity
  - Add CommandRegistry for Velocity proxy command management
  - Add VelocityCommandPlatform implementation for command execution
  - Add VelocityCommandWrapper for Velocity SimpleCommand integration
  - Support async command execution with custom executor
  - Register MagicSender adapter for Velocity CommandSource

- Platform: Fabric
  - Refactor FabricComponentSerializer reflection-based text codec discovery
  - Add detailed logging for codec and serializer method scanning
  - Improve fallback handling in text serialization/deserialization
  - Support multiple TextCodecs class name variants (1.20.5+, 1.21+)
  - Enhance error handling with better null checks

- Build: Gradle
  - Split bundle projects into bundleLibProjects and bundleModProjects
  - Fix shadowJar configuration to use main source set output
  - Update remapJar to use shadowJar archive file as input
  - Remove redundant bundleShadedProjects processing

- Misc
  - Bump version to 1.11.6-SNAPSHOT
Changes:
- Platform API
  - add normalized player message types, listener contract, and subscription handle
  - expose subscribePlayerMessages on the shared Platform interface

- Runtime Providers
  - publish normalized chat and command messages from Bukkit, Velocity, and Fabric providers
  - keep platform-specific event hooks inside MagicUtils instead of feature plugins

- Release
  - bump MagicUtils version to 1.13.0 for the new shared runtime API
…Bukkit configuration

Changes:
- Bump version in gradle.properties to 1.13.1-SNAPSHOT
- Enhance CommandManager to support enum argument types
- Register MaterialAdapter in AdaptersBootstrap for Bukkit Material serialization
- Implement MaterialAdapter for deserializing and serializing Bukkit Material values
- Updated site description in mkdocs.yml to include Velocity.
- Added new sections in README.md for shared server installs and modular setups.
- Introduced a migration guide to assist users transitioning to the bootstrap-first setup.
- Expanded quickstart and runtime documentation for clarity on usage patterns.
- Added requirements-docs.txt for documentation dependencies and created a GitHub Actions workflow for docs checks.
- Updated .gitignore to exclude Python cache files.
- Added new pages for runtime management and migration strategies.
- Added a new section for "Core / Common Logic" in mkdocs.yml to clarify the recommended project structure for shared logic.
- Updated README.md to reflect changes in command entry points and the use of `MagicRuntime` for shared services.
- Refactored command registration in CommandManager to ensure commands are immutable after registration.
- Introduced a new test suite for command composition and mutation lifecycle to ensure stability and correctness.
- Updated various documentation files to guide users on the new command building and registration practices.
- Add NeoForge Logger with @LogMethods and proper console log level routing
- Add NeoForgeBootstrap builder for wiring MagicUtils services on NeoForge
- Add NeoForge-specific LogBuilder and PrefixedLogger with ServerPlayer/CommandSourceStack support
- Add CommandRegistry.shutdown() for mod cleanup
- Fix MiniMessage escaping in CommandManager.buildUsage() to prevent <code> from being parsed as tag
- Fix Velocity console routing to always use VelocityConsoleAudience with proper log level mapping

Bump version to 1.14.0.
Add default address() method to MagicSender interface returning the
sender's IP address. Implemented in all platform adapters: Bukkit
(Player.getAddress), Velocity (Player.getRemoteAddress), Fabric
(networkHandler.getConnectionAddress), NeoForge
(connection.getRemoteAddress).
THEROER added 27 commits April 11, 2026 16:52
- commands: add resolved command schema types, sender diagnostics defaults
  on CommandPlatform, and expanded builder javadoc in MagicCommand
- commands-brigadier: extend BrigadierCommandRegistry with optional
  argument tree support
- commands-fabric / commands-neoforge: align CommandRegistry and platform
  adapters with the new command engine surface
- platform-bungee: add BungeeBootstrap and full BungeeCord CommandRegistry
- platform-velocity: add VelocityPlatformProvider and refresh Velocity
  command wiring
- platform-bukkit: harden Folia threading, BukkitCommandWrapper, and
  console audience; add BukkitThreading reflection helpers
- platform-fabric / platform-neoforge: polish text codecs, console
  audiences, and command audience adapters
- logger: drop legacy ComponentPrefixStripper / ConsoleMessageParser /
  LoggerAdapter setters, rework LoggerCore + LogMessageFormatter and
  LoggerConfig around direct core accessors, add ConsoleColorSerializer
- config: ConfigManager retries transient mutable snapshots and gains
  thread-safety regression coverage
- core: extend ReflectiveAccess allowlist for the new call sites
- http-client: silence unused ObjectMapper warning in MagicWebSocketClient
- refresh gradle/reflection-allowlist.txt to match the new call sites
Introduce the first Kotlin-based build matrix and consumer manifest flow in build-logic. This adds scenario-aware root tasks, target-aware settings filtering, and generated verified-plugin support manifests so downstream release metadata can live in MagicUtils instead of ad-hoc JSON files.

Expand the standalone Bukkit bundle into a real shared-runtime plugin. The bundle now exposes /magicutils and /mu commands, reports connected shared-runtime consumers, refreshes command and diagnostics capabilities after bootstrap, and marks the bundle as Folia-compatible for Paper/Folia shared installs.

Add the new diagnostics module plus platform bootstrap wiring, managed schedulers/executors, and shared command/runtime infrastructure across Bukkit, Bungee, Velocity, Fabric, and NeoForge. This gives consumers a built-in diagnostics registry, report export pipeline, and shared platform services needed by downstream plugins.

Tighten hot-path performance and developer ergonomics by short-circuiting disabled debug logging before formatting, adding lazy command debug hooks, fixing module-name publishing helpers, and documenting the new shared-install workflow. Bump the project version to 1.19.0 and update verified-plugin consumer manifests to the 1.19.0 artifact line.
Wire MagicUtilsBukkitBundlePlugin into the publish_repo repository so workflow-driven Maven publication actually uploads magicutils-bukkit-bundle alongside the rest of the shared-runtime artifacts.

Bump the project and generated verified-plugin consumer manifest references to 1.19.1, because 1.19.0 was already partially published without the Bukkit bundle and should not be reused for the corrected release line.
Add a platform-level player locale subscription API and wire it into Bukkit, Folia, Bungee, Velocity, Fabric, and NeoForge so LanguageManager can track auto-detected client locales separately from explicit per-player overrides.

Route built-in help text, command descriptions, permission registration text, and fallback strings through InternalMessages and CommandDescriptions so /help and resolved command metadata are localized for the active audience instead of staying hardcoded in English.

Cover the new behavior with language and command registry tests for locale matching, in-memory translation lookup, and localized help rendering through the Bukkit command path.
Add a maintainer-facing scripts/publish_release.py helper similar to the verified-plugin workflow wrapper so MagicUtils releases can validate semver, sync gradle.properties, push the selected branch, wait for origin/<ref> to resolve to the pushed HEAD, and then dispatch release.yml without racing GitHub on stale branch refs.

Document the helper in README and maintainer docs, and add a small scripts/README entry so the local release flow is discoverable from the repository itself.

Bump MagicUtils from 1.19.1 to 1.20.0 and update the verified-plugin support manifest to the new artifact coordinates, including the mc1201 and mc2611 target suffixes and the Paper 26.1.2 compatibility window.
Regenerate gradle/reflection-allowlist.txt after the locale/help and release-flow changes shifted reflection call sites across commands, language, Bukkit threading, and NeoForge platform code.\n\nThis keeps verifyReflectionBoundaries aligned with the current source tree so the dev CI build can complete successfully on ./gradlew build again.
Prevent ConfigManager external reload tasks from mutating config state after shutdown has already started.

This fixes the flaky http-client runtime binding failures in ci-dev where a watcher-triggered reload could survive past shutdown, rebuild runtime-bound HTTP/WebSocket clients, and invalidate test assumptions.

Add a regression test that captures a queued external reload and executes it after shutdown, then refresh the reflection allowlist for the updated ConfigManager line numbers.
Shut down ConfigManager immediately after creating LoggerCore in the logger tests.

The tests only exercise in-memory logger configuration and placeholder behavior, so keeping the file watcher alive can reapply disk state asynchronously on CI and make debug placeholder assertions flaky.
Reshape the localization layer so MagicUtils, Logger, and downstream
plugins share one resolution path instead of parallel reimplementations.

Lang
- Replace LanguageDefaults with BundledTranslations loading from
  classpath JSONC (lang/<code>.json + lang/<namespace>/<code>.json).
- Slim LanguageManager to three resolvers (getMessage, getMessageFor,
  getMessageIn); drop placeholder/replacement overloads.
- Guarantee bundled English fallback at the resolver tail so callers
  never see raw keys when an English value exists.
- Build a flat message cache in LanguageConfig so getMessage avoids
  reflection on the hot path.
- Add LanguageManager.registerBundledTranslations(namespace) helper for
  plugins shipping their own JSON resources.

Messages
- Accept any sender-like object (Audience, Player, null) via the new
  AudienceResolver; drop the bespoke extractUuid duplicates.
- Expose Object... args on getRaw/get/send and route everything through
  MsgFmt, eliminating the rawEscaped/getMessage* overload sprawl.
- Add isOverride / resolveOverride utilities so plugins stop hand-rolling
  configurable-default detection.

Placeholder engine
- Move MsgFmt to platform-api, gain a value transformer hook, and adopt
  it in Logger and Messages so {name} substitution lives in one place.

Logger
- Add LoggerCore.setEscapePlaceholders(boolean) for safe inline values.

Docs
- New lang/README-TRANSLATORS.md walking translators through bundled vs
  on-disk overrides, language codes, and fallback behaviour.
Keep the verified-plugin compatibility windows for older Minecraft runtimes, but point their MagicUtils dependency pins at the target-suffixed artifacts that this release line actually publishes.

The previous manifest referenced 1.20.0-mc1201 and 1.20.0-mc2611 coordinates that were never present in the MagicUtils Maven repository, causing LeavePulse Agent release smoke tests to fail before server startup.

Also avoid logging LanguageManager disk-I/O warnings on paths that already switch to asynchronous loading instead of blocking the main thread.
Include the common diagnostics, commands-brigadier, config-toml and processor modules in target-suffixed Maven publication steps. Consumers that pin MagicUtils to mc1201 or mc2611 need the full common dependency set, not only core and platform bundles.
Derive Bukkit bundle plugin.yml api-version from the target major/minor line instead of the full patch-level Minecraft target. Paper 1.20 rejects api-version 1.20.1, so the mc1201 target must publish a bundle marked as api-version 1.20 while keeping the verified-plugin support matrix on the new 1.21.2 artifacts.
Pin the Paper 1.20.5-1.20.6 compatibility window to the mc1201 MagicUtils runtime and publish it as a separate Java 21 Bukkit artifact baseline. The default MagicUtils Bukkit bundle is marked for the 1.21 API line and is rejected by Paper 1.20.5.
The watcher fires ENTRY_CREATE/ENTRY_MODIFY for files we just wrote
ourselves during ConfigManager.register() — saving defaults on first
registration, or persisting registered translations afterwards. The
queued external reload would race with the test thread and any caller
that did not expect a reload right after register, occasionally rebuilding
runtime bindings (HTTP/WebSocket clients) and shifting the indices test
assertions rely on.

Drop reload tasks whose observed file mtime equals the entry's last
known mtime — this is the same condition reloadEntry() uses to detect
a no-op reload, just applied earlier so we never even re-read the file.

While here, harden shutdown semantics:
  * shutdownLock guards the shuttingDown flag against in-flight reload
    tasks so they cannot observe a stale "false" while shutdown is
    mid-flight.
  * Stop the watcher first, then drain the reload executor gracefully
    (shutdown() rather than shutdownNow()), so currently-running reloads
    can release entry.monitor cleanly before we exit.

Test plumbing fixes that also surfaced under stress:
  * RecordingWebSocketBuilder fields are now volatile / synchronized —
    they are written from buildAsync() on whichever executor the WebSocket
    plumbing chose, and read from the test thread.
  * ownedClients lists use CopyOnWriteArrayList for the same reason.

Verified by 25 consecutive `:http-client:test` runs under
`stress-ng --cpu 8` — all green; reproduced 7-8/25 failures before
the fix.
Brings the LICENSE addition (c09f31b) and the 24 historical PR-merge
commits from main into dev so the two branches stop diverging. After
this commit dev contains everything from both branches and can be
fast-forwarded back into main as a single PR.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, we are unable to review this pull request

The GitHub API does not allow us to fetch diffs exceeding 20000 lines

@THEROER
THEROER merged commit 9e4f471 into main Apr 26, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 480a22458d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

numValue = minValue.value();
clamped = true;
if (minValue.warn()) {
logger.warn(String.format(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard clamp warnings when deserializing without a logger

ConfigSerializer.deserialize accepts a PlatformLogger parameter and already treats it as optional in other warning paths, but validateNumericBounds calls logger.warn(...) unconditionally when @MinValue/@MaxValue clamps a value. If a caller passes null and a numeric field is out of range, deserialization throws NullPointerException instead of returning a usable config instance.

Useful? React with 👍 / 👎.

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.

1 participant