The Spice of Life

The Spice of Life

16M Downloads

1.9.4 Crash when loading world

ariosos opened this issue ยท 4 comments

commented

Getting this error when loading a world - http://pastebin.com/tNTi6ihM

Forge Version: 12.17.0.1963
Mods:
Charset-mc1.9.4-0.3.0-pre8-4229a612686b6881
generators-0.9.20.1-mc1.9.4
AppleCore-mc1.9.4-1.3.4
bdlib-1.11.0.1-mc1.9.4
BiomesOPlenty-1.9.4-4.1.0.2026-universal
BloodMagic-1.9.4-2.0.1-43
chiselsandbits-10.5
combathelp-1.9.4-1.0.2
deepresonance-1.9.4-1.2.0beta33
ElecCore-1.9.4-1.5.292
EnderIO-1.9.4-3.0.0.40_alpha
EnderZoo-1.9.4-1.2.2.40
EnderCore-1.9.4-0.4.0.24-alpha
extrautils2-1.9.4-alpha-1.0.0a
flatcoloredblocks-mc1.9.4-v3.0
fluxducts-mc1.9.4-1.0.4
FluxedRedstone-2.2.1.44
forestry_1.9.4-5.0.13.158
Guide-API-1.9.4-2.0.0-37
industrialcraft-2-2.5.23-ex19
ironchest-1.9.4-6.0.145.787
journeymap-1.9.4-5.2.3-unlimited
jei_1.9.4-3.6.3.212
JustEnoughResources-1.9.4-0.4.6.36
JustEnoughTooltips-1.9.4-2.1.32
LLOverlayReloaded-1.0.7-mc1.9.4
Mantle-1.9.4-0.10.1.jenkins142
mcjtylib-1.9.4-1.9.0
MmmMmmMmmMmm-1.11
notenoughwands-1.9.4-1.3.4
Pam's HarvestCraft 1.9.4a
PlayerRugs-1.9.4-1.3.2
Psi-beta-33
Quark-beta-24
RebornCore-1.9.4-2.5.4.47-universal
rftools-1.9.4-4.60
rftoolsdim-1.9.4-4.30beta42
simplegenerators-1.9.4-0.6.0a
inventorysorter-1.9.4-0.9.1+41
simpleretrogen-1.9.4-3.0.1+6
Tesla-1.9.4-1.1.0.24
theoneprobe-1.9.4-1.0.8
SpiceOfLife-mc1.9.4-1.3.2
Tinkers' Addons-1.9.4-1.0.1
TConstruct-1.9.4-2.3.1.jenkins229
valkyrielib-1.9.4-0.9.9
Waila-1.7.0-B3_1.9.4
WailaHarvestability-mc1.9-1.1.7
Wawla-1.9.4-2.2.1.192
zoology-1.9.4-alpha-1.1.0

commented

Well that's certainly an interesting crash. I'm brand new to capabilities, so I may have implemented something incorrectly. Tagging @McJty to see if he can help set me straight (since it's his capability that I'm getting returned), or if he can give any more info about this.

Relevant code:

commented

In looking at this a bit more, it seems like it could be any mod in the list causing this, and it's hard to know which. As far as I can tell, both TSoL and @McJty's CombatHelp mod implement ICapabilityProvider.getCapability such that this error wouldn't be possible, so it could be some other mod causing this.

I guess that's an unfortunate side-effect of capabilities--any one mod that implements ICapabilityProvider.getCapability incorrectly can cause very hard-to-trace problems in other mods that assume correctness. (edit: I was wrong about this)

I guess I could do an instanceof check to fix this on my end, although it'd be good to also find the root cause.

commented

On third thought, I'm not sure there's anything I can do to fix this, given that CapabilityDispatcher.getCapability iterates its ICapabilityProvider array in a consistent order (a pretty safe bet). Whatever mod is returning the wrong capability will always return it, meaning I could never actually retrieve my own capability...

Will have to find the mod that's returning the passed in capability unchecked in their ICapabilityProvider.getCapability implementation and get it fixed on their end. (edit: it actually can't be some other mod returning an instance of the capability that only CombatHelp would have, it would have to be returned by CombatHelp)

All that said, I could be totally wrong about all of this. ๐Ÿ˜„

commented

Haha, okay I'm a dumb and was wrong about everything. I think @McJty and I actually made the exact same mistake, and therefore our wires are getting crossed.

Neither of us are registering our capabilities with CapabilityManager.INSTANCE, which means that our @CapabilityInject annotated fields never get populated, which means that we're sending null to getCapability, which then 'succeeds' the conditional and we return our capabilities to eachother incorrectly.

Will fix, thanks for reporting this. Might also be nice to add a null check in Forge to stop stupidity like this ๐Ÿ˜„