本模组为 Ad Astra 添加了货运火箭,并在与 CC:tweaked 配合使用时,允许你自动化行星之间的物品运输。
此 Fork 版本新增功能
添加粒子与音效,并重做发射/着陆动画
使用 Ad Astra 的音效和粒子效果来表现
现在火箭起飞和着陆比以前更加平滑。
此外,修复了火箭在没有碰撞检测的情况下落在方块上的 Bug。
新型火箭
新增了三种不同等级的火箭。
每个等级能到达的最大行星数量不同。
与 AdAstra 火箭一样,存在相同的范围限制。
随着火箭等级的增加,燃料和能量消耗会根据目的地而变化。
新增有用的标签(Tag)
本模组添加了物品标签 denied_in_launch_pad,以防止在发射台上使用指定的物品(例如潜影盒)。
通过使用此标签,你可以防止非法的运输机制。
自定义目的地的难度等级和燃料效率
修改 config/ad_astra_cargo_rockets.json 以自定义目标目的地的成本和燃料效率。
新增有用的 CC 函数
? loadAllItems([filter])
将发射台库存中的所有物品移动到火箭的库存中。
如果你指定了一个物品 ID,则只能移动该物品。
? unloadAllItems([filter])
将火箭库存中的所有物品移动到发射台的库存中。
如果你指定了一个物品 ID,则只能移动该物品。
参数
filter? (string) : 要加载或卸载的物品名称(例如 "minecraft:cobblestone")
火箭发射台 Lua API
此 API 允许你通过 CC:Tweaked 计算机控制火箭发射台。它提供了发射火箭、管理库存和检查能量水平的功能。
连接
你必须将计算机连接到发射台的中央方块才能访问以下方法。
连接到外部方块将允许你访问通用的库存方法。
? 库存槽位索引
- Lua 中的所有库存槽位索引从 1 开始,与 CC:Tweaked 的惯例一致。
? launch(planet)
尝试将火箭发射到指定的行星。(参见 getValidDestinations)
参数
planet (string): 目的地行星的名称。
错误
"No rocket found" – 发射台上没有火箭。
"<planet> is not a valid planet" – 指定的行星名称无效。
"Not enough energy to launch" – 发射台缺乏足够的能量。
"<planet> is too high of a tier for this rocket" – 火箭等级太低,无法到达目的地。
? moveItemsFromRocketToLaunchPad(rocketSlot, launchPadSlot)
将物品从火箭的库存移动到发射台的库存。
参数
rocketSlot (int): 火箭库存中的槽位。
launchPadSlot (int): 发射台库存中的槽位。
错误
"No rocket found"
"Destination full"
"Invalid slot"
? moveItemsFromLaunchPadToRocket(launchPadSlot, rocketSlot)
将物品从发射台的库存移动到火箭的库存。
参数
launchPadSlot (int): 发射台库存中的槽位。
rocketSlot (int): 火箭库存中的槽位。
错误
"No rocket found"
"Destination full"
"Invalid slot"
⚡ getEnergyRequiredForLaunch()
返回发射火箭所需的能量量。
返回值
? getEnergy()
返回发射台当前存储的能量。
返回值
? getMaxEnergy()
返回发射台的最大能量容量。
返回值
? getValidDestinations()
返回一个包含有效目的地行星名称的表格,键为行星名,值为到达该行星所需的火箭等级。
返回值
table<string, int>: 一个表格,键为行星名,值为到达该行星所需的火箭等级。
? listLaunchPadInventory()
返回发射台当前的非空库存。
返回值
table<int, table>: 一个将槽位索引映射到物品表格的表格,其中包含:
name (string): 显示名称。
id (string): 注册表 ID。
count (int): 堆叠数量。
max_count (int): 最大堆叠数量。
? listLaunchPadInputSlotIndexes()
列出哪些槽位索引被视为输入槽位。
这些是漏斗和其他物品运输模组可以插入物品的槽位。
返回值
? listLaunchPadOutputSlotIndexes()
列出哪些槽位索引被视为输出槽位。
这些是漏斗和其他物品运输模组可以提取物品的槽位。
返回值
? isRocketPresent()
检查发射台上是否有火箭。
返回值
boolean: 如果存在火箭则返回 true,否则返回 false。
? listRocketInventory()
返回火箭当前的非空库存。
返回值
table<int, table>|nil: 如果存在火箭,则返回将槽位索引映射到物品数据的表格;如果未找到火箭,则返回 nil。物品表格包含:
name (string): 显示名称。
id (string): 注册表 ID。
count (int): 堆叠数量。
max_count (int): 最大堆叠数量。
致谢
Fork 来源:Ad Astra Cargo Rockets by BillBodkin
URL:
This mod adds cargo rockets to Ad Astra and, when used with CC:tweaked, allows you to automate the transport of items between planets.
Features added in this fork
Added particle and sound, and rework launch/landing animation
Use ad astra's sound and particle to expression
It can now take off and land more smoothly than before.
Also, a bug where the rocket would land on blocks without collision detection has been fixed.
New rocket type
Added three new tiers of rockets.
Each tier has a different maximum number of planets it can reach.
The same range limitations apply as for AdAstra's rockets
With the addition of rocket tiers, fuel and energy consumption now increases depending on the destination
Added New useful tag
This mod add itemtag denied_in_launch_pad to prevent to use specified item in launch pad (e.g. shulker box)
By using this tag,you can prevent illegal transport technic.
customizable the difficulty level and fuel efficiency for your destination
Change config/ad_astra_cargo_rockets.json to customize target destination cost and fuel efficient.
Added Useful CC's Function
? loadAllItems([filter])
Moves all items from the launchpad's inventory to the rocket's inventory.
If you specify an item ID, you can move only that item.
? unloadAllItems([filter])
Moves all items from the rocket's inventory to the launchpad's inventory.
If you specify an item ID, you can move only that item.
Parameters
filter? (string) : Name of the item to load or unload (e.g. "minecraft:cobblestone")
Rocket Launchpad Lua API
This API allows you to control a rocket launchpad from a CC:Tweaked computer. It provides functions to launch rockets, manage inventories, and check energy levels.
Connecting
You must connect the computer to the central block of the launch pad to access the below methods.
Connecting to the outer blocks will allow you to access the generic inventory methods.
? Inventory Slot Indexing
- All inventory slot indexes in Lua start at 1, matching CC:Tweaked's conventions.
? launch(planet)
Attempts to launch a rocket to the specified planet. (See getValidDestinations)
Parameters
planet (string): The name of the destination planet.
Errors
"No rocket found" – No rocket is on the launchpad.
"<planet> is not a valid planet" – The specified planet name is invalid.
"Not enough energy to launch" – The launchpad lacks sufficient energy.
"<planet> is too high of a tier for this rocket" – The rocket tier is too low for the destination.
? moveItemsFromRocketToLaunchPad(rocketSlot, launchPadSlot)
Moves an item from the rocket's inventory to the launchpad's inventory.
Parameters
rocketSlot (int): Slot in the rocket's inventory.
launchPadSlot (int): Slot in the launchpad's inventory.
Errors
"No rocket found"
"Destination full"
"Invalid slot"
? moveItemsFromLaunchPadToRocket(launchPadSlot, rocketSlot)
Moves an item from the launchpad's inventory to the rocket's inventory.
Parameters
launchPadSlot (int): Slot in the launchpad's inventory.
rocketSlot (int): Slot in the rocket's inventory.
Errors
"No rocket found"
"Destination full"
"Invalid slot"
⚡ getEnergyRequiredForLaunch()
Returns the amount of energy required to launch the rocket.
Returns
? getEnergy()
Returns the current stored energy in the launchpad.
Returns
? getMaxEnergy()
Returns the maximum energy capacity of the launchpad.
Returns
? getValidDestinations()
Returns a table of valid destination planet names, with the key being the planet and the value being the required rocket tier to reach it.
Returns
table<string, int>: Table with the key being the planet and the value being the required rocket tier to reach it.
? listLaunchPadInventory()
Returns the current non-empty inventory of the launchpad.
Returns
table<int, table>: A table mapping slot indexes to item tables with:
name (string): Display name.
id (string): Registry ID.
count (int): Stack size.
max_count (int): Maximum stack size.
? listLaunchPadInputSlotIndexes()
Lists which slot indexes are considered input slots.
These are the slots hoppers and other item transportation mods can insert into.
Returns
int[]: List of input slot indexes (1-based).
? listLaunchPadOutputSlotIndexes()
Lists which slot indexes are considered output slots.
These are the slots hoppers and other item transportation mods can extract from.
Returns
int[]: List of output slot indexes (1-based).
? isRocketPresent()
Checks whether a rocket is present on the launchpad.
Returns
boolean: true if a rocket is present, false otherwise.
? listRocketInventory()
Returns the current non-empty inventory of the rocket.
Returns
table<int, table>|nil: Table mapping slot indexes to item data if rocket is present, or nil if no rocket is found. Item tables contain:
name (string): Display name.
id (string): Registry ID.
count (int): Stack size.
max_count (int): Maximum stack size.
Credit
Fork Source: Ad Astra Cargo Rockets by BillBodkin
URL:
评论 0
登录后参与评分
还没有评论,来抢沙发吧