MDT模组电能制作
我们知道,电力为MDT中比较重要的模块,且电力分3个模块,分别是传输、存储、和发电
我会将每个类型的方块翻译一遍

传输
能量节点/PowerNode

powerNode = new PowerNode("power-node"){{
requirements(Category.power, with(Items.copper, 1, Items.lead, 3));
maxNodes = 10;
laserRange = 6;
}};
json
{
"type": "PowerNode",
"name": "json-powerNode",
"category": "power",
"requirements": [
"copper/1","lead/3"
],
"maxNodes": 10,
"laserRange": 6
}
属性解释
maxNodes: 最大连接数
laserRange: 连接范围/格

存储
电池/Battery

battery = new Battery("battery"){{
requirements(Category.power, with(Items.copper, 5, Items.lead, 20));
consumes.powerBuffered(4000f);
}};
json
{
"type": "Battery",
"name": "json-battery",
"category": "power",
"requirements": [
"copper/5","lead/20"
],
"consumes": {
"powerBuffered": 4000.00
}
}
属性解释
consumes.powerBuffered: 电池容量(不用 * 60)

发电(本章重点)
火力发电机 -> 燃烧发电机/BurnerGenerator

combustionGenerator = new BurnerGenerator("combustion-generator"){{
requirements(Category.power, with(Items.copper, 25, Items.lead, 15));
powerProduction = 1f;
itemDuration = 120f;
ambientSound = Sounds.smelter;
ambientSoundVolume = 0.03f;
}};
json
{
"type": "BurnerGenerator",
"name": "json-combustionGenerator",
"category": "power",
"requirements": [
"copper/25","lead/15"
],
"powerProduction": 1.00,
"itemDuration": 120.00
}
属性解释
powerProduction: 1.00(这里和consumes.powerBuffered不一样,需 * 60)
itemDuration: 持续产能时间/帧

地热发电机 -> 地热发电机/ThermalGenerator

thermalGenerator = new ThermalGenerator("thermal-generator"){{
requirements(Category.power, with(Items.copper, 40, Items.graphite, 35, Items.lead, 50, Items.silicon, 35, Items.metaglass, 40));
powerProduction = 1.8f;
generateEffect = Fx.redgeneratespark;
effectChance = 0.011f;
size = 2;
floating = true;
ambientSound = Sounds.hum;
ambientSoundVolume = 0.06f;
}};
json
{
"type": "ThermalGenerator",
"name": "json-thermalGenerator",
"category": "power",
"requirements": [
"copper/40","graphite/35","lead/50","silicon/35","metaglass/40"
],
"powerProduction": 1.80,
"size": 2,
"attribute": "heat"
}
属性解释
attribute: 方块所占底部格子给予的属性(见后)

温差发电机 -> 单类发电机(?)/SingleTypeGenerator

differentialGenerator = new SingleTypeGenerator("differential-generator"){{
requirements(Category.power, with(Items.copper, 70, Items.titanium, 50, Items.lead, 100, Items.silicon, 65, Items.metaglass, 50));
powerProduction = 18f;
itemDuration = 220f;
hasLiquids = true;
hasItems = true;
size = 3;
ambientSound = Sounds.steam;
ambientSoundVolume = 0.03f;
consumes.item(Items.pyratite).optional(true, false);
consumes.liquid(Liquids.cryofluid, 0.1f);
}};
/** 如果为true, 这个消耗者将不会影响这个消耗者/
/** If true, this consumer will not influence consumer validity. */
public boolean optional;
json
{
"type": "SingleTypeGenerator",
"name": "json-differentialGenerator",
"category": "power",
"requirements": [
"copper/70","titanium/50","lead/100","silicon/65","metaglass/50"
],
"powerProduction": 18.00,
"itemDuration": 220.00,
"hasLiquids": true,
"hasItems": true,
"size": 3,
"consumes": {
"items": {
"items": ["pyratite/1"],
"optional": true,
"boost": false
},
"liquid": "cryofluid/0.1"
}
}
属性解释
hasLiquids: 拥有液体(一般为初始化,不用填写)
hasItems: 拥有物品(同上)
consumes.items: 物品消耗器
consumes.items.items: 消耗的物品
consumes.liquid: 液体消耗器
consumes.*.optional: 作为可选输入(这里不解,将原定义&注释贴在上)
consumes.*.boost: 作为增益输入

RTG发电机 -> 衰变发电机/DecayGenerator

