Posted April 21, 201510 yr 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
April 21, 201510 yr 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?
April 21, 201510 yr 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.