Skip to content

CrT集成

WuzgXY-GitHub edited this page Feb 4, 2022 · 11 revisions

本模组对 [CrT]CraftTweaker 作了集成,几乎所有机器的处理方式(配方)都受支持。本页包括当前的方法列表以及使用说明。

语法

粒子堆(Particle Stack)与物品堆或流体堆等等有所不同,其属性并不仅仅是一个表示数量的数字,因此有关其数据的语法与常见的略有不同。

在 CrT 中,物品堆或流体堆由 <minecraft:stick><liquid:water> 一类对象定义。对象后的运算符(例如 *)可以修饰它,例如 <minecraft:stick>*12 代表此物品堆有 12 个物品。流体堆亦然。

粒子堆的语法则类似于 <particle:proton>,但由于粒子堆的数据种类更多,相比之下其包含的运算符也更多。* 仍然表示对象的多少,即粒子数量(单位:pu);^ 表示粒子堆所携的能量(单位:keV);~ 表示粒子堆的聚焦。<particle:electron> 自身表示一个数量为 1 pu、所携能量为 0 keV、聚焦为 0 的电子粒子堆(电子,1 pu,0 keV,0),<particle:electron>~4.2 则表示(电子,1 pu,0 keV,4.2)。((<particle:electron>*50)^1000)~4.2 则是包含多个修饰符时的效果,本例表示(电子,50 pu,1000 keV,4.2)。注意:运算需要 () 来实现,若没有 () 则运算符会被应用至数字上,这样效果便会有偏差,例如 1000~4.210004.2 相同。

其余部分则与核电工艺自身的 CrT 兼容相同,例如 null 代表空粒子堆,等等。

注解系统亦与核电工艺相同。{} 中的变量是可选的。

方法

矿石过滤器

  • mods.qmd.ore_leacher.addRecipe(IIngredient inputItem,IIngredient inputFluid1, IIngredient inputFluid2, IIngredient inputfluid3, IIngredient outputItem1, IIngredient outputItem2, IIngredient OutputItem3, {double timeMultiplier, double powerMultiplier, double processRadiation})
  • mods.qmd.ore_leacher.removeAllRecipes()
  • mods.qmd.ore_leacher.removeRecipeWithOutput(IIngredient outputItem1, IIngredient outputItem2, IIngredient outputItem3)
  • mods.qmd.ore_leacher.removeRecipeWithInput(IIngredient inputItem, IIngredient inputFluid1, inputFluid2, IIngredient inputFluid3)

示例

mods.qmd.ore_leacher.addRecipe(<ore:oreUranium>, <liquid:nitric_acid>*16, <liquid:water>*20, <liquid:sulfuric_acid>*16, <ore:dustUranium>*3,<ore:dustCopper>*2,<ore:dustChromium>, 1.0, 5.0, 0.001);

辐照器

  • mods.qmd.irradiator.addRecipe(IIngredient inputItem, IIngredient outputItem , {double timeMultiplier, double powerMultiplier, double processRadiation})

注意: powerMultiplier 什么用也没有。

  • mods.qmd.irradiator.removeAllRecipes()
  • mods.qmd.irradiator.removeRecipeWithOutput(IIngredient outputItem)
  • mods.qmd.irradiator.removeRecipeWithInput(IIngredient inputItem)

靶室

  • mods.qmd.target_chamber.addRecipe(IIngredient inputItem, IIngredient inputParticle, IIngredient outputItem, IIngredient outputParticle1, IIngredient outputParticle2, IIngredient outputParticle3, long maxEnergy, double crossSection, {long energyReleased, double processRadiation})
  • mods.qmd.target_chamber.removeRecipeWithInput(IIngredient inputItem, IIngredient inputParticle)
  • mods.qmd.target_chamber.removeAllRecipes()

示例

mods.qmd.target_chamber.addRecipe(<ore:ingotGold>, ((<particle:tau>*10000000)^50000)~2.0, <minecraft:diamond>, <particle:positron>*2, <particle:higgs_boson>, <particle:electron>*2, 53000, 0.53, -20000, 0.001);

