Описание
## 投掷物轨迹计算模组
---
### 📦 模组简介
**纯客户端辅助模组** —— 在手持投掷物按住右键「掐雷」时,实时绘制一条抛物线轨迹,并清晰标注落点、反弹位置与距离,让你像专业游戏一样精准预判每一颗雷的弹道。
支持 **LR Tactical** 与 **SBW(Superb Warfare)** 两大模组的投掷物,并额外为 SBW 手雷显示 **温雷倒计时**。
---
### ✨ 功能一览
- **抛物线轨迹**:掐雷时实时绘制飞行弧线,随视角与地形动态更新
- **落点标记**:轨迹终点显示落点圆圈,并标注距离(方块数)
- **反弹标记**:轨迹撞墙/撞地/撞生物时显示反弹点小球标记
- **空爆标记**:可温雷手雷在空中爆炸时,显示红色爆炸图标
- **SBW 温雷倒计时**:掐 SBW 手雷时屏幕下方显示倒计时,少于 2 秒变红闪烁
---
### 🎮 玩法说明
#### 基本操作
- 手持投掷物(手雷/闪光弹/烟雾弹等),按住右键即可看到轨迹
- 轨迹随瞄准方向与地形实时刷新
- 松开右键或取消投掷后,轨迹立即消失
#### 蹲下投掷
按住 Shift 下蹲时,投掷速度变慢,轨迹弧线相应缩短。
#### 可烹饪手雷
- 掐雷时间越长,剩余引信越短,轨迹随之逐格缩短
- 若引信在落地前耗尽,红色空爆图标将标示空中爆炸点
#### 反弹预判
轨迹真实模拟撞墙/撞地/撞生物的反弹(含每跳衰减),可用于卡墙角雷、撞墙弹跳等战术操作。
#### SBW 投掷物
- 现支持 `rgo_grenade`、`hand_grenade`、`m18_smoke_grenade`
- 掐雷时显示温雷倒计时,归零时手雷将在手中引爆,轨迹与倒计时一同消失
#### 仅本地显示
所有轨迹与标记仅你可见,不影响服务器,也不被队友/对手察觉。
---
### ⚙️ 配置文件说明
配置文件位于:`config/lr_trajectory_renderer_1785978259-client.toml`
可调整项包括:
- 轨迹颜色、透明度
- 线条/点状样式、粗细
- 落点与反弹标记开关
- 各类物理倍率
- 整体上下/左右偏移
**修改保存即热加载生效。**
建议同时下载附属文件中的配置文件,以达到最佳拟合效果。
---
### ⚠️ 注意事项
- **纯视觉预判,非精准物理**:轨迹按当前视角与地形实时计算,实际飞行可能因服务器延迟、目标移动等出现微小偏差(约1-2像素),请留出余量
- **计算上限**:默认最多模拟 **200 格距离**、最多 **5 次反弹**,超出部分自然截断(截断处显示落点标记)
- **可隐藏部分投掷物轨迹**:在配置文件的 `lr.blacklist.entries` 中设置,命中条件的投掷物将完全不显示轨迹
- 示例:`"lrtactical:throwable{ThrowableId:\"lrtactical:flash_grenade\"}"` 表示该闪光弹不渲染
- 也可只写物品 ID(不带 `{}`)使该物品所有投掷物不渲染
- 一条规则内的 NBT 键值必须全部匹配才生效,条目写错仅使该规则失效,不影响整体
- **SBW 投掷物走独立通道**:SBW 物品在配置 ID 列表内时走独立显示逻辑(固定基准物理参数 + 可调倍率),与 LR 互不干扰,不参与 LR 黑名单
- **贴墙/匍匐**:若出手点在方块内部(如贴墙蹲着),轨迹起点会自动沿视线前移,避免被挡住
---
**让每一颗雷,都投得明明白白。**
---
# Grenade Trajectory Renderer
---
### 📦 Mod Overview
**A pure client-side utility mod** — while holding a throwable and right-clicking to "cook" it, a parabolic trajectory is drawn in real-time, clearly marking the landing point, bounce positions, and distance. Aim every grenade with professional precision.
Supports throwables from **LR Tactical** and **SBW (Superb Warfare)**, with an extra **cook timer** displayed for SBW grenades.
---
### ✨ Features
- **Parabolic trajectory** — real-time arc while cooking, updating with your aim and terrain
- **Landing marker** — circle at the end of the trajectory, with distance displayed (in blocks)
- **Bounce markers** — small spheres shown where the trajectory ricochets off walls, ground, or entities
- **Airburst marker** — red explosion icon shown when a cooked grenade detonates mid-air
- **SBW cook timer** — countdown displayed below crosshair for SBW grenades, turns red and flashes below 2 seconds
---
### 🎮 How to Use
#### Basic Operation
- Hold any LR Tactical throwable (grenade/flashbang/smoke, etc.) with right-click to see the trajectory
- Trajectory updates dynamically with aim direction and terrain
- Release right-click or cancel throw — trajectory disappears immediately
#### Crouch Throw
Hold Shift to crouch — throwing speed decreases, and the trajectory shortens accordingly. Aim using the shortened arc.
#### Cookable Grenades
- The longer you cook, the shorter the fuse — the trajectory shortens in real-time
- If the fuse runs out before landing, a red airburst icon marks the explosion point
#### Bounce Prediction
Trajectories simulate ricochets off walls, ground, and entities (with bounce decay) — great for bank shots and ceiling bounces.
#### SBW Throwables
- Supports `rgo_grenade`, `hand_grenade`, `m18_smoke_grenade`
- Cook timer displayed while holding; if timer reaches zero, the grenade detonates in hand — trajectory and timer disappear together
#### Local-Only Display
All trajectories and markers are **visible only to you** — they don't affect the server and are invisible to teammates or opponents.
---
### ⚙️ Configuration
Config file location: `config/lr_trajectory_renderer_1785978259-client.toml`
Adjustable settings include:
- Trajectory color and opacity
- Line/dot style and thickness
- Landing & bounce marker toggles
- Physics multipliers
- Vertical/horizontal offset
**Changes take effect immediately via hot-loading.**
It is recommended to also download the config file from the companion resource pack for optimal fit.
---
### ⚠️ Important Notes
- **Visual prediction only — not perfect physics**: Trajectory is calculated based on current aim and terrain. Actual flight may deviate due to server latency or moving targets — always leave some margin
- **Calculation limits**: Default simulation is capped at **200 blocks distance** and **5 bounces** — trajectory cuts off naturally beyond that (landing marker still shown at cutoff point)
- **Can hide specific throwables**: Add entries to `lr.blacklist.entries` in the config file to block trajectory rendering for specific items
- Example: `"lrtactical:throwable{ThrowableId:\"lrtactical:flash_grenade\"}"` disables only that specific flashbang
- You can also use just the item ID (without `{}`) to disable all throwables of that item
- All NBT key-value pairs in a rule must match for it to apply — a malformed entry only breaks that rule, not the entire mod
- **SBW uses separate logic**: SBW items follow independent display rules (fixed base physics + adjustable multipliers) when their IDs are listed in the config — they are not affected by the LR blacklist
- **Wall/Prone handling**: If the throw origin is inside a block (e.g., crouching against a wall), the trajectory start point shifts forward along your line of sight to avoid self-blocking
---
**Every throw counts.**