Jump to content

Capability not syncing


The_SlayerMC

Recommended Posts

Hi, I have a mana that's not syncing to client, it has registries and packets, I'm stumped that the mana value is not calling on the client

 

The essence files

The rendering

The overlay registry

Capability registrys

network registry

I am able to call the value fine with an item right clicking but not with the client rendering

Can someone please tell me what im doing wrong

Former developer for DivineRPG, Pixelmon and now the maker of Essence of the Gods

Link to comment
Share on other sites

`RegisterCapabilitiesEvent` is listened to on the mod event bus, not the forge event bus.

Additionally, you're enqueuing work to enqueue work in your packet; this should only be done once. You are probably thinking of `DistExecutor#unsafeRunWhenOn` for the inner supplier.

If using `LazyOptional#orElseThrow`, supply an actual exception to throw on failure, not `null`. You should prefer using `#ifPresent` or anything that doesn't force resolution.

Link to comment
Share on other sites

2 hours ago, ChampionAsh5357 said:

`RegisterCapabilitiesEvent` is listened to on the mod event bus, not the forge event bus.

Forge 43.1.1 or above (which is the case here) adds support for the @AutoRegisterCapability annotation which should be used.

2 hours ago, ChampionAsh5357 said:

If using `LazyOptional#orElseThrow`, supply an actual exception to throw on failure, not `null`. You should prefer using `#ifPresent` or anything that doesn't force resolution.

LazyOptional#ifPresent should only be used if the Capability is written to be not always preset.

Link to comment
Share on other sites

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.