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
base: master
Are you sure you want to change the base?
disguise api #10478
Conversation
ce89b24
to
9c2de57
Compare
9c2de57
to
c37d61b
Compare
0271101
to
d38b35d
Compare
cf41890
to
9d0fd05
Compare
Tested with: Only open part is the discussion for a common generator module |
We should probably move the common generator classes into a separate module to reduce duplications. |
this is complicated enough that we prolly want a lil docs page with an example, but that can wait till after its merged and we know the final api design |
Thought of adding a Java 18+ snippet to the javadoc but a docs page will be better. EDIT: Or do you mean regarding code generation? |
44e49f3
to
3bde094
Compare
I meant the api itself |
14578a4
to
c69f0fc
Compare
Addressed issue with experience orbs by filtering them out. Mentioned that exclusion in the JavaDoc. Additionally found an issue with ElderGuardian when disguising them as a Player on the client side. That happens only when the ElderGuardian is in the water. First thought is the ElderGuardian stream sucking health from other entities. To be sure I need to deobf the client stacktrace. Failed to handle packet adm@395c0068
java.lang.ClassCastException: class gct cannot be cast to class ckb (gct and ckb are in unnamed module of loader 'app')
at fxy.a(SourceFile:1068)
at adm.a(SourceFile:41)
at adm.a(SourceFile:13)
at zz.a(SourceFile:25)
at bpm.d(SourceFile:162)
at bpq.d(SourceFile:23)
at bpm.A(SourceFile:136)
at bpm.bA(SourceFile:121)
at ffh.c(SourceFile:1275)
at ffh.f(SourceFile:888)
at net.minecraft.client.main.Main.main(SourceFile:265) |
That's ClientPacketListener handleEntityEvent, Player can't be cast to Guardian |
Found the reason why. I basically moved away from the entity, the chunk or at least the entities got unloaded. I updated the test plugin snippet to reflect the needed change - cache cleaning on death excluded. It would be way better to persist the disguise data in NBT to avoid manual caching per plugin. |
784c03e
to
0f0d912
Compare
and generate maps to allow entity metadata syncher validation
0f0d912
to
0cc76ef
Compare
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:
figure out how to get teams working with real teams, client side ones worked in my forkNon issue just use theEntity#getName()
instead of theEntity#getScoreboardEntryName()