注意: 输入粒子所指为转化物品所需的最少粒子数,其能量与聚焦亦然,皆指最小值。输出粒子的数量为每粒子每t输入的最大每 t 输出。惯例(不强制要求,但受推荐)的操作是携正电的粒子由 outputParticle1 输出,呈电中性的粒子由 outputParticle2 输出,携负电的粒子由 outputParticle3 输出,原因是 outputParticle2 一定会从粒子室输入面正对的那面输出。

衰变室

  • mods.qmd.decay_chamber.addRecipe(IIngredient inputParticle, IIngredient outputParticle1, IIngredient outputParticle2, IIngredient outputParticle3, double crossSection, {long energyReleased, double processRadiation, long maxEnergy})
  • mods.qmd.decay_chamber.removeRecipeWithInput(IIngredient inputParticle)
  • mods.qmd.decay_chamber.removeAllRecipes()

示例

mods.qmd.target_chamber.addRecipe(<particle:tau>, <particle:electron_antineutrino>, <particle:tua_neutrino>, <particle:electron>, 0.5)

注意: 输入粒子所指为转化物品所需的最少粒子数,其能量与聚焦亦然,皆指最小值。输出粒子的数量为每粒子每 t 输入的最大每 t 输出。惯例(不强制要求,但受推荐)的操作是携正电的粒子由 outputParticle1 输出,呈电中性的粒子由 outputParticle2 输出,携负电的粒子由 outputParticle3 输出,原因是 outputParticle2 一定会从粒子室输入面正对的那面输出。

碰撞室

  • mods.qmd.collision_chamber.addRecipe(IIngredient inputParticle1, IIngredient inputParticle2, IIngredient outputParticle1, IIngredient outputParticle2, IIngredient outputParticle3, IIngredient outputParticle4, long maxEnergy, double crossSection, {long energyReleased, double processRadiation})
  • mods.qmd.collision_chamber.removeRecipeWithInput(IIngredient input1Particle, IIngredient input2Particle)
  • mods.qmd.collision_chamber.removeAllRecipes()

示例

mods.qmd.collision_chamber.addRecipe((<particle:proton>^137378000)~5, (<particle:proton>^137378000)~5, <particle:higgs_boson>*2, <particle:sigma_plus>, <particle:kaon_plus>, null,3, 0.01,-249778000)

注意: 范围内的最小粒子能量是 inputParticle1 的能量与 inputParticle2 的能量之和。

束流收集器

  • mods.qmd.beam_dump.addRecipe(IIngredient inputParticle, IIngredient outputFluid, {long maxEnergy})
  • mods.qmd.beam_dump.removeRecipeWithInput(IIngredient inputParticle)
  • mods.qmd.beam_dump.removeAllRecipes()

示例

mods.qmd.beam_dump.addRecipe(<particle:higgs_boson>^50000, <liquid:water>, 100000);

离子源

  • mods.qmd.accelerator_source.addRecipe(IIngredient inputItem, IIngredient outputParticle)
  • mods.qmd.accelerator_source.removeRecipeWithInput(IIngredient inputItem)
  • mods.qmd.accelerator_source.removeAllRecipes()

示例

mods.qmd.accelerator_source.addRecipe(<minecraft:dirt>, ((<particle:pion_plus>*30)^500)~0.2);

注意: 物品只会在 extendIItemAmount 时才会被消耗,目前仅有本模组的单元如此。

加速器冷却

  • mods.qmd.accelerator_cooling.addRecipe(IIngredient inputFluid, IIngredient outputFluid , int heatRemoved)
  • mods.qmd.accelerator_cooling.removeAllRecipes()
  • mods.qmd.accelerator_cooling.removeWithOutput(IIngredient outputFluid)
  • mods.qmd.accelerator_cooling.removeWithInput(IIngredient inputItem)

示例

mods.qmd.accelerator_cooling.addRecipe(<liquid:liquid_neon>, <liquid:neon>*64,1000);

注意: 加速器能冷却到的温度与输入流体有关!

核合成室

  • mods.qmd.nucleosynthesis_chamber.addRecipe(IIngredient inputFluid1, IIngredient inputFluid2, IIngredient inputParticle, IIngredient outputFluid1, IIngredient outputFluid2, {long maxEnergy}, {long heatRelased})
  • mods.qmd.nucleosynthesis_chamber.removeRecipeWithInput(IIngredient inputFluid1, IIngredient inputFluid2, IIngredient inputParticle)
  • mods.qmd.nucleosynthesis_chamber.removeAllRecipes()

