Skip to content

Fix GUI drag & econ config source - #39

Closed
ALingqing wants to merge 7 commits into
CubeX-MC:mainfrom
ALingqing:main
Closed

Fix GUI drag & econ config source#39
ALingqing wants to merge 7 commits into
CubeX-MC:mainfrom
ALingqing:main

Conversation

@ALingqing

Copy link
Copy Markdown
Collaborator

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.

@ALingqing ALingqing closed this Jul 21, 2026
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).
@ALingqing ALingqing reopened this Jul 21, 2026
@ALingqing ALingqing closed this Jul 21, 2026
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.
@ALingqing ALingqing reopened this Jul 21, 2026
ALingqing and others added 4 commits July 22, 2026 11:05
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>
@angushushu

Copy link
Copy Markdown
Member

已在plugins主repo解决

@angushushu angushushu closed this Jul 25, 2026
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.

2 participants