Dungeons Gear

Dungeons Gear

6M Downloads

Crash with mod dark caverns

freeeranger opened this issue ยท 3 comments

commented

Hey! Just tested my new mod with your mod dungeons gear and noticed that they are incompatible (crash on world load, stops at 100%). Here's the crash report: https://pastebin.com/73Hxxkby. The actual crash seems to happen on your side but I'm not really sure who's fault it his or really how to fix it at all. Would be nice if we could come up with a solution to allow the mods to be used alongside each other.

commented

Strange. Something has to be up with someone's implementation of getCapability.

This is my combo capability getter implementation:

@Nonnull
    @Override
    public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) {
        return cap == COMBO_CAPABILITY ? instance.cast() : LazyOptional.empty();    
    }

This is your gateway cap's:

@Nonnull
    @Override
    public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) {
        return cooldownOptional.cast();
    }
commented

@freerangerstudios directly casting does not check whether the capability is actually an instance of your capability. I write mine like so:

@Nonnull
    @Override
    public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) {
        return CAP.orEmpty(cap, instance);
    }

This is identical to Infamous' implementation, except forge innately provides the comparison.

commented

Thanks for the help! Uploading a hotfix now that'll fix the compatibility issues.