Fix GUI drag & econ config source - #39
Closed
ALingqing wants to merge 7 commits into
Closed
Conversation
Update CI and release GitHub Actions to use Gradle instead of Maven. Changes in .github/workflows/ci.yml and release.yml: switch cache to "gradle", add gradle/actions/setup-gradle@v4 step, replace mvn commands with "gradle clean build shadowJar", and update artifact paths from target/metro-*.jar to build/libs/metro-*.jar (including release upload).
Replace Gradle steps with Maven in .github/workflows/ci.yml and .github/workflows/release.yml: switch cache from "gradle" to "maven", remove the setup-gradle action, run `mvn -B clean verify package` instead of Gradle tasks, update artifact paths from `build/libs/metro-*.jar` to `target/metro-*.jar`, and adjust the release action to use the Maven-built artifact. This aligns CI and release pipelines with a Maven build setup.
Disallow players from dismounting while the train is moving by cancelling VehicleExitEvent when not at a stop and sending a localized message; clear scoreboard only after a valid dismount. Add `cannot_dismount` localization entries for multiple languages. In TrainMovementTask, call settleDistanceFare(stop) before early-return so distance fare is always settled even if stopPointLocation is null, and update session.entryStopId when consuming distance so INTERVAL mode calculates the next segment from the current stop. Modified VehicleListener, TrainMovementTask.kt and several lang/*.yml files.
Train fare calculation: add totalVariableCharged to TrainSession and enforce a rule.maxPrice cap across the trip when computing variable fares. Compute raw variable price, limit it by remaining maxPrice (minus basePrice and already charged variable amount), apply an in-game time-based discount to produce the final charged amount, and charge/format the finalPrice to the passenger. Update totalVariableCharged using the pre-discount variable amount so the maxPrice cap behaves correctly. (Changes in TrainMovementTask.kt and TrainSession.kt)
Construct TicketService using getConfig().getBoolean("economy.enabled", true) instead of ConfigFacade.isEconomyEnabled(), and change ConfigFacade's default economyEnabled from true to false. Affects Metro.java and ConfigFacade.kt. Ensures ticket service reads the current config value and makes economy opt-in by default to avoid accidental enablement.
Add dynamic Vault provider refresh and event listeners (VaultIntegration.kt) so the plugin detects economy services at runtime and on service register/unregister. Register and refresh Vault on plugin command load (MetroMainCommand) and use configFacade.isEconomyEnabled() in Metro. Fix GUI inventory handling to use InventoryView.getTopInventory() and correct slot bounds checks (GuiListener). Make TicketService robust to owner deposit failures by refunding the passenger and returning TRANSACTION_FAILED. Update and add unit tests for VaultIntegration, GuiListener, and TicketService to cover the new behavior. Co-Authored-By: Shu Hu <angushushu@outlook.com>
Member
|
已在plugins主repo解决 |
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.
Fix GUI item drag issue by improving drag detection with slot range check. Unify economy config source by using ConfigFacade instead of direct config access. Fix ConfigFacade default field value for consistency.