注;CrT官方百科并没有对ConArm主动对CoT的联动进行说明,但是代码里确实有联动。

阅读此教程需要对ZenScript有所了解,详见CrT百科

小心CrT百科.jpg(指混乱排版)

基本信息

首先,正如CoT对匠魂的联动一样,你需要先和CrT百科上基本一模一样的导入类并注册材料。然而,导入的类不同,如果担心少导入类可以全部导入。

#loader contentTweaker
import mods.contenttweaker.conarm.ExtendedMaterialBuilder;
import mods.conarm.utils.IArmorModifications;
import mods.conarm.traits.Update;
import mods.contenttweaker.conarm.ArmorTrait;
import mods.contenttweaker.conarm.ArmorTraitDataRepresentation;
import mods.contenttweaker.conarm.ArmorTraitBuilder;

正常人谁会一次性导入所有类……

注册

//首先你需要注册,这里把盔甲材料名设置成armorplus
val a as ExtendedMaterialBuilder = mods.contenttweaker.conarm.ExtendedMaterialBuilder.create("armorplus");
//但是把a作为变量名并不是个好习惯

注意:后文中"a"表示此处的变量"a",或者说材料armorplus!

可用参数

CrT百科,参考用法:

a.color = 0;//定义颜色为黑色

可用方法

添加物品

//mods.contenttweaker.conarm.ExtendedMaterialBuilder.addItem(IIngredient ingredient, @Optional(valueLong = 1) int amountNeeded, @Optional(valueLong = 144) int amountMatched);
a.addItem(<minecraft:tnt>);//添加TNT为armorplus的材料,默认1TNT=1材料=144mb流体
a.addItem(<ore:ingotNickel>);//添加镍锭(支持矿辞)为armorplus的材料,默认1镍锭=1材料=144mb流体
a.addItem(<minecraft:tnt>,2,73);//添加TNT为armorplus的材料,且2TNT=1材料,1TNT=73mb流体
a.addItem(<ore:ingotNickel>,2,73);//添加镍锭(支持矿辞)为armorplus的材料,且2镍锭=1材料,1镍锭=73mb流体
//理论上流体也能添加,但会引发未知bug

删除物品

//mods.contenttweaker.conarm.ExtendedMaterialBuilder.removeItem(IItemStack itemStack);
a.removeItem(<minecraft:tnt>);//删除TNT为armorplus的材料

然而,ConArm的方法无法删除矿辞,但是我们仍有办法删除矿辞

删除矿辞

import crafttweaker.oredict.IOreDictEntry;
import crafttweaker.oredict.IOreDict;
import crafttweaker.item.IIngredient;

val c =<ore:ingotNickel>;//假设我们要删除镍锭的矿辞
for b in c.items{a.removeItem(b);}//批量删除
//就这么简单,但需要注意可能存在的变量名字相同

但为什么ConArm作者就是懒得写……

注册信息

注:对于匠魂工具的配置同样有效,见CrT百科

//mods.contenttweaker.conarm.ExtendedMaterialBuilder.addCoreMaterialStats(float durability, float defense);
a.addCoreMaterialStats(7.15, 3);//将armorplus的基底耐久设为7.15,护甲设为3
//mods.contenttweaker.conarm.ExtendedMaterialBuilder.removeCoreMaterialStats();
a.removeCoreMaterialStats();//删除armorplus的基底属性
//mods.contenttweaker.conarm.ExtendedMaterialBuilder.addPlatesMaterialStats(float modifier, float durability, float toughness);
a.addPlatesMaterialStats(3.2, -232.1, 1);//将armorplus的护甲板耐久倍率设为3.2,耐久设为-232.1,盔甲韧性设为1
//mods.contenttweaker.conarm.ExtendedMaterialBuilder.removePlatesMaterialStats();
a.removePlatesMaterialStats();//删除armorplus的护甲板属性
//mods.contenttweaker.conarm.ExtendedMaterialBuilder.addTrimMaterialStats(float durability);
a.addTrimMaterialStats(-1.2);//将armorplus的护甲夹板耐久设为-1.2
//mods.contenttweaker.conarm.ExtendedMaterialBuilder.removeTrimMaterialStats();
a.removeTrimMaterialStats();//删除armorplus的护甲夹板属性

注册

//mods.contenttweaker.conarm.ExtendedMaterialBuilder.register();
a.register();