Construct's Armory

Construct's Armory

30M Downloads

[ Question ] Mod integration /addon

HurtsAsHell opened this issue ยท 15 comments

commented

I read what you wrote in md.
My question is, how can I create this addon / integration?
Is there a guide that I can follow?
do i just have to create integration for the basic tinker?

commented

This is a fairly broad question that doesn't really have a good, concise answer. You would create this addon like any other mod, or any other integration if you're talking about adding support to an existing mod that you are developing. There's no guide, the only lead I can give you is to peruse the relevant folder for the classes and methods you might need. Of course I'll always be available if you have any questions, but you'll have to be much more specific before I can offer any solid help.

commented

I don't understand what is "base armor" here

and

is "modifiers" the temporaney max number of modifier (like reinforced for example) here

commented

Base armor is just armor. Armor points. The attribute. The thing that shows up on the HUD. It's called base because armor points can be raised through modifiers.

Modifier means the modifier that will be multiplied by the durability. This is all very similar to the Tinkers' Construct parts of Head, Handle, and Extra.

commented

Armor points. like the Damage Reduction ?
And, if yes, it's the Damage Reduction of all pieces of armor or only of one piece?

commented

Well, yes, but I don't want to call it damage reduction because that makes it sound like the points correlate to that one-to-one. It's defense points.

It's the defense points of all the armor pieces combined.

commented

Okay, thanks

commented

I'm trying to understand the code but I do not find where the armor item is created, could you help me? ( For example the copper armor trim )
because the TinkersArmor(EntityEquipmentSlot slotIn, PartMaterialType... requiredComponents) call the super with a emptyMaterial and I am not understanding where it is created and i think the armor is created in ArmoryRegistry.registerAllArmorForging(); but it's the same thing

commented

And this method of adding stats I have to do it in the pre-init, right?

commented

There's a difference between the armor item and the armor parts. It seems like you're referring to the armor item, which I don't think is what you want because you mentioned the copper armor trim. The armor items act as a basis from which the registered materials can construct themselves into new parts. So, you're looking at a TinkersArmor but it doesn't mean much until a Copper material uses it to construct the components.

So what you're likely to want to do is look at this part https://github.com/TheIllusiveC4/ConstructsArmory/blob/19d4c257a983478f98801777e2fa13ec962248f2/src/main/java/c4/conarm/lib/materials/ArmorMaterials.java#L104
where many of the materials are registered with armor stats. There's also traits registration a couple methods above that. These are the only really necessary parts, the system will take care of the rest (I might be forgetting a step or two, but I think that's how it goes).

Of course, this all assumes that you've registered a proper Material with the Tinkers system. You'll have to look at base Tinkers' Construct to figure that out as I don't touch that at all in this mod.

commented

Intagration done. The next step is to make custom traits ;
Thanks for helping us.

commented

You can, but I'm not sure that you have to. It's been a while since I messed with this code and the registry we're talking about is from Tinkers' Construct. You'd have to figure that out on your own to be sure.

commented

Problem, now the armor parts was created but they have the trait of the tinker (like poisonous) can i remove it?
2019-03-04_18 53 17

commented

If I recall correctly, that happens when you don't register a trait for the armor parts. It will default back to the tools trait that was registered for them. I don't think you can remove it, although you might be able to figure out a workaround. The real solution is to just make sure you register a trait for all the armor parts.

commented

Thanks, now i'm working on the traits and i will publish the new version of the mod when i finish the Armory Integration

commented

If there are no more questions, I'll go ahead and close this.