-
-
Notifications
You must be signed in to change notification settings - Fork 764
feat: Add primitive support for sound api #1422
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
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
4c5911e
to
00d4dc6
Compare
e91c70a
to
87b0e57
Compare
What is the state of this? I would like to have this feature very much. |
From my end, it is finished, although I would think it makes more sense to make the methods fail silently again. |
|
@astei Could this be reviewed pls. |
@4drian3d Since it has been approved, can this also be merged? |
What is the state of this? We are currently discussing implementing this ourselves, but we would way prefer having it implemented in upstream. |
Apart from maybe adding Javadoc to the RegisteredServer, this PR is ready from my end. |
@4drian3d Do you think additional Javadoc entries are required? Is there an estimate when this might get merged? |
e85d130
to
9671cd3
Compare
@electronicboy |
proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java
Outdated
Show resolved
Hide resolved
Even though the sound should be ignored for invalid entity ids, I still choose to test for the current server and thus require it on the receiver because afaik they are not that unique and if there's some other entity with that id exists, it could cause unwanted consequences. |
Is there any chance that this could be merged soon? I'd love to use it! :) |
I'd wait for 1.21.6 and see how to handle the implementation of Adventure for the new "UI" sound category. Edit: Seems like it was just added to the end of the enum, in vanilla and adventure, so it shouldn't be a problem. |
efac451
to
6514063
Compare
4001892
to
f181376
Compare
Hi, is there a current estimate when this might get merged? :) |
f181376
to
f074497
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
It works quite well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not implement the Player#playSound(Sound) method as adventure defines it like this:
Plays a sound at the location of the recipient of the sound.
Since we can't fulfill that, would it be fine to break that contract by replacing the javadoc?
I'll be honest, I tried this pull request for 30 minutes without knowing why the sound wasn't playing, since stopSound was working for me, until I saw that the From a plugin developer's perspective, this method should be implemented, but from a contract compliance perspective, it's okay not to implement it as required by the contract. With this in mind, good documentation at https://docs.papermc.io/velocity/dev/pitfalls/#audience-operations-are-not-fully-supported would suffice, so I am now reverting my change |
What do you say about stuffing override dialog api methods into this pr as well for documentation purposes? |
fix: implement the correct playSound method fix: bumped "since" version
chore: added own notes to playSound method, as adventure moved them to the Sound class
fix: sound source error on wrong version
Also, improved documentation related to #playSound mehtods
2c4ef4a
to
afa6505
Compare
With this PR, the Adventure-provided sound API is partially implemented.
It adds the ability to play sounds for a player (from the player itself or other players on the same server) and to stop sounds,
while making the methods fail silently if the sound can't be played/stopped.
What this PR implements:
(- This also enables the respective methods on the registered server, by forwarding it to the players)
What this PR doesn't implement:
- A method to play back (custom) sounds for a specific player for players with version 1.19.2 and below
- A method to stop (custom) sounds for players with version 1.19.2 and below
Clarification:
This PR only implements a sound API for version 1.19.3+ because only in this version is the server able to play a (vanilla) sound for a player without requiring a version-dependent id for the sound.