Skip to content

Conversation

@Jakubk15
Copy link
Member

No description provided.

@Jakubk15 Jakubk15 added the 🆕 feature New feature or request label Nov 15, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Jakubk15, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a comprehensive fee system for sending parcels within the plugin, leveraging the Vault economy API. It allows server administrators to configure different costs for various parcel sizes, enhancing the in-game economy and resource management. The changes include core plugin modifications for economy integration, new configuration options for fees, and user-facing messages for transaction feedback.

Highlights

  • Vault Economy Integration: The plugin now integrates with the Vault API, a standard for economy management in Minecraft servers, to handle in-game currency transactions for parcel services.
  • Configurable Parcel Fees: New configuration options have been introduced to allow server administrators to set distinct fees for sending small, medium, and large parcels.
  • Fee Withdrawal Logic: When a player sends a parcel, the system now checks their balance and automatically withdraws the configured fee. A bypass permission (parcellockers.fee.bypass) is available to exempt players from these charges.
  • User Feedback Messages: New messages have been added to inform players if they have insufficient funds to send a parcel or to confirm a successful fee withdrawal.
  • Build System Updates: The build.gradle.kts file has been updated to include the VaultAPI dependency and declare Vault as a required server dependency, ensuring proper plugin loading and functionality.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a fee system for sending parcels, integrating with Vault for economy management. The changes include updating the build configuration to add Vault dependencies, modifying the main plugin class to handle Vault setup, and implementing the fee logic within the ParcelServiceImpl.

My review has identified a critical issue where a constructor change was not propagated to its call site, which will cause a compilation failure. I've also pointed out a couple of medium-severity issues related to dependency declaration in Gradle and locale-sensitive string formatting that could lead to bugs in different server environments. Overall, the core logic for the fee system is well-implemented, but the identified issues should be addressed to ensure the plugin is functional and robust.

Comment on lines +90 to +94
if (!this.setupEconomy()) {
this.getLogger().severe("No economy provider registered! Disabling...");
server.getPluginManager().disablePlugin(this);
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The instantiation of ParcelServiceImpl in ParcelLockers.java was not updated to match the new constructor signature. This will cause a compilation error. You need to pass the config and economy instances when creating ParcelService.

I am commenting here as this is the closest related change, but the actual fix is in ParcelLockers.java at line 123.

Comment on lines 44 to 48
NoticeService noticeService,
ParcelRepository parcelRepository,
ParcelContentRepository parcelContentRepository,
Scheduler scheduler
Scheduler scheduler, PluginConfig config, Economy economy
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

critical

The constructor signature has been updated. This is a breaking change, and the call site in ParcelLockers.java where ParcelServiceImpl is instantiated has not been updated to reflect this. This will cause a compilation error. Please update the instantiation to pass the new config and economy arguments.

Example fix in ParcelLockers.java:

// ...
ParcelService parcelService = new ParcelServiceImpl(
    noticeService,
    parcelRepository,
    parcelContentRepository,
    scheduler,
    config, // add this
    this.economy // add this
);
// ...

repositories {
gradlePluginPortal()
maven { url = uri("https://maven-central.storage-download.googleapis.com/maven2/")}
maven("https://maven-central.storage-download.googleapis.com/maven2/") // maven central mirror
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better readability and to adhere to Gradle best practices, it's recommended to use the mavenCentral() method instead of a hardcoded URL for the Maven Central repository.

    mavenCentral()

this.noticeService.create()
.notice(messages -> messages.parcel.insufficientFunds)
.player(sender.getUniqueId())
.placeholder("{AMOUNT}", String.format("%.2f", fee))
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Using String.format without a Locale can lead to incorrect formatting on systems with different locale settings (e.g., using a comma as a decimal separator instead of a period). This can cause issues with how the fee is displayed. It's safer to specify a fixed locale, like java.util.Locale.US, to ensure consistent formatting.

Suggested change
.placeholder("{AMOUNT}", String.format("%.2f", fee))
.placeholder("{AMOUNT}", String.format(java.util.Locale.US, "%.2f", fee))

this.noticeService.create()
.notice(messages -> messages.parcel.feeWithdrawn)
.player(sender.getUniqueId())
.placeholder("{AMOUNT}", String.format("%.2f", fee))
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Using String.format without a Locale can lead to incorrect formatting on systems with different locale settings (e.g., using a comma as a decimal separator instead of a period). This can cause issues with how the fee is displayed. It's safer to specify a fixed locale, like java.util.Locale.US, to ensure consistent formatting.

Suggested change
.placeholder("{AMOUNT}", String.format("%.2f", fee))
.placeholder("{AMOUNT}", String.format(java.util.Locale.US, "%.2f", fee))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants