Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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? 

  • Author
5 hours ago, ChampionAsh5357 said:

The same way you send other data to the client through a packet? You can send it in the packet you are currently handling.

I tried sending the OpenScreen packet from a custom command but it didn't worked

  • Author
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?

  • Author
4 hours ago, ChampionAsh5357 said:

You should write the value, you are already writing the map, albeit partially.

I did a lot of changes. Now all I need to do sync the HashMap data from server to client. I am using menus now. How I can sync the hashmap?

2 hours ago, FantaLaTone said:

I did a lot of changes. Now all I need to do sync the HashMap data from server to client. I am using menus now. How I can sync the hashmap?

Same way as you did in the packet, fixing the issue where you don't write the value. You will need to use IContainerFactory now for the menu though.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.