
-
[1.12.2] Getting a player capability for render
Okay, removed my set() calls from there What's the proper way to change my values though?
-
[1.12.2] Getting a player capability for render
Yes, but I'm not calling set() in my Provider, I'm calling it in a separate class
-
[1.12.2] Getting a player capability for render
I don't see where or when I'm reading from NBT though Again, I'm a bit lost (but things works like I want them to right now)
-
[1.12.2] Getting a player capability for render
So then, instead of callingsendUpdate() in my set() like this I should instead call it each time after I use set(), like this?
-
[1.12.2] Getting a player capability for render
I'm sending updates each time I'm calling the set/add/rem of my capability, are they reading from NBT?
-
[1.12.2] Getting a player capability for render
I was away for a few days, so sorry for the late response, I think I finally understood now So, before, my instance was created like this: private IPSize instance = SIZE_CAPABILITY.getDefaultInstance(); This is how I've seen every capability instance being created in the examples that I found I suppose that wasn't good, since I can't pass the player this way, so instead i'm doing this: private IPSize instance = new PSize(player); Where player is set trough the constructor of the Provider This should be good (?), but again I'm not 100% sure this is correct, and what's you're expecting me to do The constructor of PSize is simply this and player is used by sendUpdate() that I detailed in earlier posts However, I get a NullPointerException when deserializeNBT() is called, so I suppose that somehow player in the Provider isn't set correctly?...
-
[1.12.2] Getting a player capability for render
Okay hmm... I... do not see how I could pass the player to the capability. Could you give me an example? Because i'm getting a bit lost right now...
-
[1.12.2] Getting a player capability for render
I cannot access PSizeProvider.player otherwise I suppose I misunderstood how you wanted me to store/retrieve EntityPlayer from the Provider And yes I do understand what static means, I just didn't thought about this when I wrote this, sorry
-
[1.12.2] Getting a player capability for render
Okay, I've done it like this I've put this in the Provider And I simply access it like this Doing this do raise some exception tho; so I must be doing something wrong again eh...
-
[1.12.2] Getting a player capability for render
Hmm. I'm having trouble understanding what you want me to do then... Right now, my AttachCapabilitiesEvent looks like this My PSizeProvider class looks like this Knowing this, how can I to my PSizeStorage class?
-
[1.12.2] Getting a player capability for render
I thought you meant the setters of my capability, but I suppose it was something else?
-
[1.12.2] Getting a player capability for render
Okay, now the problem is, by passing EntityPlayer in my setters it break my readNBT() method of my storage class, since i'm calling instance.set(), and now it need an EntityPlayer to be passed I do not see an obvious way to specify it tho, simply using Minecraft.getMinecraft().player doesn't work and simply result in a NullPointerException
-
[1.12.2] Getting a player capability for render
Okay, moved all rendering to a separate class So I just need to remove onPlayerUpdate of my code, alright Sending the packet each time the setter is called EDIT : Okay, the problem is, by doing it like this it break my readNBT method of my storage class, since i'm calling instance.set(), and now it need an EntityPlayer to be passed, I don't see an obvious way to specify it tho Removed sendToAll() Sorry about the copy pasting, bad habit of mine. Moved every similar packet related things into a private sendUpdateMessage() method.
-
[1.12.2] Getting a player capability for render
Where should I move the RenderPlayerEvent? Changed, in my case, is it better to use START or END ? Removed the check How can I check if the value has changed? Should I simply store it temporarily and then send it if the temp value is different than the current value? Applied everything, is this correct?
-
[1.12.2] Getting a player capability for render
Well, somehow it doesn't, I forgot to put it, sorry
IPS spam blocked by CleanTalk.