NullPointerExeption in 1.16.x snapshot.
BismuthBorealis opened this issue ยท 4 comments
Issue Description
Well, sorry about this, I rather think it stems from my suggestion a while back :P
it's a NullPointerException upon loading the mod.
I'm not entirely sure what to say in this section not said in below ones. If you want a modlist, I can get you one easily, but I don't think it's important in this case.
What Happens and What You Expect to Happen
It's a loading Error, not much to say, really.
oh, and here's my "artisanworktables.module.Tools.Materials.Custom" file; https://paste.ubuntu.com/p/zHjHDQGPsd/
(not sure how the lang options work, I think that's the cause, not sure, however)
Crash Log
https://paste.ubuntu.com/p/4QTHDzGtsV/
Affected Versions
- Minecraft: 1.12.2
- Forge: 14.23.1.2606
- CraftTweaker: 4.1.4
- Artisan Worktables: 1.15.25-10-gcce9f8f
- Athenaeum: 1.11.5
Thanks for the report!
This error has something to do with the ingredient string. The lang key doesn't seem to be causing an issue. I'm investigating this now.
The lang keys point to entries in a en_us.lang
(or other language) lang file located in a mod's or resource pack's assets
folder.
For example:
"langKey": "material.athenaeum.elementium",
Refers to the entry in the Athenaeum mod's assets/athenaeum/lang
files:
material.athenaeum.elementium=Elementium
You can supply your own lang files using a resource pack or a mod such as Resource Loader.
These lang keys are used when displaying a material's name in-game, like Blacksmith's Elementium Hammer
or Mage's Iron Athame
.
If the material you're adding comes from a mod in the modpack, it is possible that the mod would already have a lang key for the material name that you could use. You could open up the mod's .jar file and dive into the assets/[modname]/lang
folder and inspect those files for a key.
As a last resort, you could simply use the name of the material as the lang key and that would be displayed. For example, using Sand
as the lang key for a sand material would display as Blacksmith's Sand Hammer
or Mage's Sand Athame
. It works, but won't allow for translations.
At some point in the development, ingredientString
was renamed to ingredient
. Comparing your json file to the artisanworktables.module.Tools.Materials.Generated.json
file confirms that it is indeed expecting the object key ingredient
.
Switching that up should fix the issue. :)
I added some simple validation rules and (hopefully) better error reporting for the material files.
In this case, the new validation rules will catch the problem and report:
[12:28:42] [main/ERROR] [artisanworktables]:
com.codetaylor.mc.artisanworktables.modules.tools.material.CustomMaterialValidationException: Material: [terrasteel], key: [ingredient] missing or empty ingredient
[...]
This is intended to improve the error report usability.
I'm going to close this, let me know if you have any more issues with this.