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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
@XxGoldenbluexX
Copy link

good job!

@yannicklamprecht yannicklamprecht force-pushed the feature/disguise-api branch 3 times, most recently from ad09e98 to 39e3f2f Compare August 15, 2024 20:37
@yannicklamprecht yannicklamprecht force-pushed the feature/disguise-api branch 2 times, most recently from f6b519e to 8ad066c Compare August 31, 2024 18:28
@yannicklamprecht yannicklamprecht force-pushed the feature/disguise-api branch 7 times, most recently from b9dd027 to 44df8ba Compare November 3, 2024 21:21
@yannicklamprecht yannicklamprecht force-pushed the feature/disguise-api branch 6 times, most recently from 95a1c30 to 953e97a Compare November 4, 2024 00:23
and generate maps to allow entity metadata syncher validation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Request for a new Feature.
Projects
Status: Awaiting review
Development

Successfully merging this pull request may close these issues.

6 participants