Add support for Npc Dialogues - #15
Open
TotallyNoCallum wants to merge 5 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is my attempt at adding NPC Dialogues as NpcForms to Cumulus (Would close #4 )
This will also require changes in Geyser (GeyserMC/Geyser#6690), Floodgate works with this without any changes (besides bumping cumulus to 2.0.0 there)
Code for this ^ image
(
armorStandis an ArmorStand in Paper's api)Buttons are also entirely optional (which also means

validResultHandlerintentionally isn't usable in this case)Code for this ^ image
(
fishis a Silverfish in Paper's api)The limitations of this are that Npcforms can only have 6 buttons (from my testing,
adding more causes all the buttons to vanish), and Player/Mannequin entities specifically dont show up in the entity portrait (I believe due to client limitations)I decided on making a
.button()method instead of.button1(),.button2(),.button3(), etc (like how ModalForm has it), as working with 6 button string would get messy imo. Speaking of, I made the buttons Strings instead ofButtonComponents since they cant have images, and also how the json is layed out in the dialogue packet in Geyser/actionJson. Calling.button()when theres already 6 buttons will be silently ignoredFor the
npc_dataandactionJsonvariables inNpcFormImpl.java, I used rtm516/Geyser@95cb8a4 as a reference