Jump to content

Recommended Posts

Posted (edited)

Hello everyone.

The problem I have is that every time I try accessing my capability I get a null pointer exception.

Do I have to send packets to the client at the start of the game to prevent this?

Because I thought you only need packets to update information.

 

Default Implementation:

  Reveal hidden contents

Storage:

  Reveal hidden contents

Provider:

  Reveal hidden contents

Capability Handler:

  Reveal hidden contents

 

Other Handler:

  Reveal hidden contents

Common Proxy:

  Reveal hidden contents

 

 

 

 

 

 

 

 

Edited by SaltStation
typo
Posted
  On 5/8/2019 at 6:16 PM, SaltStation said:

Common Proxy:

  Reveal hidden contents
Expand  

Don't use a CommonProxy, it makes no sense. Proxies exist to separate sided only code. If your code is common it goes anywhere else but your proxy. This might be the cause of your issue, but

 

  On 5/8/2019 at 6:16 PM, SaltStation said:

CapabilityManager.INSTANCE.register(IFatigue.class,new FatigueStorage(),Fatigue.class);

Expand  

Don't use this overload, it's deprecated. Use the one that takes in a Callable as it's last parameter. I think that this is the case of your issue since you don't provide a public parameterless constructor in your implementation.

 

  On 5/8/2019 at 6:16 PM, SaltStation said:

public void registerItemRenderer(Item item, int meta, String id) {

Expand  

Don't use IHasModel?

  • Thanks 1

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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