车辆收线
一个小型 Minecraft 模组,为通过鱼竿收线玩家骑乘的车辆添加了客户端功能。例如,此模组允许你收线由玩家驾驶的船。
原版服务器已经支持这一功能。
技术说明
在原版 Minecraft 中,当实体被鱼钩挂住且鱼竿被抛出时,通常由服务器负责加速该被钩住的实体。然而,当该实体(如船或矿车)由玩家控制,或者该实体本身就是玩家时,服务器不会干预,而是将任务交由相关玩家的客户端处理。但是,客户端代码仅会加速是玩家本身的实体,而跳过玩家正在控制的其他实体。这导致车辆(如船和矿车)完全无法获得加速度。作为一种变通方案,一些人曾骑着由玩家控制的猪,而这些猪本身又在船里(由猪控制,即由服务器控制,因为猪不是玩家),以此来收线船只。
此模组所做的,仅仅是修改客户端检查逻辑,使其也处理玩家骑乘实体的收线操作。
关于兼容性
兼容性未经全面测试。
此模组仅包含一个 Mixin 文件,因此应与其他模组及不同 Minecraft 版本具有较好的兼容性。本模组针对 Minecraft 1.20.1 开发。它可能适用于少数更早或更晚的版本,因此已设置为兼容所有 Minecraft 版本。如果未来出现对鱼竿的大规模重构,此模组可能会失效。如遇任何问题,欢迎在 GitHub 上提交 Issue。
Vehicle Reeling
A tiny Minecraft mod that adds client-side functionality for reeling vehicles ridden by players with fishing rods. For example, this mod allows you to reel a boat that is being ridden by a player.
Vanilla servers already support this.
A technical explaination
In vanilla Minecraft, when an entity is hooked onto a fishing rod and the rod is cast, normally the server handles accelerating the hooked entity. However, when the entity, like a boat or a minecart, is controlled by a player or if the entity itself is a player, the server doesn't want to touch it and instead the job is offloaded to the relevant player's client. However, the client code only accelerates entities that are the player and skips other entities the player is controlling. This causes vehicles (like boats and minecarts) to not get accelerated at all. As a workaround, some people have been riding pigs (controlled by a player) that themselves are in boats (controlled by the pig, i.e. the server because a pig is not a player) in order to reel the boat.
What this mod does, is simply alter the client-side check to also process reeling for entities that the player is riding.
A note about compatibility
Compatibility has not been exhaustively tested.
This mod consists of only one Mixin file, so it should be relatively compatible with other mods and other Minecraft versions. This mod was developed for Minecraft 1.20.1. It will probably work with a few earlier and later versions, so it has been set to be compatible with all Minecraft versions. If a fishing rod overhaul was to come, this would mod would probably break. If any issues arise, feel free to open an issue on GitHub.
评论 0
登录后参与评分
还没有评论,来抢沙发吧