McJtyMods / RFToolsUtility

Everything from RFTools that doesn't fit in its own mod
MIT License
19 stars 18 forks source link

[1.18.1] NPE crash when joining a new world #117

Closed Bass2style closed 2 years ago

Bass2style commented 2 years ago

Hi,

when RFTools utility is present in my pack, the pack is crashing when joining a new world. (not tested on already generated ones.)

here are some logs : https://gist.github.com/Bass2style/5392ad11b9940966cb3a0460bd43f0f6 https://gist.github.com/Bass2style/feed5388e99f6923fb08e20678fd3753

other RFTools mod seems starting without issues, only Utility seems crashing.

thanks for porting RFTools to 1.18 btw.

have a nice day.

McJty commented 2 years ago

Hmm it's actually crashing in cyclopscore. Can you also report to them?

Bass2style commented 2 years ago

yes, creating a report on their side also.

i should try without cyclopscore also.

edit : on their git, there is a closed report about a similar issue on MC 1.16.5 with RFTools Base : https://gist.github.com/Darkere/6917f003a6265a24c68940321091c17f reporting this one anyway because of different Forge and MC version, but it seems similar to this bug.

AbsolemJackdaw commented 2 years ago

Cyclopse Core isn't at fault here. They just check caps to be notnull.

I myself am redirecting a ticket I got to RFToolsUtility, as my mod isn't showing up in the log, but rf tools is

ArtixAllMighty/PublicGuiAnnouncement#1

this old ticket got reopened for it, and has some more detail.

a short resume of the issue :

Cyclops Core checks for capabilities not being null

https://github.com/CyclopsMC/CyclopsCore/blob/release-/src/main/java/org/cyclops/cyclopscore/modcompat/capabilities/DefaultCapabilityProvider.java#L21

Pga used to have this issue due to complications. That issue got once resolved, and doesn't figure in the latest crash the end user has submitted.

I myself, for my mod, got the issue resolved by :

providing a lazy optional (which I didn't do before)

src/main/java/subaraki/pga/capability/ScreenData.java

and by fixing a registry issue

https://github.com/ArtixAllMighty/PublicGuiAnnouncement/pull/2

I have no further detail as the end user hasn't given any more.

AbsolemJackdaw commented 2 years ago

https://github.com/McJtyMods/RFToolsUtility/blob/1.18/src/main/java/mcjty/rftoolsutility/playerprops/PlayerExtendedProperties.java#L13

Buff_Capability seem to be null in a first instance. I am reading trough your code, but am currently not able to find anywhere this field is being set.

proposed fix :

public static Capability<BuffProperties> BUFF_CAPABILITY; to public static Capability<BuffProperties> BUFF_CAPABILITY = CapabilityManager.get(new CapabilityToken<>(){});

McJty commented 2 years ago

You are right. I will fix this

McJty commented 2 years ago

Fixed in RFTools Utility 4.0.4