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 32 commits 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

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
Machine-Maker and others added 25 commits June 13, 2024 13:14
The player sample uses game profile internally, but discards everything but the name and uuid and does not follow player profile restrictions, so it doesn't make sense to use that in the event.
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
befcf86d SPIGOT-7740: Fix using new map cursor types
09229095 Add EntityDamageEvent.DamageCause#CAMPFIRE

CraftBukkit Changes:
a1d2cd152 SPIGOT-7747: Mob head is not dropped when mob was blown up by a charged creeper
8078294bc SPIGOT-7746: Server Crashing when Players Getting into End Portals
8d842e250 SPIGOT-7744: Fix exception for shooting projectiles with flame enchantment
64e0ad129 SPIGOT-7744: Fix crash when shooting arrows in creative mode
819f7a10a Fix player items not dropping on death
0a0229bb5 Implement DamageCause#CAMPFIRE and minor improvement in exception for Unhandled block damage
Mostly for the primitive long to reference hashtable impl
@yannicklamprecht
Copy link
Contributor Author

yannicklamprecht commented Jun 14, 2024

Update to 1.21. Now we need to wait until dev/1.21 is merged into master.

Machine-Maker and others added 2 commits June 14, 2024 13:11
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.

None yet

8 participants