feat: add public API module - #242
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
…ApiSurfaceTest.java
Jakubk15
left a comment
There was a problem hiding this comment.
- Ensure you're using imports, not fully qualified class names
- Keep it simple and stupid, do not use overly complicated enterprise-grade callbacks and atomicity for a simple Minecraft plugin
- Ensure the tests are actually worth it rather than blind-writing tests for every feature
- Answer why PublicParcelService and PluginParcelService cannot be merged
| mavenLocal() | ||
| maven { | ||
| name = "eternalcodeReleases" | ||
| url = uri("https://repo.eternalcode.pl/releases") |
There was a problem hiding this comment.
include snapshot publishing
| import org.bukkit.command.CommandSender; | ||
| import org.bukkit.inventory.ItemStack; | ||
|
|
||
| public class ItemStorageManager { |
There was a problem hiding this comment.
is this level of atomicity really needed here?
| /** | ||
| * Atomically inserts a parcel if its UUID is not already present. | ||
| * | ||
| * @return true only when this call inserted the row | ||
| */ |
There was a problem hiding this comment.
is atomicity really needed everywhere in this class?
|
|
||
| @Override | ||
| public CompletableFuture<Boolean> saveIfAbsent(Parcel parcel) { | ||
| Objects.requireNonNull(parcel, "Parcel cannot be null"); |
There was a problem hiding this comment.
we don't need Objects#requireNonNull everywhere, we trust ourselves, other users should handle it on their end i believe
| UpdateBuilder<ParcelTable, Object> builder = dao.updateBuilder(); | ||
| builder.updateColumnValue(STATUS_COLUMN, ParcelStatus.COLLECTED); | ||
| builder.where() | ||
| var where = builder.where() |
| return result; | ||
| } | ||
|
|
||
| private static void validateSend(Player sender, Parcel parcel, List<ItemStack> items) { |
There was a problem hiding this comment.
question: is all of the validation stuff here REALLY needed?
| when(repository.delete(org.mockito.ArgumentMatchers.any())) | ||
| .thenReturn(CompletableFuture.completedFuture(1)); | ||
| when(repository.save(org.mockito.ArgumentMatchers.any())) |
| } | ||
| jvmArgs( | ||
| "-Dcom.mojang.eula.agree=true", | ||
| "-Xlog:aot=info" |
There was a problem hiding this comment.
| "-Xlog:aot=info" |
| // jvmArgs("-XX:AOTCacheOutput=server.aot") | ||
| jvmArgs("-XX:AOTCache=server.aot") |
There was a problem hiding this comment.
| // jvmArgs("-XX:AOTCacheOutput=server.aot") | |
| jvmArgs("-XX:AOTCache=server.aot") |
use tack instead https://github.com/PaperMC/tack
| options.release = 21 | ||
| } | ||
| subprojects { | ||
| apply(plugin = "java") |
There was a problem hiding this comment.
isn't this considered a legacy way of loading plugins?
…alCodeTeam/ParcelLockers into codex/issue-176-api-module
Summary
parcellockers-apiandparcellockers-pluginmodulesParcelLockersProviderentry pointcom.eternalcode:parcellockers-api:0.5.0-BETAwith sources and JavadocsWhy
External plugins currently cannot depend on a small, supported ParcelLockers contract without coupling to the complete plugin implementation. The new module provides a consumer-facing artifact for listening to events and managing parcels and lockers through service interfaces.
Impact
Existing plugin wiring now registers the public API provider during startup and clears it during shutdown. Consumers can compile against the API artifact while implementation details remain in the plugin module and deployable shadow JAR.
Verification
./gradlew :parcellockers-api:test --rerun-tasks:parcellockers-plugin:testmatrix covering all 17 unit-test classesgit diff --checkBoth Gradle test runs completed with
BUILD SUCCESSFULon the final commit.Docker/Testcontainers integration tests were intentionally skipped. H2/PostgreSQL schema-upgrade and cross-table transaction scenarios will be verified manually.
Closes #176