Skip to content

Add Nexus deployment workflow, Maven publishing, and utilities#3

Merged
ericlmao merged 12 commits intoreleasefrom
snapshot
Feb 26, 2026
Merged

Add Nexus deployment workflow, Maven publishing, and utilities#3
ericlmao merged 12 commits intoreleasefrom
snapshot

Conversation

@ericlmao
Copy link
Member

This pull request introduces several new utility classes and interfaces to the plugin-engine library, improves command registration for Paper plugins, and adds support for reloadable components. It also updates the project version to 1.1.0 and provides comprehensive documentation in the README.md. The changes enhance plugin development by adding reusable helpers, improving modularity, and increasing developer ergonomics.

New utilities and helpers:

  • Added OptionalBool, a functional-style utility for conditional execution and value mapping based on boolean state.
  • Added IntList, a parser for string lists into integer lists, including support for ranges (e.g., "5-10").
  • Added Cooldowns, a component for managing per-player cooldowns with automatic cleanup on player quit.

Plugin lifecycle and reload support:

  • Introduced the Reloadable interface and integrated reload logic into PaperPlugin, allowing beans implementing Reloadable to be reloaded via the plugin. [1] [2]

Command framework improvements:

  • Added PaperCommand interface and updated PaperCommandRegistry to auto-discover and register only PaperCommand beans, ensuring proper command registration for Paper plugins. [1] [2]

Documentation and versioning:

  • Added a detailed README.md covering features, installation, quick start, and usage examples for plugin developers.
  • Updated the project version to 1.1.0 in both common and paper modules. [1] [2]

Paper plugin enhancements:

  • PaperPlugin now auto-registers all Listener beans on enable, improving event handling setup.
  • Added logging for command registration in PaperCommandRegistry.

These changes collectively make plugin development easier, more modular, and provide robust utility support for common tasks.

ericlmao and others added 12 commits February 25, 2026 13:23
Add a GitHub Actions workflow to deploy artifacts to Negative Games Nexus for release and snapshot branches. The workflow sets up JDK 21 and Gradle, injects Nexus credentials into ~/.gradle/gradle.properties from secrets, adjusts module apiVersion for release/snapshot branches, and runs ./gradlew publish with an isRelease flag.

Update root build.gradle.kts to apply maven-publish and configure a nexus repository that selects snapshots or releases based on the isRelease property and reads credentials from gradle.properties. Add maven-publish and shadow publishing configuration to common and paper modules: set module ids, domain, apiVersion, Java 21 toolchain, disable the plain jar, configure shadowJar as the published artifact, and include POM metadata (license, developer, url).
Switch sed targets from build.gradle to build.gradle.kts and update the regexes to match Kotlin DSL variable declarations (var apiVersion = "...") for both release and snapshot branches. This ensures version bump/removal works for build.gradle.kts files. Also add a missing newline at end of file.
Delete the tasks.jar { enabled = false } block from common/build.gradle.kts so the default jar task is no longer disabled. This restores normal jar packaging behavior while keeping the shadowJar configuration (archiveBaseName and archiveVersion) intact.
Add project README documenting modules, usage, and APIs. Introduce PaperCommand interface (CloudCommand specialized for CommandSourceStack) and update PaperCommandRegistry to discover/register PaperCommand beans (remove unused CloudCommand import). This aligns command discovery with the Paper-specific command type and adds library documentation.
Introduce IntList with a static parse(List<String>) method that converts strings into a List<Integer>. Supports single integers and inclusive ranges (e.g., "5-10"); input segments are trimmed before parsing. Useful for parsing config or input lists; invalid numeric input will throw NumberFormatException.
Introduce JsonUtil, a final utility class (Slf4j) providing Gson-based JSON file operations. Adds methods to load/save objects: loadFromFile, loadTypeFromFile, loadFromDirectory, saveToFile and saveTypeToFile. Uses UTF-8 encoding, Optional/Collection return types, basic file existence checks and error logging, and prevents instantiation.
Introduce a Cooldowns Spring component and Bukkit Listener to manage per-player, per-key cooldowns. Uses a Guava Table backed by concurrent maps to store expiry timestamps (epoch millis), provides addCooldown overloads (millis and Duration) and an isOnCooldown check. Clears a player's cooldowns on PlayerQuitEvent to prevent memory leaks.
Introduce OptionalBool to wrap boolean values and provide Optional-like, functional-style operations. The class uses singleton instances for true/false, offers isTrue/isFalse checks, conditional executors (ifTrue, ifFalse, ifTrueOrElse) and mapping utilities (mapIfTrue, mapIfFalse, mapIfTrueOrElse) that return Optional or computed values. Also overrides equals, hashCode, and toString. Placed in games.negative.engine.util for use across the codebase.
Introduce a new Reloadable interface with a single reload() method and implement plugin reload handling in PaperPlugin. PaperPlugin now invokes Reloadable beans via invokeBeans, calling their reload methods and logging any failures using SLF4J (@slf4j). Adds the new common interface file and updates imports in the Paper module.
PaperPlugin: onEnable now invokes Spring beans of type org.bukkit.event.Listener and registers them with the server PluginManager, logging any registration failures. Added the Listener import. PaperCommandRegistry: added an info log "Registering commands" at the start of onEnable to surface command registration in logs.
Update apiVersion from 1.0.0 to 1.1.0 in common/build.gradle.kts and paper/build.gradle.kts to reflect the API minor release.
@ericlmao ericlmao merged commit f96b74f into release Feb 26, 2026
1 check passed
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