Iron's Spell Scroll Ponder
Iron's Spell Scroll Ponder 为 Iron's Spells 'n Spellbooks 的法术卷轴添加了交互式法术预览功能。悬停在一个有效的法术卷轴上并长按 Ponder 的可配置按键(默认为 W),即可打开实时预览。
本模组不再为每个法术手动维护场景,而是会在一个隔离的预览维度中,对服务端模拟玩家施放所选法术。实体、方块、粒子、音效、施法状态以及审查通过的 Iron's Spellbooks 客户端数据包将被投影到 Ponder 虚拟层级中。这使得内置法术和许多附加包法术无需针对每个法术编写场景代码即可获得实用的预览效果。
附加包兼容性
大多数 Iron's Spellbooks 附加包均可自动工作,因为本模组通过 SpellRegistry 发现其注册的法术,并在服务端模拟玩家上执行真实法术。随后,它将产生的实体、粒子、音效、方块变化、施法状态以及经审查通过的视觉数据包投影到 Ponder 场景中。使用 Iron's 标准施法和世界 API 的普通附加包法术不需要专门的集成。
对于重要行为发生在初始施法之后(例如重新施法、稍后的物理攻击、效果移除回调或其他游戏玩法交互)的复杂法术,可能需要适配器。附加包作者可以在通用初始化阶段注册服务端 SpellPreviewAdapter:
SpellPreviewAdapters.register(
ResourceLocation.fromNamespaceAndPath("your_mod", "complex_spell"),
new SpellPreviewAdapter() {
@Override
public void onCastCompleted(SpellPreviewContext context) {
// 准备后续演示所需的任何状态。
}
@Override
public Action tickAfterCast(SpellPreviewContext context) {
if (context.ticksSinceLastCast() == 12) {
context.performPhysicalAttack(1.0F);
}
return context.ticksSinceLastCast() >= 20 ? Action.COMPLETE : Action.WAIT;
}
});
适配器的生命周期还包括 onSceneReady、beforeRecast 和 onSessionClosed,而 SpellPreviewContext 提供了用于常见交互的受限辅助方法。对于无法安全隔离的法术(如持久传送门或跨维度旅行),请从 allowsSimulation 返回 false。自定义仅客户端数据包不会自动获得信任:请优先使用标准的实体、粒子、音效和方块 API,或者为该数据包贡献一个经过严格审查的投影处理器。有关完整 API,请参阅 SpellPreviewAdapter 和 SpellPreviewContext。
特性
- 在查看卷轴工具提示时按住正常的 Ponder 按键以打开预览。
- 显示法术名称、描述、学派、稀有度、等级、施法类型、法力消耗、冷却时间、法术强度、独特统计数据以及观测到的目标伤害。
- 渲染一个紧凑的
7 x 7 竞技场,包含一个模拟施法者和三个目标。
- 在不重置摄像机的情况下重播当前法术。
- 按学派浏览已启用的法术,搜索它们,并切换活动预览。
- 旋转、平移和缩放 Ponder 风格场景。
- 为充能和持续型法术显示与服务端同步的施法进度。
- 在服务端运行法术逻辑,同时保持真实玩家位置不变。
- 将 Ponder 和 Flywheel 捆绑在可分发的 JAR 文件中。
要求
仍需安装 Iron's Spellbooks 及其正常运行时的依赖项。请将此模组安装在客户端和服务端。
使用方法
- 打开物品栏界面并悬停在一个有效的 Iron's Spellbooks 卷轴上。
- 按住工具提示中显示的 Ponder 按键。
- 拖动以旋转场景,使用鼠标滚轮进行缩放,并使用界面显示的移动键平移摄像机。
- 使用 Replay 重建并再次施放当前法术。
- 点击卷轴图标以搜索并预览另一个已启用的法术。
- 按 Escape 键或关闭界面以结束服务端预览会话。
Ponder 按键可在 Minecraft 的按键绑定中进行更改。生成的 config/iss_ponder-client.toml 文件还提供了 tooltip.showScrollSpellDescription 选项;将其设置为 false 可以停止在卷轴工具提示中添加法术指南描述,而不会禁用预览提示。
安全性与兼容性
法术代码是可执行的模组代码,因此自动兼容性永远不可能是绝对的。预览将每次施法限制为 15 秒,并将每个玩家隔离在 iss_ponder:spell_preview 的一个远处单元格中。内置的 pocket_dimension、recall 和 portal 法术仅提供信息性质,因为它们可以改变维度或持久的世界状态。
依赖于生物群系、结构、方块交互、真实玩家物品栏或第二次游戏玩法操作的附加包法术可能需要专用适配器。自定义客户端数据包在虚拟层级中重播之前也需要明确审查。
该项目包含了针对多阶段、重新施法、反应性防御和后续投射物机制的专用后续适配器。请参阅 SPECIAL_SPELLS.md 查看测试矩阵,以及 TECHNICAL_NOTES.md 查看已验证的架构、源引用和升级清单。
Iron's Spell Scroll Ponder
Iron's Spell Scroll Ponder adds an interactive spell preview to scrolls from Iron's Spells 'n Spellbooks. Hover a valid spell scroll and hold Ponder's configurable key (W by default) to open a live preview.
Instead of maintaining a hand-authored scene for every spell, the mod casts the selected spell on a server-side simulated player in an isolated preview dimension. Entities, blocks, particles, sounds, cast state, and selected Iron's Spellbooks client packets are projected into a Ponder virtual level. This gives built-in spells and many add-on spells a useful preview without per-spell scene code.
Add-on Compatibility
Most Iron's Spellbooks add-ons work automatically because this mod discovers their registered spells through SpellRegistry and executes the real spell on a server-side simulated player. It then projects the resulting entities, particles, sounds, block changes, cast state, and reviewed visual packets into the Ponder scene. An ordinary add-on spell that uses Iron's standard casting and world APIs does not need a dedicated integration.
Complex spells may require an adapter when their important behavior happens after the initial cast, such as a recast, a later physical attack, an effect removal callback, or another gameplay interaction. Add-on authors can register a server-side SpellPreviewAdapter during common initialization:
SpellPreviewAdapters.register(
ResourceLocation.fromNamespaceAndPath("your_mod", "complex_spell"),
new SpellPreviewAdapter() {
@Override
public void onCastCompleted(SpellPreviewContext context) {
// Prepare any state required by the follow-up demonstration.
}
@Override
public Action tickAfterCast(SpellPreviewContext context) {
if (context.ticksSinceLastCast() == 12) {
context.performPhysicalAttack(1.0F);
}
return context.ticksSinceLastCast() >= 20 ? Action.COMPLETE : Action.WAIT;
}
});
The adapter lifecycle also provides onSceneReady, beforeRecast, and onSessionClosed, while SpellPreviewContext exposes bounded helpers for common interactions. Return false from allowsSimulation for spells that cannot be isolated safely, such as persistent portals or cross-dimension travel. Custom client-only packets are not automatically trusted: prefer standard entity, particle, sound, and block APIs, or contribute a narrowly reviewed projection handler for that packet. See SpellPreviewAdapter and SpellPreviewContext for the complete API.
Features
- Hold the normal Ponder key while viewing a scroll tooltip to open the preview.
- Display spell name, description, school, rarity, level, cast type, mana cost, cooldown, spell power, unique statistics, and observed target damage.
- Render a compact
7 x 7 arena with a simulated caster and three targets.
- Replay the current spell without resetting the camera.
- Browse enabled spells by school, search them, and switch the active preview.
- Rotate, pan, and zoom the Ponder-style scene.
- Show server-synchronized cast progress for charged and continuous spells.
- Run spell logic on the server while keeping the real player in place.
- Bundle Ponder and Flywheel inside the distributable JAR.
Requirements
Iron's Spellbooks and its normal runtime dependencies are still required. Install this mod on both the client and server.
Usage
- Open an inventory screen and hover a valid Iron's Spellbooks scroll.
- Hold the Ponder key shown in the tooltip.
- Drag to rotate the scene, use the mouse wheel to zoom, and use the movement keys shown by the interface to pan the camera.
- Use Replay to rebuild and cast the current spell again.
- Click the scroll icon to search for and preview another enabled spell.
- Press Escape or close the screen to end the server preview session.
The Ponder key can be changed in Minecraft's key bindings. The generated config/iss_ponder-client.toml file also provides tooltip.showScrollSpellDescription; set it to false to stop adding the spell's guide description to scroll tooltips without disabling the preview prompt.
Safety and Compatibility
Spell code is executable mod code, so automatic compatibility can never be absolute. The preview limits a cast to 15 seconds and isolates each player in a distant cell of iss_ponder:spell_preview. The built-in pocket_dimension, recall, and portal spells are information-only because they can change dimensions or persistent world state.
Add-on spells that depend on a biome, structure, block interaction, real player inventory, or a second gameplay action may need a dedicated adapter. Custom client packets also require explicit review before they are replayed in the virtual level.
The project includes dedicated follow-up adapters for multi-stage, recast, reactive defense, and subsequent-projectile mechanics. See SPECIAL_SPELLS.md for the test matrix and TECHNICAL_NOTES.md for the verified architecture, source references, and upgrade checklist.
评论 0
登录后参与评分
还没有评论,来抢沙发吧