Jump to content

WORMSTweaker

Members
  • Posts

    25
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

WORMSTweaker's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Okay, removed my set() calls from there What's the proper way to change my values though?
  2. Yes, but I'm not calling set() in my Provider, I'm calling it in a separate class
  3. 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)
  4. So then, instead of callingsendUpdate() in my set() like this I should instead call it each time after I use set(), like this?
  5. I'm sending updates each time I'm calling the set/add/rem of my capability, are they reading from NBT?
  6. 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?...
  7. 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...
  8. 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
  9. 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...
  10. 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?
  11. I thought you meant the setters of my capability, but I suppose it was something else?
  12. 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
  13. 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.
  14. 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?
  15. Well, somehow it doesn't, I forgot to put it, sorry
×
×
  • Create New...

Important Information

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