Ice Boat Path Generator
一款适用于 Minecraft 26.2 的简单 Fabric 模组,用于辅助建造冰船航道。
包含“幽灵”方块以指示方块放置位置,以及自动建造的创意模式功能来生成冰路。
依赖项
- Minecraft 26.2
- Java 25
- Fabric-Loader 0.19.3
- ModMenu 20.0.1
- Cloth-Config 26.2.155
安装
从 Releases 页面下载 .jar 文件并放入 mods 文件夹。
功能
Yaw(偏航角)命令
- yawLook
- 显示当前偏航角,精度更高,包括最接近的取整角度、向下取整的最接近角度和向上取整的最接近角度(为何如此?请参见 解释 部分)。
- yawSnap
- YawBetweenPoints
x1 z1 x2 z2
- 输入两个点的坐标,该命令会显示两点之间的真实角度、吸附到最近船体角度的角度、向下取整的最接近角度和向上取整的最接近角度。
Ghost block(幽灵方块)命令
-
ghostLine length
- 吸附到最近的船体角度,并根据长度生成一排幽灵方块。
-
ghostLineBetween x1 z1 x2 z2
- 输入两个点的坐标,该命令会在这些点之间生成一排幽灵方块,并使用生成时的吸附偏航角。
-
ghostBlocksClear
-
ghostLinePlaceBlocks length
- 吸附到最近的船体角度,并根据长度放置一排真实方块。*
-
ghostLinePlaceBlocksBetween x1 z1 x2 z2
- 输入两个点的坐标,该命令会在这些点之间放置一排真实方块,并使用生成时的吸附偏航角。*
-
*命令 'ghostLinePlaceBlocks' 和 'ghostLinePlaceBlocksBetween' 被注册为服务器命令,它们在生存模式中可用(默认需要创造模式权限),但在服务器上甚至不会显示。
配置
当前 LIMITATIONS(限制)
- 基本方位角,即 0, 90, 180, -90 及其中间角度,即 45, 135, -45, -135 工作完美,因为它们即使在正常情况下也很容易实现。
- 根据我的测试,你越接近中间角度,一致性就越差,即使角度和船只放置完美,也会出现漂移。
- 当使用完整路径(即方块之间没有空气)时,在这些非基本方位角(或其中间角度)处:
- 它们能正常工作的最小长度约为 7500 个方块。
- 最大长度约为 13500 个方块(我没有尝试每一种角度和每一种可能性,靠近基本方位角的角度可能可以更远)。
- 当在方块之间使用空气时,这一数值可能会大幅下降至低至 1400 个方块。
- 平均而言,它们似乎能够延伸 2500 到 3000 个方块。
- 但在最大值处(通常靠近基本方位角),效果可能与完整路径相当,并且具有使用更少冰块的优势。
- 但对于这两种路径,船只的放置方式至关重要,将船只放置在方块的左侧或右侧容易增加数千个方块的误差。
- (如果有空气间隔,这通常是不可能的,因为船只需要放置在中心周围)。
- 因此,我强烈建议在创造世界中进行测试,验证该角度以及空气间隔是否能支持你所需的角度,或者即使是完整的方块路径,以确保万无一失。
- packed ice(压实冰)或 Blue ice(蓝冰)似乎对路径的稳定性没有影响,因此它们的区别仅在于速度,压实冰为 40 格/秒,蓝冰为 72.72(72) 格/秒。
- 我相信可以通过更优且更智能的算法来解决这个问题,特别是在创建线条时,具体考虑到大多数角度向一侧发生的漂移导致你坠落的情况。
Explanation(解释)
Snapped yaw(吸附偏航角)
- Minecraft 中的船体会吸附到 256 种可能的角度之一,每隔 1.40625° 或精确为 360/256。
- 你可以自行测试,进入任何 Minecraft 世界并将视角指向例如 29.7 到 30.7° 之间的角度,放置一艘船并重新连接世界。每次当你进入船体时,角度都会变为 29.5°(29.531250°)。
- 因此,Minecraft 在放置船体时总是对当前角度进行向下取整,这就是为什么在使用 yawLook 时,吸附角度和下限角度是相同的原因。
Line algorithm(线条算法)
用于线条生成的算法是 Bresenham's line algorithm
Credits(鸣谢)
- MinecraftShapes.com - 灵感来源,使用 Bresenham 算法绘制线条
- RaysWorks 的冰船视频 - 特别是 @chengyuanma6084 关于船体角度的评论
Ice Boat Path Generator
A simple Fabric mod for Minecraft 26.2 that helps with building ice boat pathways.
Featuring 'ghost' blocks that help indicate placement of blocks and creative auto build that creates the ice path.
Requirements
- Minecraft 26.2
- Java 25
- Fabric-Loader 0.19.3
- ModMenu 20.0.1
- Cloth-Config 26.2.155
Install
Download .jar file from releases and put into mods folder.
Features
Yaw commands
- yawLook
- Show the current yaw with higher precision, closest snapped angle, closest rounded down angle and closest round up angle (Why see Explanation section).
- yawSnap
- Snaps to the current closest boat angle.
- YawBetweenPoints
x1 z1 x2 z2
- Inputting coordinates of two points, the command shows the real angle between two points, Snapped angle to nearest boat angle, closest rounded down angle and closest round up angle.
Ghost block commands
-
ghostLine length
- Snaps to the nearest boat angle and generates a line of ghost blocks based on length.
-
ghostLineBetween x1 z1 x2 z2
- Inputting coordinates of two points, the command generates a line of ghost blocks between these two points and snapped yaw they were generated with.
-
ghostBlocksClear
-
ghostLinePlaceBlocks length
- Snaps to the nearest boat angle and places a line of ACTUAL blocks based on length.*
-
ghostLinePlaceBlocksBetween x1 z1 x2 z2
- Inputting coordinates of two points, the command places a line of ACTUAL blocks between these two points and snapped yaw they were generated with.*
-
*Commands 'ghostLinePlaceBlocks' and 'ghostLinePlaceBlocksBetween' are registered as server commands, they will work in survival (requiring creative by default) but won't even show up on servers.
Config
Current LIMITATIONS
- Cardinal angles i.e. 0,90,180,-90 and their middles i.e. 45,135,-45,-135 work perfectly as they are simple to do even normally.
- From my testing the closer to middle angles you get the more inconsistent it becomes and drift even with perfect angles and boat placement occurs.
- When using full path, meaning no air blocks between, at these non-cardinal (or their middle) angles,
- The general minimum at which they would work is about 7500 blocks .
- And about 13500 blocks maximum (I did not try every angle and every possibility, close to cardinal angles can probably go way further).
- When using air blocks between this can drop drastically as low as 1400 blocks.
- On average, they seem to be able to go 2500 to 3000 blocks .
- But at maximum (usually close to cardinal angles) can be as good full paths, with the added benefit of less ice blocks used.
- But for both of these pathways the boat placement matter a lot, easily adding thousands of blocks by placing the boat on left or right side of the block
- (With air in between this isn't usually possible as the boat needs to be placed around center).
- That's why I highly recommend to test out, in a creative world, the angle and whether air in between can support your desired angle or even full block paths just to be sure.
- Packed ice or Blue ice doesn't seem to make a difference in stability of the path, so they only differ in speed, packed ice being 40 blocks/s and blue ice 72.72(72) blocks/s.
- I'm sure this can be overcome with better and smarter algorithm when creating the line, specifically taking into consideration the drift that happens in most angles towards one side making you fall.
Explanation
Snapped yaw
- Boats in Minecraft snap to one of 256 possible angles, every 1.40625° or precisely 360/256.
- You can test this yourself, go to any Minecraft world and look at an angle between 29.7 to 30.7° as an example, place down a boat and reconnect to the world. Every time, once u get into the boat the angle will be 29.5° (29.531250°).
- So Minecraft always floors the current angle when placing a boat, that's why when using yawLook, the snapped angle and lower angle are the same.
Line algorithm
The algorithm used for the line generation is Bresenham's line algorithm
Credits
- MinecraftShapes.com - Took the inspiration to use Bresenham's algorithm to draw lines
- RaysWorks ice boat video - Specifically comment from @chengyuanma6084 regarding boat angles
评论 0
登录后参与评分
还没有评论,来抢沙发吧