Shoulder Surfing: Iron's Spells 整合
一个轻量级客户端模组,用于整合 Shoulder Surfing Reloaded
与 Iron's Spells 'n Spellbooks,使你在施放法术时(无论是通过法术书、普通法术还是快速施法),摄像机都会自动跟随你的准星。兼容手柄模组。


兼容性
已在以下模组中测试并正常工作:
Bug 报告
这不是 Shoulder Surfing Reloaded 的官方插件,因此任何问题都应反馈至
this mod issue tracker,
而非提交给 Shoulder Surfing Reloaded 团队。
技术实现
本模组修复了在使用 Shoulder Surfing Perspective 时可能遇到的问题。
这些修复是通用的,无论摄像机是否解耦均适用。
以下是本模组修复的问题:
连续施法
本模组使用了 IAdaptiveItemCallback
回调,由 Shoulder Surfing Reloaded 模组提供,以便它 识别为正在瞄准准星目标,
确保 玩家看向准星目标,无论法术来源如何(例如法术书、卷轴物品)
以及摄像机是否解耦。
即使摄像机耦合,此修复也有效,因为如果没有它,在 Shoulder Surfing 模式下施放连续法术会导致玩家直视前方而不是看向准星。
通过法术书施法时看向准星目标
当使用鼠标右键点击卷轴物品施放法术时,如果摄像机解耦,Shoulder Surfing 模组会自动
看向准星目标。
但在使用法术书施放法术时(这是一种常见方法),情况并非如此。
对
CastPacket
和
QuickCastPacket
的构造函数进行 Mixins 注入,因为这些对象仅在客户端构造,且仅当玩家通过按键绑定施放法术时才会构造。这确保了该模组与任何手柄模组保持兼容,并保持纯客户端运行,无需向网络发送数据包。
Iron Spells 模组的官方 API
目前功能有限,且所有事件仅在服务器端调用。这使得在保持该模组纯客户端运行的同时支持手柄模组并避免依赖其内部 API 变得困难。
使用卷轴物品时始终看向准星目标
我们在调用
Scroll.use
之前调用 ShoulderSurfingImpl.lookAtCrosshairTarget 以修复两个问题:
- 当摄像机解耦时,如果你使用任何物品,Shoulder Surfing 模组会自动调用
ShoulderSurfingImpl.lookAtCrosshairTarget。
但是,通过手柄使用卷轴物品时,Shoulder Surfing 无法识别。
- 即使你不使用手柄,此修复也有用,因为当摄像机耦合时,
ShoulderSurfingImpl.lookAtCrosshairTarget 不会自动调用。如果没有此修复,
法术将会射向玩家正前方而不是瞄准准星目标。
玩家将 始终 看向准星目标,无论摄像机是耦合还是解耦,也无论输入方式是手柄还是键盘。
免责声明
本模组不是 MINECRAFT 的官方产品。
它未经 MOJANG 或 MICROSOFT 批准,也不与其关联。
本模组不与 Shoulder Surfing Reloaded Team
或 Iron's Spells 'n Spellbooks 有关联。
许可证
MIT
你也可以在 GitHub 上找到源代码。
Shoulder Surfing: Iron's Spells Integration
A simple client-side mod that integrates Shoulder Surfing Reloaded
and Iron's Spells 'n Spellbooks, making the camera automatically
follow your crosshair whenever you cast a spell—via spellbooks, normal spells, or quick cast. Compatible with controller
mods.


Compatibility
Tested with the following mods and works as expected:
Bug reports
This isn't an official Shoulder Surfing Reloaded addon, so any issues should be reported
to this mod issue tracker
rather than to the Shoulder Surfing Reloaded team.
Technical Implementation
This mod fixes issues you may encounter when using the Shoulder Surfing Perspective.
The fixes are universal and apply regardless of whether the camera is decoupled or not.
Here are the issues that this mod fix:
Continuous Spell Casting
This mod uses the IAdaptiveItemCallback
callback provided by the Shoulder Surfing Reloaded mod so that it identifies as if we're aiming at the crosshair target,
ensuring the player looks at the crosshair target regardless of the spell cast source (e.g., spell book, scroll item)
and whether the camera is decoupled or not.
This fix is effective even when the camera is coupled, because without it, casting a continuous spell in Shoulder Surfing
causes the player to look straight ahead instead of at the crosshair.
Look at Crosshair Target When Casting via Spell Book
When casting a spell using a scroll item by right-clicking with the mouse, the Shoulder Surfing mod will automatically
look at the crosshair target if the camera is decoupled.
This is not the case when casting spells via spell books, which is a common method.
Mixins into the constructors of
CastPacket
and
QuickCastPacket,
since these are only constructed from the client side and only when the player is casting a spell from a keybind. This
ensures that the mod stays compatible with any controller mod and remains client-side without sending packets to the
network.
The official API provided by the Iron Spells mod is
currently a bit limited, and all events are called on the server side only. This makes it difficult to keep this mod
client-side only while still supporting controller mods and avoiding dependency on their internal APIs.
Always Look at Crosshair Target When Using a Scroll Item
We call ShoulderSurfingImpl.lookAtCrosshairTarget before
Scroll.use
is called to fix two issues:
- The Shoulder Surfing mod automatically calls
ShoulderSurfingImpl.lookAtCrosshairTarget
when you use any item if the camera is decoupled. However, when using a scroll item via controller,
Shoulder Surfing does not recognize it.
- This fix is useful even if you don't use a controller, because when the camera is coupled,
ShoulderSurfingImpl.lookAtCrosshairTarget is not called automatically. Without this fix,
spells will be cast straight ahead of the player instead of aiming at the crosshair target.
The player will always look at the crosshair target, regardless of whether the camera is coupled or decoupled,
and regardless of the input method—controller or keyboard.
Disclaimer
This mod is NOT AN OFFICIAL MINECRAFT PRODUCT.
It is NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.
This mod is not affiliated with the Shoulder Surfing Reloaded Team
or Iron's Spells 'n Spellbooks.
License
MIT
You can also find the source code on GitHub.
评论 0
登录后参与评分
还没有评论,来抢沙发吧