Conversation
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.
Centralize repeated GUI logic by adding MenuInteractionUtil (processClick, openMenu, refreshButton, addButton, checkCancelClick) and update ChestMenu, HopperMenu and PaginatedMenu to delegate to it. Add unit tests for IntList, NumberUtil, OptionalBool and TimeUtil and configure JUnit in common/build.gradle.kts (useJUnitPlatform and junit dependencies). Small cleanups: tweak NumberUtil.condense and a TimeUtil comment, remove an unused import in PaperLocalizationPlatform, adjust JsonUtil imports, add .github/copilot-instructions.md, and ignore /.desloppify in .gitignore. These changes reduce duplication in GUI classes and improve test coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements across the codebase, focusing on modularizing GUI menu logic, enhancing test coverage for utility classes, and updating build configuration to support JUnit 5 testing. The most impactful changes are the extraction of menu interaction logic into a dedicated utility class for maintainability, the addition of comprehensive unit tests for core utilities, and the upgrade of the build system to leverage modern testing frameworks.
Refactoring and Codebase Organization
ChestMenuandHopperMenuinto the newMenuInteractionUtilclass, replacing duplicated code for click handling, menu opening, button refreshing, button addition, and click cancellation checks. This significantly improves maintainability and reduces code duplication. [1] [2] [3] [4] [5] [6] [7]Testing and Quality Assurance
NumberUtil,TimeUtil,IntList, andOptionalBoolutilities, increasing test coverage and ensuring correctness of utility methods. [1] [2] [3] [4]Build System and Dependency Updates
common/build.gradle.ktsto use JUnit 5 (JUnit Jupiter) for testing, including the JUnit BOM and platform launcher, and configured thetesttask to use JUnit Platform. This modernizes the testing infrastructure and enables the new tests to run. [1] [2]Utility Method Improvements
NumberUtil.condense(BigDecimal, char[])for clarity and maintainability by using an intermediate variable and clearer branching.TimeUtil.parseUnitFormatfor whitespace handling, increasing readability.Documentation
.github/copilot-instructions.mdfor thedesloppifycodebase health scanner, detailing workflow, commands, and integration with VS Code Copilot.