Materialis

Materialis

2M Downloads

If ConArm is installed, cancelling materials crashes

phantamanta44 opened this issue ยท 1 comments

commented

In particular, this code in ModuleConarm:

TinkerRegistry.addMaterialStats(material,
    new CoreMaterialStats(head.durability / 30, head.attack * 2.2F),
    new PlatesMaterialStats(handle.modifier, handle.durability / 17, toughness),
    new TrimMaterialStats(extra.extraDurability / 16));

...will always NPE, since the head, handle, and extra will be null if the material registration is cancelled.
This can be fixed by either null-checking here, or by swapping the order of material and stat registrations (e.g. by swapping the two lines here).

commented

I don't think this is a big deal since it only happens if you disable the material with an external mod instead of using the materialis config to disable it but I'll fix this.