Jump to content

[1.19.2] ServerSide to ClientSide Open Screen with capability


FantaLaTone

Recommended Posts

I have a capability called NPCTrades and a screen class called NPCScreen.

This is the current packet I am using to handle opening screen: https://gist.github.com/fantalatone/65116264037b83955a99c8c014d328ef 

But with this packet I can't set the hashmap in the constructor method of NPCScreen class (https://gist.github.com/fantalatone/8d309e1c6bcc86a2f5ba92c707a78f4e)

How I can send capability data to a screen class? 

Link to comment
Share on other sites

https://gist.github.com/fantalatone/65116264037b83955a99c8c014d328ef#file-openscreen-java-L31-L41

Let's look at this section. In the constructor, you read the key and value of the map, so it's expected that you write the key and value as well. In the method, you write the key, but then you print the byte buf and the value instead of writing the value.

Link to comment
Share on other sites

5 hours ago, ChampionAsh5357 said:

https://gist.github.com/fantalatone/65116264037b83955a99c8c014d328ef#file-openscreen-java-L31-L41

Let's look at this section. In the constructor, you read the key and value of the map, so it's expected that you write the key and value as well. In the method, you write the key, but then you print the byte buf and the value instead of writing the value.

Alright, so should I write the writeMap() method again under the first one?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.