示例

mods.qmd.nucleosynthesis_chamber.addRecipe(<liquid:deuterium>*100, <liquid:deuterium>*100, <particle:muon>*1000, <liquid:tritium>*100, <liquid:hydrogen>*100, 1000, 4030))

粒子

下面是本模组中所有粒子的列表:

夸克
up_quark down_quark charm_quark strange_quark top_quark bottom_quark
antiup_quark antidown_quark anticharm_quark antistrange_quark antitop_quark antibottom_quark
轻子
electron muon tau electron_neutrino muon_neutrino tau_neutrino
positron antimuon antitau electron_antineutrino muon_antineutrino tau_antineutrino
玻色子
photon gluon w_plus_boson z_boson higgs_boson
w_minus_boson
重子
proton neutron delta_plus_plus delta_minus sigma_plus sigma_minus
antiproton antineutron antidelta_plus_plus antidelta_minus antisigma_plus antisigma_minus
原子核/离子
deuteron triton helion alpha boron_ion
antideuteron antitriton antihelion antialpha calcium_48_ion
介子
pion_plus kaon_plus eta
pion_naught kaon_naught eta_prime
pion_minus antikaon_naught charmed_eta
kaon_minus bottom_eta
其他
glueball

添加自定义的粒子

完全添加一种新粒子需要同时安装 [CoT]ContentTweaker。

为避免出现错误,添加粒子时 addParticle 方法必须在预加载阶段即被调用,因此你必须在一个单独的脚本顶部加入一行 #loader preinit。在此脚本中按照下面的方法添加粒子:

  • mods.qmd.particle.addParticle(String custom_name, String textureLocation, double mass, double charge, double spin, { boolean weakCharged, boolean coloured})

材质的位置为 \resources\contenttweaker\textures\particles\ 加上 textureLocation(例如 particle.png)。创建此粒子后你便可以在其他脚本中用 particle:custom_name 指代它了。

设定游戏内名称和描述可以通过在位于 \resources\contenttweaker\lang\ 的语言文件中添加包含下面变量的条目实现:qmd.particle.custom_name.nameqmd.particle.custom_name.desc

创建后你也可以为粒子添加其他信息,例如其构成(包含的粒子):

  • mods.qmd.particle.addComponentParticle(IIngredient particle, IIngredient componentParticle)

以及其反粒子(未设定则其本身即其反粒子):

  • mods.qmd.particle.addAntiParticle(IIngredient particle, IIngredient antiParticle)

示例

如果你想要添加一个铀-238 离子及其反粒子,你可以参考下面的内容:

在某一脚本中:

#loader preinit

mods.qmd.particle.addParticle("u_238_ion", "uranium_238_ion.png", 221740.92, 1.0, 0.0);        

mods.qmd.particle.addParticle("a_u_238_ion", "antiuranium_238_ion.png", 221740.92, -1.0, 0.0);

在另一脚本中:

mods.qmd.particle.addComponentParticle(<particle:u_238_ion>, <particle:proton>*92);
mods.qmd.particle.addComponentParticle(<particle:u_238_ion>, <particle:neutron>*146);
mods.qmd.particle.addComponentParticle(<particle:u_238_ion>, <particle:electron>*91);

mods.qmd.particle.addComponentParticle(<particle:a_u_238_ion>, <particle:antiproton>*92);
mods.qmd.particle.addComponentParticle(<particle:a_u_238_ion>, <particle:antineutron>*146);
mods.qmd.particle.addComponentParticle(<particle:a_u_238_ion>, <particle:positron>*91);

mods.qmd.particle.addAntiParticle(<particle:u_238_ion>, <particle:a_u_238_ion>);

高级特性

其他你可以在脚本中设定的参数:

粒子堆:

  • particle:name.definition
  • particle:name.NAME
  • particle:name.displayName
  • particle:name.meanEnergy
  • particle:name.amount
  • particle:name.focus

粒子:

  • particle:name.definition.NAME
  • particle:name.definition.displayName
  • particle:name.definition.mass
  • particle:name.definition.charge
  • particle:name.definition.spin