rtgGenerator = new DecayGenerator("rtg-generator"){{
requirements(Category.power, with(Items.lead, 100, Items.silicon, 75, Items.phaseFabric, 25, Items.plastanium, 75, Items.thorium, 50));
size = 2;
powerProduction = 4.5f;
itemDuration = 60 * 14f;
}};
json
{
"type": "DecayGenerator",
"name": "rtgGenerator",
"category": "power",
"requirements": [
"lead/100","silicon/75","phase-fabric/25","plastanium/75","thorium/50"
],
"size": 2,
"powerProduction": 4.50,
"itemDuration": 840.00
}
无可讲内容

太阳能板 -> 太阳能发电/SolarGenerator

solarPanel = new SolarGenerator("solar-panel"){{
requirements(Category.power, with(Items.lead, 10, Items.silicon, 15));
powerProduction = 0.1f;
}};
json
{
"type": "SolarGenerator",
"name": "json-solarPanel",
"category": "power",
"requirements": [
"lead/10","silicon/15"
],
"powerProduction": 0.1
}
无可讲内容

钍反应堆 -> 核能发电机/NuclearReactor

thoriumReactor = new NuclearReactor("thorium-reactor"){{
requirements(Category.power, with(Items.lead, 300, Items.silicon, 200, Items.graphite, 150, Items.thorium, 150, Items.metaglass, 50));
ambientSound = Sounds.hum;
ambientSoundVolume = 0.24f;
size = 3;
health = 700;
itemDuration = 360f;
powerProduction = 15f;
consumes.item(Items.thorium);
heating = 0.02f;
consumes.liquid(Liquids.cryofluid, heating / coolantPower).update(false);
}};
json
{
"type": "NuclearReactor",
"name": "json-thoriumReactor",
"category": "power",
"requirements": [
"lead/300","silicon/200","graphite/150","thorium/150","metaglass/50"
],
"size": 3,
"health": 700,
"itemDuration": 360.00,
"powerProduction": 15.00,
"heating": 0.02,
"consumes": {
"item": "thorium",
"liquid": {
"liquid": "cryofluid",
"amount": 0.04,
"update": false
}
}
}
属性解释
heating: 每帧加热(heating * 物品数量(fullness??))
consumes.liquid.liquid: 消耗的液体
consumes.liquid.amount: 使用液体容量(* 60)
consumes.*.update: ?

冲击反应堆 -> 冲击发电机/ImpactReactor

impactReactor = new ImpactReactor("impact-reactor"){{
requirements(Category.power, with(Items.lead, 500, Items.silicon, 300, Items.graphite, 400, Items.thorium, 100, Items.surgeAlloy, 250, Items.metaglass, 250));
size = 4;
health = 900;
powerProduction = 130f;
itemDuration = 140f;
ambientSound = Sounds.pulse;
ambientSoundVolume = 0.07f;
consumes.power(25f);
consumes.item(Items.blastCompound);
consumes.liquid(Liquids.cryofluid, 0.25f);
}};
json
{
"type": "ImpactReactor",
"name": "json-impactReator",
"category": "power",
"requirements": [
"lead/500","silicon/300","graphite/400","thorium/100","surge-alloy/250",
"metaglass/250"
],
"size": 4,
"health": 900,
"powerProduction": 130.00,
"itemDuration": 140.00,
"consumes": {
"power": 25.00,
"item": "blast-compound",
"liquid": "cryofluid/0.25"
}
}
属性解释
consumes.power: 消耗能量(* 60)

属性分类
全部方块可用
hasItems: boolean
hasLiquids: boolean
consumes: Consumers()

PowerNode
maxNodes: int
LaserRange: float

Battery
暂无介绍,只用写consumes.powerBuffered

PowerGenerator
powerProduction: float

ItemLiquidGenerator
拓展 PowerGenerator
itemDuration: float

BurnerGenerator
拓展 ItemLiquidGenerator

ThermalGenerator
拓展 PowerGenerator
attribute: Attribute

SingleTypeGenerator
拓展 ItemLiquidGenerator

DecayGenerator
拓展 ItemLiquidGenerator

SolarGenerator
拓展 PowerGenerator

NuclearGenerator
拓展 PowerGenerator
heating: float
explosionRadius: float
爆炸半径/格
explosionDamage: float
爆炸伤害

ImpactGenerator
拓展 PowerGenerator

其他
注意事项
consumes.item 和 consumes.items.items 不同;
前者是接物品名(不需要数量,为1);后者为ItemStack[] (并且可以写optional/boost/...)
consumes.liquid 和 consumes.liquid.liquid 不同;
前者是接"液体/数量";后者则需要 liquid 和 amount (并且可以写optional/boost/update)
consumes.power 和 consumes.powerBuffered 不能同时出现

Attribute
heat: 地热(大硅,地热)
spores: 孢子苔藓地(孢子簇???)
water: 水源(各种泵)
oil: 黑沙(石油钻井)
light: 光源(?)

资源
https://1565619256.lanzoui.com/b016oabjc
密码:4pji