Project AirSystem
一款针对 NeoForge 1.21.1 的模组,内容涵盖无人机、空袭警报系统及地面防空武器。它与 TACZ 存在软依赖关系——该模组在有或没有 TACZ 的情况下均可运行。
NeoForge 是唯一的依赖项。模型使用原版的 ModelPart 系统,并在渲染器中进行动画播放。
无人机并非实体。 在空中时,无人机是 DroneFlightManager 中的一个对象;在地面时,它是一个带有方块实体的方块。具体原因请参阅“工作原理”部分。
包含内容
无人机(20种机型)
| 类别 |
机型 |
| 游荡弹药(自杀式无人机) |
Shahed-131, Shahed-136, Shahed-238(喷气式) |
| 侦察机 |
Orlan-10, Orlan-30, Eleron-3, ZALA 421-16E, ZALA 421-08, Granat-4 |
| 打击与游荡弹药 |
Lancet-1, Lancet-3, KUB-BLA, Inokhodets (Orion), S-70 Okhotnik |
| 乌克兰系统 |
Leleka-100, SHARK, PD-2, Liutyi (An-196), UJ-22 Airborne, RAM II UAV |
每种机型都拥有根据其真实比例构建的专属模型:Shahed 为带翼尖舵面的三角翼布局及推进式螺旋桨;Lancet 拥有两个 X 型机翼;Orlan 为尾撑式常规布局;PD-2 为配备四个升力旋翼的固定翼飞机;S-70 则为带涡轮喷气发动机的飞翼布局。性能参数——速度、升限、耐久度、战斗部——均定义在 DroneKind 中,且因类型而异。
模型保留了飞行中和停机坪上实际可见的细节:带透镜窗口和热成像通道的万向节传感器、位于机头前方的空速管、沿后缘分布的独立副翼和升降副翼、背脊线和检修面板、翼尖的导航灯(左红右绿)、活塞式飞机的进气口和排气短舱、以及战斗部附近的警示条纹。具备起降能力的机型拥有真实的起落架:固定翼布局采用前三点式起落架和轮子;PD-2 的尾撑下方设有着陆脚架;双尾撑飞机和飞翼布局则采用滑橇式起落架。
高射炮
- 猎豹(Gepard) — 履带式自行高炮,双联装 35 毫米火炮,配备两部雷达。
- Slingshot(弹弓/Slinger) — 紧凑型遥控武器站,30 毫米口径。
- Terrahawk Paladin(帕拉丁) — 集装箱式 mount,配备 360 度雷达,30 毫米口径。
- MANTIS(螳螂) — 无人自动防空系统:基座上安装一门 35 毫米转膛炮,自带桅杆式雷达,无需乘员。
前三种武器有两种操作方式:炮手坐在瞄具处操作(左键射击),或者按 Shift + 右键 切换至自动模式。MANTIS 始终全自动运行。
敌我识别(IFF)。 在自动模式下,武器站知道每架无人机的起飞位置。在武器站 70 格 范围内发射的任何目标均被视为友军,不会被故意攻击或因误射而遭到打击。所有在此范围之外发射的目标都会被追踪。此半径可在配置文件中调整(turret.friendlyRadius)。
自动火力脱靶。 每次齐射都会根据射程和目标速度计算命中率。若判定未命中,齐射会故意打偏,你可以看到曳光弹从身边飞过。基础命中率为 turret.autoHitChance(默认为 0.55),并乘以各武器站的精度系数。
空袭警报
- 警报扩音器 — 发出呼啸声,160 格外可闻。声音模拟真实的机电式警报器:转子切割空气(两个端口以 1.2 的比例产生特征和弦),信号通过共振频率为 1150 赫兹和 2300 赫兹的号角,并叠加了启动加速、减速滑行、旋转幅度调制以及城市混响效果。
- 空袭按钮 — 提升警报级别并解除警报。
- 连接线 — 将扩音器与按钮绑定:点击扩音器,然后点击按钮。若无任何绑定,一个按钮将驱动 64 格内的所有警报器。
处于 audible range(听觉范围)内的玩家屏幕上会出现“AIR RAID ALERT”(空袭警报)横幅。
工作原理
当实体靠近玩家时,Minecraft 实体机制十分便利。但无人机往往飞行数公里之外,而操作员却留在原地,此时实体机制反而会成为阻碍:超出追踪半径后它不再被追踪,它会随世界其他部分一起 ticking(刷新),并且需要客户端去“看见”它。因此,这些飞行器采用了不同的构建方式:
| 状态 |
表现形式 |
渲染方式 |
| 地面状态 |
airsystem:drone 方块及其方块实体 |
DroneBlockRenderer |
| 空中状态 |
DroneFlightManager 中的 DroneFlight 对象 |
DroneFlightRenderer,在世界渲染通道中绘制 |
| 投掷炸弹 |
同一位置中的 Munition 对象 |
同上 |
这样做带来了以下优势:
- 范围。 飞行不受实体追踪半径限制。服务器向视野范围内的所有玩家发送紧凑快照(
DroneSyncPayload),而仅向操作员发送仪器数据(DroneTelemetryPayload)。
- 开销。 没有任何实体额外开销:无需追踪器、属性同步或每刻钟的碰撞搜索。运动轨迹是从上一个点到下一个点的一条射线,且同一条射线用于检测碰撞。
- 持久性。 飞行记录存储在维度的
SavedData 中,并在服务器重启后保留。
- 命中判定。 由于子弹不会自动击中无人机,服务器会在每刻钟检查其附近的投射物,并判断其运动线段是否穿过机身。箭矢和 TACZ 子弹均以此方式工作;枪械自行追踪弹道,而附近的爆炸则通过
ExplosionEvent 影响飞机。
- 画面传输。 spectator 相机无法附着于任何实体,因此将操作员置于旁观者模式,服务器静默地将其位置与无人机同步以保持区块加载,客户端则根据相同的快照自行移动相机。这不消耗数据包,且视角始终跟随玩家——相机行为类似于万向节。重建被追踪实体列表(这是移动玩家时的耗时部分)仅在区块变化时发生,而非每刻钟。
- 平滑度。 快照到达的时间不均匀,因此客户端不会直接采用该位置,而是经过数个刻钟逐渐过渡到目标位置,否则模型会出现卡顿。对于远距离跳跃(即无人机进入视野范围的情况),会立即应用新位置,而不是从远处平滑滑入。
操控无人机
- 世界地图(右键点击)打开俯瞰地形的视图。左键点击标记一个点并将坐标复制到剪贴板;右键拖动地图,滚轮缩放。
- 将飞行器放置在地面上(右键将物品点击在固体表面上)。它会变成一个停机坪方块。
- 遥控器 —— 右键点击停放的飞行器以建立链接。
- 在空中右键点击遥控器以打开发射界面。“粘贴”按钮从剪贴板获取坐标,“LAUNCH”(发射)按钮将飞行器发送至目标点。
- 来自飞机的画面 打开。顶部的按钮包括“手动控制”(之后飞行器跟随按键操作 ——
W/S 俯仰,A/D 航向,Space 油门加速,Shift 关闭油门)、“打击”(自杀式巡飞弹立即俯冲,打击载机投放炸弹)以及“视角”(在锁定航向和自由万向节之间切换)。
- 侦察机和打击载机还拥有一个 “着陆” 按钮:飞行器转向其专属停机坪,下降至盘旋高度,沿下滑道降落 —— 停机坪方块重新出现,遥控器会自动重新与之链接。自杀式巡飞弹不会着陆。
当剩余燃料恰好足够返回基地时,回收也会自动开始:飞行器会飞向停机坪而不是坠落。该阶段在遥测数据中可见(“Returning”,“On approach”)。
停在停机坪上的飞行器可以被拾取:按住 Shift + 右键点击,或者直接破坏该方块。当飞行结束时,操作员会回到他们之前的游戏模式下的自身位置。
命令
/airsystem flights # 当前 airborne 的飞行器有哪些
/airsystem abort # 召回所有飞行器
/airsystem launch <type> <x y z> # 向目标发射,用于测试
影响效果
-
爆炸。 爆炸效果是分层设计的。原版图片被完全禁用(spawnParticles = false,使用静音音效 airsystem:silence),所有效果均由客户端绘制:
- 闪光 —— 从白色到橙色的全屏光晕,随距离变暗,若玩家与爆心之间有墙壁遮挡则会消失,同时伴随视野范围的短暂冲击;
- 核心 —— 由
flash/explosion_emitter、火焰、熔岩滴落、烟花火花和被抛起的土壤组成的火球;
- 冲击波 —— 一圈以每刻钟 2.4 格(约 18 刻钟)的速度扩散的灰尘和烟灰环,加上空气中的凝结环;
- 烟柱 —— 上升并扩散约七秒,伴有灰烬。
细节效果随距离衰减,以确保远处的爆炸不会给客户端带来负担。
-
屏幕震动 —— 玩家距离爆心越近(最多 90 格),震动越强,并随时间衰减。
-
冲击波 —— 从爆心扩散,持续约 16 刻钟并破碎玻璃;Shahed-136 的半径为 35 格。玻璃越远,破碎几率越低。受影响的方块列表为 airsystem:shockwave_fragile 标签。
-
火灾 —— 源自携带燃烧弹头的类型(Shahed-136、Shahed-238、Lancet-3、Liutyi、RAM II)。
-
声音 —— 近距离尖锐的枪炮声,远距离沉闷的轰鸣声,因声速(约每刻钟 17 格)而延迟到达。
击落无人机
- 命中点会转换为机身坐标,因此击中位置很重要:中心、引擎舱或飞行面。
- 三次中心命中 会使其在空中爆炸。
- 任何命中都有 20% 的概率摧毁引擎:飞行器失速进入冒烟的螺旋并撞击爆炸。通过引擎舱命中的概率加倍,通过机翼命中的概率较低。
- TACZ 子弹会被自动识别;普通投射物同样有效。
TACZ 兼容性
该模组 未编译依赖 TACZ,也不要求安装 TACZ:
- TACZ 子弹通过投射物类型进行识别,并能伤害无人机;
- 枪械接受 TACZ 弹药(命名空间为
tacz 且 ID 中包含 "ammo" 或匹配口径的任何物品),若无 TACZ 则回退使用该模组自带的 airsystem:ammo_35mm 和 airsystem:ammo_30mm 弹药。
Project AirSystem
A NeoForge 1.21.1 mod about the air picture: unmanned aircraft, an air raid
alarm system and ground-based air defence. Works with TACZ as a soft
dependency — the mod runs with or without it.
NeoForge is the only dependency. The models use the vanilla ModelPart system
and are animated in the renderer.
Drones are not entities. In the air a drone is an object inside
DroneFlightManager; on the ground it is a block with a block entity. The
reasoning is under "How it works".
What is in it
Drones (20 aircraft)
| Class |
Aircraft |
| Shahed loitering munitions |
Shahed-131, Shahed-136, Shahed-238 (jet) |
| Reconnaissance |
Orlan-10, Orlan-30, Eleron-3, ZALA 421-16E, ZALA 421-08, Granat-4 |
| Strike and loitering |
Lancet-1, Lancet-3, KUB-BLA, Inokhodets (Orion), S-70 Okhotnik |
| Ukrainian systems |
Leleka-100, SHARK, PD-2, Liutyi (An-196), UJ-22 Airborne, RAM II UAV |
Every aircraft has its own model built to the proportions of the real thing: a
Shahed is a delta with fins on the tips and a pusher propeller, a Lancet has two
X wings, an Orlan is a conventional layout with the tail on a boom, the PD-2 is
an aeroplane with four lift rotors, the S-70 a flying wing with a turbojet.
Performance — speed, ceiling, toughness, warhead — lives in DroneKind and
differs from type to type.
The models carry the detail that is actually visible in flight and on the pad: a
gimballed sensor with a lens window and a thermal channel, a pitot boom ahead of
the nose, ailerons and elevons as separate strips along the trailing edge, a
dorsal spine and access panels, navigation lights on the tips (red to port,
green to starboard), intakes and exhaust stubs on piston types, warning stripes
by the warhead. Types that land have real gear: tricycle legs and wheels on the
aeroplane layouts, landing feet under the booms of the PD-2, a skid on the
twin-boom aircraft and flying wings.
Anti-aircraft guns
- Gepard — tracked SPAAG, twin 35 mm guns, two radars.
- Slinger — compact remote weapon station, 30 mm.
- Terrahawk Paladin — container mount with a 360-degree radar, 30 mm.
- MANTIS — unmanned auto air defence: a 35 mm revolver cannon on a pedestal
with its own masted radar and no crew at all.
The first three work two ways: a gunner sits at the sight (left click fires), or
Shift + right click switches to automatic. MANTIS always runs itself.
IFF. In automatic mode a mount knows where every drone took off from.
Anything launched within 70 blocks of the mount counts as friendly and is
never engaged, deliberately or by a stray burst. Everything launched further out
is tracked. The radius is configurable (turret.friendlyRadius).
Automatic fire misses. Every burst rolls a hit chance that falls off with
range and with target speed. On a failed roll the burst is deliberately walked
wide, and you can watch the tracers go past. The base chance is
turret.autoHitChance (0.55 by default), multiplied by the accuracy of the
individual mount.
Air raid alarm
- Alarm loudspeaker — wails, audible over 160 blocks. The sound is
synthesised as a real electromechanical siren: the rotor chops the air (two
ports at a ratio of 1.2 give the characteristic chord), the signal passes
through a horn resonant at 1150 and 2300 Hz, and spin-up, coast-down,
rotational amplitude modulation and urban reverberation are added.
- Air raid button — raises the alert and sounds the all-clear.
- Linking cable — binds loudspeakers to a button: click the loudspeaker,
then the button. With nothing bound, a button drives every siren within 64
blocks.
Players within earshot get an "AIR RAID ALERT" banner on screen.
How it works
A Minecraft entity is convenient while it stays near a player. A drone flies
kilometres away while the operator stays put, and at that point the entity gets
in the way: it stops being tracked beyond the tracking radius, it ticks with the
rest of the world, and it needs the client to "see" it. So the aircraft are
built differently:
| State |
What it is |
What draws it |
| On the ground |
airsystem:drone block with a block entity |
DroneBlockRenderer |
| Airborne |
DroneFlight object in DroneFlightManager |
DroneFlightRenderer, in the world pass |
| Released bomb |
Munition object in the same place |
the same renderer |
What that buys:
- Range. A flight is not tied to the entity tracking radius. The server
sends compact snapshots (
DroneSyncPayload) to everyone in view range and
instrument data (DroneTelemetryPayload) only to the operator.
- Cost. None of the entity overhead: no tracker, no attribute sync, no
collision search every tick. Motion is one ray from the last point to the
next, and that same ray finds the collision.
- Persistence. Flights live in the dimension's
SavedData and survive a
server restart.
- Hits. Since bullets will not hit the drone by themselves, the server looks
for projectiles near it each tick and checks whether their movement segment
passed through the airframe. Arrows and TACZ bullets both work this way; the
guns trace their own line, and a nearby explosion reaches the aircraft through
ExplosionEvent.
- Feed. There is nothing for a spectator camera to attach to, so the
operator is put into spectator mode, the server quietly carries their position
along with the drone so chunks keep loading, and the client moves the camera
itself from the same snapshots. That costs no packets, and the view stays with
the player — the camera behaves like a gimbal. Rebuilding the tracked-entity
list, the expensive part of moving a player, happens on a chunk change rather
than every tick.
- Smoothness. Snapshots arrive unevenly, so the client does not take the
position directly but eases the drone towards it over a few ticks, otherwise
the model stutters. A far jump — a drone entering view range — is applied at
once instead of gliding in from a distance.
Flying a drone
- World map (right click) opens a view of the terrain from above. Left
click marks a point and copies its coordinates to the clipboard; right click
drags the map, the wheel zooms.
- Place the aircraft on the ground (right click the item onto a solid surface).
It becomes a pad block.
- Remote control — right click the parked aircraft to link it.
- Right click the remote in the air to open the launch screen. "Paste" pulls
the coordinates out of the clipboard, "LAUNCH" sends the aircraft to the
target.
- The feed from the aircraft opens. The buttons along the top are "Manual
control" (after which the aircraft follows the keys —
W/S pitch, A/D
heading, Space throttle, Shift throttle off), "Strike" (an immediate dive
for a loitering munition, bomb release for a strike carrier) and "View"
(switching between heading-locked and free gimbal).
- Reconnaissance aircraft and strike carriers also get a "Land" button: the
aircraft turns for its own pad, descends to circuit height, comes down the
glide path and lands — the pad block reappears and the remote re-links to it
by itself. Loitering munitions do not land.
Recovery also starts on its own when there is exactly enough fuel to get home:
the aircraft heads for the pad instead of falling. The phase is visible in the
telemetry ("Returning", "On approach").
An aircraft on a pad can be picked back up: Shift + right click, or simply
break the block. When a flight ends, the operator returns to their own position
in their previous game mode.
Commands
/airsystem flights # what is airborne right now
/airsystem abort # recall everything
/airsystem launch <type> <x y z> # launch at a target, for testing
Impact
-
The explosion is staged. The vanilla picture is disabled entirely
(spawnParticles = false, a silent airsystem:silence) and the client draws
all of it:
- flash — a full-screen wash from white to orange, dimmed by distance and
killed by a wall between the player and the epicentre, together with a short
punch to the field of view;
- core — a fireball of
flash/explosion_emitter, flame, lava drops,
firework sparks and thrown-up soil;
- blast wave — a ring of dust and soot spreading at 2.4 blocks per tick
(about 18 ticks), plus a condensation ring in the air;
- smoke column — rises and spreads for about seven seconds, with ash.
Detail falls off with distance so that far-away impacts do not load the
client.
-
Screen shake — stronger the closer the player is to the epicentre (up to
90 blocks), decaying over time.
-
Shockwave — spreads from the epicentre over about 16 ticks and breaks
glazing; the Shahed-136 radius is 35 blocks. The further the glass, the lower
the chance it goes. The block list is the airsystem:shockwave_fragile tag.
-
Fires — from types with an incendiary warhead (Shahed-136, Shahed-238,
Lancet-3, Liutyi, RAM II).
-
Sound — a sharp report up close, a dull boom from far away, arriving late
by the speed of sound (about 17 blocks per tick).
Shooting a drone down
- The hit point is converted into airframe coordinates, so where you hit
matters: the centre, the engine bay or the flying surfaces.
- Three centre hits detonate it in the air.
- Any hit has a 20 % chance of taking out the engine: the aircraft stalls
into a smoking spiral and explodes on impact. The chance is twice as high
through the engine bay and lower through a wing.
- TACZ bullets are recognised automatically; ordinary projectiles work too.
TACZ compatibility
The mod is not compiled against TACZ and does not require it:
- TACZ bullets are recognised by projectile type and damage drones;
- the guns accept TACZ ammunition (any item in the
tacz namespace with "ammo"
or a matching calibre in its id) and fall back to the mod's own
airsystem:ammo_35mm and airsystem:ammo_30mm rounds without it.
评论 0
登录后参与评分
还没有评论,来抢沙发吧