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

disguise api #10478

Closed

Conversation

yannicklamprecht
Copy link
Contributor

@yannicklamprecht yannicklamprecht commented Apr 28, 2024

relates to #10584

Adds a simple disguise api that also makes sure that invalid entity data, not belonging to the type that is faked, is filtered.
It also adds a server generator module to reduce maintenance of the entity data filter.

tldr; The API provides a way to disguise any entity as another or a player with having the possibility to interact with the entity like with any others. The big advantage is that you've the whole vanilla logic and Mob Goal and Pathfinding included without hassle.

Testing the changes can be done using the following snippet:
https://gist.github.com/yannicklamprecht/639acba127a54f5617e1281f099b7aff

TODO:

  • Add JavaDoc
  • remove test plugin code
  • comment paper-server-generator
  • figure out how to get teams working with real teams, client side ones worked in my fork Non issue just use the Entity#getName() instead of the Entity#getScoreboardEntryName()
  • remove player profile if player disguise on ServerEntiry#removePairing(player) to avoid client disconnects when moving away and approaching again. see disguise api #10478 (comment)
  • wait until dev/1.21 is merged into master
  • When player is disguised as entity his attributes are propagated to the client, which isn't supported by certain entities
  • When player is disguised as entity that has no ability to interact/build, the server should not propagate the players action to the rest of the players. Otherwise the other player gets kicked.
  • When changing disguise while in visible range from e.g. Boat to a Living entity disguise, attributes will be sent again. -> on disguise change => auto hide and show entity to players.

Effective loc:

  • 600 loc in patches
  • 3k+ loc generated filter classe
  • 400 loc generator code copied from api-generator
  • 100 loc for generating the filter class.

@yannicklamprecht yannicklamprecht force-pushed the feature/disguise-api branch 4 times, most recently from ce89b24 to 9c2de57 Compare April 29, 2024 18:56
patches/api/0475-add-disguise-api.patch Outdated Show resolved Hide resolved
patches/api/0475-add-disguise-api.patch Outdated Show resolved Hide resolved
@kashike kashike added the type: feature Request for a new Feature. label Apr 29, 2024
@yannicklamprecht yannicklamprecht force-pushed the feature/disguise-api branch 11 times, most recently from 0271101 to d38b35d Compare May 4, 2024 13:00
@yannicklamprecht yannicklamprecht force-pushed the feature/disguise-api branch 4 times, most recently from cf41890 to 9d0fd05 Compare May 4, 2024 14:05
@yannicklamprecht yannicklamprecht force-pushed the feature/disguise-api branch 6 times, most recently from 95a1c30 to 953e97a Compare November 4, 2024 00:23
@yannicklamprecht yannicklamprecht force-pushed the feature/disguise-api branch 6 times, most recently from f3e843a to 3c90ec6 Compare November 24, 2024 19:36
@yannicklamprecht yannicklamprecht force-pushed the feature/disguise-api branch 5 times, most recently from 659c3a7 to 6b3ddb0 Compare December 5, 2024 19:19
@MiniDigger
Copy link
Member

Hey @yannicklamprecht, since I see you rebasing this PR all the time: you really don't need to do that for this particular one.
While we do like this API in principle, it opened up a lot of discussion internally and we are not really sure yet on how we want to land it. We do have an idea on how it could look like post hard fork, but for now you don't need to waste time updating it, unless you need it for your own uses of course.
Thanks for sticking with us!

@MiniDigger MiniDigger added the status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. label Dec 5, 2024
@yannicklamprecht
Copy link
Contributor Author

Hey @yannicklamprecht, since I see you rebasing this PR all the time: you really don't need to do that for this particular one. While we do like this API in principle, it opened up a lot of discussion internally and we are not really sure yet on how we want to land it. We do have an idea on how it could look like post hard fork, but for now you don't need to waste time updating it, unless you need it for your own uses of course. Thanks for sticking with us!

  1. It's a no brainer to update the pr.
  2. I need the feature in my own fork and I'm to lazy to workaround the fact that code generation for forks isn't working that easy after a code gen change somewhere this year.

and generate maps to allow entity metadata syncher validation
@yannicklamprecht
Copy link
Contributor Author

Post hardfork MR: #11793

@yannicklamprecht yannicklamprecht deleted the feature/disguise-api branch December 23, 2024 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pre-softspoon status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: feature Request for a new Feature.
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

6 participants