Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix double charge for /tpa when target has /tpauto on #4862

Merged
merged 1 commit into from
Mar 20, 2022

Conversation

mdcfe
Copy link
Member

@mdcfe mdcfe commented Mar 19, 2022

Information

This PR fixes #4854.

Details

Proposed fix:
If a player uses /tpa to request a teleport to someone with /tpauto enabled, /tpa manually creates a charge for the teleportation.
This PR changes the subsequent code to throw a NoChargeException instead of returning, meaning only the AsyncTeleport charge is applied, not the standard command one.

Environments tested:

OS: Windows 11 22000.556

Java version: Eclipse Temurin 17.0.1+12

  • Most recent Paper version (1.18.2, git-Paper-264)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

2022-03-19_15-49-32_javaw

@mdcfe mdcfe added this to the 2.20.0 milestone Mar 19, 2022
@mdcfe mdcfe added bug: confirmed Confirmed bugs in EssentialsX. type: bugfix PRs that fix bugs in EssentialsX. labels Mar 19, 2022
@mdcfe mdcfe merged commit c4f10d9 into 2.x Mar 20, 2022
@mdcfe mdcfe deleted the fix/tpauto-double-charge branch March 20, 2022 11:19
PureGero pushed a commit to CritterzNFT/Essentials that referenced this pull request Apr 20, 2022
If a player uses `/tpa` to request a teleport to someone with `/tpauto` enabled, `/tpa` manually creates a charge for the teleportation.  
This PR changes the subsequent code to throw a `NoChargeException` instead of returning, meaning only the `AsyncTeleport` charge is applied, not the standard command one.

Fixes EssentialsX#4854.
@mdcfe mdcfe modified the milestones: 2.20.0, 2.19.5 Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: confirmed Confirmed bugs in EssentialsX. type: bugfix PRs that fix bugs in EssentialsX.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TPAing to someone with tpauto on and command costs on charges twice
2 participants