Tetra

Tetra

12M Downloads

Null passed into `ModuleItem::applyDamage`

noobanidus opened this issue ยท 1 comments

commented

So I'm struggling to track this properly as the code on GitHub doesn't appear to reflect the code in the latest versions. Please push! The crash report is here.

While I've found it difficult to trace this back without access to the complete deobfuscated code, using a decompiler on the main JAR I've managed to work out that the eventual predecessor call for applyDamage is in HammerBaseTile::tick via applyOutcome, which very specifically has the player field as @Nullable and which seems to be passed in from the HammerBaseTile::tick as null.

Thus, the core issue appeasr to be roughly line ~455 of ModularItem:

itemStack.func_222118_a(reducedAmount, responsibleEntity, breaker -> breaker.func_213334_d(breaker.func_184600_cs()));

I believe this final lambda should become breaker -> breaker != null ? break.func... etc.

commented

Curse you for fixing it.