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

So I am using IExtendedEntityProperties for my mod, but I have a problem with it. When another player joins a LAN world for the first time, it won't call readFromNBT on it. However, if I join again after that it does get called. I have used IExtendedEntityProperties and never got a problem with this. So that's why I posted this here.

 

You can find the source code here: https://github.com/gegy1000/WarriorsMod/blob/master/src/main/java/net/gegy1000/warriors/common/data/WarriorCatData.java

 

And my Event:

https://github.com/gegy1000/WarriorsMod/blob/master/src/main/java/net/gegy1000/warriors/common/event/CommonEventHandler.java

  • Author

Of course it won't call it. Since the player has never been on the server before there is no data from previous connections that could be read. This is not any different from normal servers.

Makes sense, ok. I will try think of another way to do this. Because as you can see in my read, I am getting a random name if it doesn't already have one... What event would I use if I wanted it to get called sometime after read is called?
  • Author

Make a lazy getter. If the field is null, make a random name and store it. If it's not null, just return it.

Of course now you have to send a packet once the field is created.

Ok thanks, everything is working now!

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.