Skip to content

feat: use Player#getPing for 1.17+ - #83

Merged
iGabyTM merged 2 commits into
masterfrom
feature/use_ping_method
Aug 27, 2023
Merged

feat: use Player#getPing for 1.17+#83
iGabyTM merged 2 commits into
masterfrom
feature/use_ping_method

Conversation

@iGabyTM

@iGabyTM iGabyTM commented Jun 18, 2023

Copy link
Copy Markdown
Member

This was suggested by @Tanguygab on discord:

Hey, just realized that 1.17 added a getPing method in the Player class, it could be better to use that in the Player Expansion in case another version changes the ping field, so you use reflection as usual for 1.16- (the field is just "ping" I think) and on 1.17+ you use the method
It would prevent the placeholder to break on new MC versions, again

By doing this we won't need to update the expansion on every release that changes the name of the ping field
I somehow forgot to commit this 🤦‍♂️
Tanguygab added a commit to Tanguygab/Player-J17-Expansion that referenced this pull request Aug 25, 2023
@Tanguygab Tanguygab mentioned this pull request Aug 27, 2023
@iGabyTM
iGabyTM merged commit 66bc5ae into master Aug 27, 2023
@iGabyTM
iGabyTM deleted the feature/use_ping_method branch August 27, 2023 12:46
@NicoNekoDev

Copy link
Copy Markdown

Please release an update fixing errors with 1.20+ related to this.

@iGabyTM

iGabyTM commented Oct 9, 2023

Copy link
Copy Markdown
Member Author

Version 2.0.5 Release Notes
Adds support for ping on 1.20.x

https://api.extendedclip.com/expansions/player/

@Tanguygab

Tanguygab commented Oct 9, 2023

Copy link
Copy Markdown

1.20.2 broke it again and the 2.0.6 release doesn't use the getPing() method from Spigot API yet so it still tries to find the field from older versions

@NicoNekoDev

Copy link
Copy Markdown

For me it shows that the latest version is 2.0.5 updated on June 16, 2023, this pull request was merged on August 27, 2023.
On 1.20.2, version 2.0.5 is broken with the error shown in issue #88

@iGabyTM

iGabyTM commented Oct 9, 2023

Copy link
Copy Markdown
Member Author

Ahh I see. I will release an update in a few.

@iGabyTM

iGabyTM commented Oct 9, 2023

Copy link
Copy Markdown
Member Author

It is live @NicoNekoDev you can download it manually from the eCloud, it will take 1-2h to be available in game due to caching.

@Tanguygab

Copy link
Copy Markdown

The code of the expansion on the ecloud doesn't match the one from the repo, people are still experiencing the issue (I just tried and I can confirm it still happens)
image
image

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants