Construct's Armory

Construct's Armory

30M Downloads

Contenttweaker Docs

terrapin47 opened this issue ยท 9 comments

commented

TConstruct-1.12.2-2.10.1.87
conarm-1.12.2-1.1.0
CraftTweaker2-1.12-4.1.9
ContentTweaker-1.12.2-4.8.0

Reading through the docs at https://github.com/TheIllusiveC4/ConstructsArmory/wiki/ContentTweaker, I'm attempting to add a trait to armor, but ExtendedMaterialBuilder doesn't have the method addTrait. Looking through the code, it seems the implemented method name is addMaterialTrait, which should be noted.

However, I'm having some issues using this in a script.

https://pastebin.com/KS8t1yE3

The commented out lines produce the two errors below, the first error when using a string trait, the second when using an ITrait trait. Both seem to point the trait not being registered in tcon, but they should exist. I'm not sure if there's something I'm missing.

commented

Also, I'm unsure how to change the color of the items for custom armors. The textures when you're wearing the armor apply the color of the material you set, but the actual items seem to stay blank.

With color set to 0x9ad5e0:
image

image

commented

The docs make no mention of using addTrait, and as far as I can tell, the Tinkers' module of ContentTweaker also uses addMaterialTrait so everything seems to be in order in that regard unless I'm missing something.

I'm currently investigating the other issues, I'll get back to you on those.

commented

I can see now that they do indeed reference addTrait in their MaterialBuilder docs; however, if you scroll further down, you'll see that their example script does use addMaterialTrait. This is a discrepancy on their end, rather than mine.

Your second link refers to the MaterialRepresentation, which is different than the MaterialBuilder we have been discussing. This is the relevant part of the code in their MaterialBuilder, which does use addMaterialTrait rather than addTrait.

commented

I see, was confusing.

commented

Alright, so the traits issue will be fixed in the next update. I missed a part of the update that ContentTweaker did so I just had to readjust some code to match their changes. I should note that there is a problem in ContentTweaker itself with adding traits through ITrait, so you should use the string identifier route in the future.

As for the material being white, this is because you are loading the script incorrectly.
Put #loader contenttweaker at the beginning of your script and it will load the material color correctly.

commented

Ah, I see about the material colors. I missed it because it's only present in their example, and the text formatting makes it look like a comment when you're reading over it.

Great thanks.

commented

Not a big deal, but I was under the impression ExtendedMaterialBuilder extends ContentTweaker's MaterialBuilder, but it actually just shares some code. May want to make note of this in the documentation.

commented

@Partonetrain
Yes, it's not really extending in the true sense, it's just mimicking the same code and building on that. I'll make a note of this in the documentation.