Archer's Dream
Archer's Dream 是一款适用于 NeoForge 1.21.1 的 Minecraft 模组。
它让箭矢的碰撞检测遵循方块可见的实体部分,因此箭矢可以穿过栅栏的缝隙、门上的窗户以及钟的空心内部——同时仍会被实际的木头、铁栏杆、门板或钟壁所阻挡。
功能特性
- 所有箭矢(不包括三叉戟)均可穿过栅栏和栅栏门的缝隙
- 可穿过铁栏杆之间的空隙
- 可穿过门和活版门纹理中的小窗
- 可穿过墙壁的视觉空隙
- 可穿过钟(Bell)的空心内部
- 玻璃板(Glass panes)和染色玻璃板保持其正常的薄实心碰撞判定
- 缓存常见的方块状态形状,以减少箭矢飞行过程中的重复计算
支持的方块
| 方块 |
效果 |
| Fence (栅栏) |
使用中心立柱加上/下横条,使箭矢可在横条之间穿过 |
| Fence Gate (栅栏门) |
使用门柱和横条;即使关闭时箭矢也能穿过缝隙 |
| Iron Bars (铁栏杆) |
使用纹理中的垂直/水平杆条,为箭矢留出空隙 |
| Wall (墙) |
使用视觉形状,允许箭矢通过上方或侧面的视觉空隙 |
| Door (门) |
从门纹理中移除小型透明窗口区域 |
| Trapdoor (活版门) |
从活版门纹理中移除小型透明窗口区域 |
| Bell (钟) |
使用空心钟体加上附着物的碰撞判定 |
工作原理
原版箭矢在检查是否击中方块时使用的是普通的方块碰撞形状。栅栏、铁栏杆、墙和钟等方块的碰撞形状往往比实际模型更“饱满”,因此瞄准空隙的箭矢可能会击中一个不可见的盒子。
本模组使用 Mixin 来拦截方块碰撞形状的查询:
- 优化后的箭矢形状仅在实体为箭类投射物(而非三叉戟)时使用
- 玩家、生物和其他投射物保持原版行为
门和活版门的处理方式略有不同。它们的模型是实心的薄板,但纹理上有透明窗户。本模组包含了原版的窗口数据,并从碰撞形状中减去这些窗口区域。
项目结构
src/main/java/com/qinme/archersdream/
├── ArchersDream.java # 主模组类
├── mixin/
│ └── ArrowProjectileCollisionMixin.java
└── util/
├── ArrowBlockShapes.java # 箭矢专用的方块碰撞形状
└── DoorWindowShapes.java # 门/活版门纹理窗口数据
许可
本项目采用 MIT License 许可。
Archer's Dream
Archer's Dream is a Minecraft mod for NeoForge 1.21.1.
It makes arrow collision follow the visible solid parts of blocks, so arrows can pass through gaps in fences, windows in doors, and the hollow interior of bells—while still being stopped by actual wood, iron bars, door panels, or bell walls.
Features
- All arrows (excluding tridents) can pass through gaps in fences and fence gates
- Can pass through the bar gaps in iron bars
- Can pass through small windows in door and trapdoor textures
- Can pass through visual gaps in walls
- Can pass through the hollow interior of bells
- Glass panes and stained glass panes keep their normal thin solid collision
- Caches common block-state shapes to reduce repeated calculation while arrows are flying
Supported Blocks
| Block |
Effect |
| Fence |
Uses centre posts plus upper/lower rails, so arrows can pass between rails |
| Fence Gate |
Uses gate posts and rails; arrows can pass through gaps even when closed |
| Iron Bars |
Uses vertical/horizontal bar strips from the texture, leaving gaps for arrows |
| Wall |
Uses visual shape, allowing arrows through upper/side visual gaps |
| Door |
Removes the small transparent window regions from the door texture |
| Trapdoor |
Removes the small transparent window regions from the trapdoor texture |
| Bell |
Uses a hollow bell body plus attachment collision |
How It Works
Vanilla arrows use the normal block collision shape when checking whether they hit a block. Blocks like fences, iron bars, walls, and bells often have collision shapes that are more filled-in than their actual models, so arrows aimed at a gap can hit an invisible box.
This mod uses a Mixin to intercept block collision shape queries:
- The refined arrow shape is only used when the entity is an arrow-type projectile (not a trident)
- Players, mobs, and other projectiles keep the vanilla behaviour
Doors and trapdoors are handled slightly differently. Their models are solid thin slabs, but their textures have transparent windows. This mod includes the vanilla window data and subtracts those window areas from the collision shape.
Project Structure
src/main/java/com/qinme/archersdream/
├── ArchersDream.java # Main mod class
├── mixin/
│ └── ArrowProjectileCollisionMixin.java
└── util/
├── ArrowBlockShapes.java # Arrow-specific block collision shapes
└── DoorWindowShapes.java # Door/trapdoor texture window data
License
This project is licensed under the MIT License.
中文
Archer's Dream 是一个面向 NeoForge 1.21.1 的 Minecraft 模组。
它主要做一件事:让箭矢在飞行时按照方块“看得见的实体部分”进行碰撞判定,而不是被方块原本较粗糙的碰撞盒挡住。也就是说,箭可以穿过栅栏缝隙、门上的小窗、钟的内部等空心位置,但射中真实存在的木条、铁条、门板或钟壁时仍然会被挡住。
功能
- 所有箭矢(不包括三叉戟)都可以穿过栅栏和栅栏门的空隙
- 可以穿过铁栏杆的条状空隙
- 可以穿过门和活版门纹理上的小窗
- 可以穿过墙的视觉空隙
- 可以穿过钟(Bell)的空心内部
- 玻璃板、染色玻璃板仍保持正常的连续薄板碰撞,不会因为透明就被穿透
- 为常用方块增加了按状态缓存,减少箭矢飞行时的重复形状计算
支持处理的方块
| 方块类型 |
效果 |
| 栅栏 |
按中心柱和上下横条判定,可穿过横条之间的空隙 |
| 栅栏门 |
按门扇立柱和横条判定,关闭时也可穿过门扇空隙 |
| 铁栏杆 |
按纹理中的竖条和横条判定,可穿过条状空隙 |
| 墙 |
按视觉形状判定,可穿过上方或侧面的视觉空隙 |
| 门 |
扣除门板纹理上的小窗区域 |
| 活版门 |
扣除活版门纹理上的小窗区域 |
| 钟(Bell) |
使用空心钟体加支架的精细碰撞 |
工作原理
Minecraft 原版箭矢在判定是否撞到方块时,使用的是方块的普通碰撞形状。栅栏、铁栏杆、墙、钟等方块的普通碰撞形状往往比实际模型更“满”,所以箭明明瞄准的是空隙,却会被看不见的碰撞盒挡住。
本模组通过 Mixin 拦截方块碰撞形状查询:
- 只有当请求方是箭类投射物(不包括三叉戟)时,才会替换成更精细的箭矢专用碰撞形状
- 玩家、生物和其它投射物仍使用原版碰撞形状
门和活版门的小窗处理方式略有不同:门板本身是完整薄片,但纹理上有透明窗口。模组内置了原版门/活版门纹理的窗口数据,生成碰撞箱时会把小窗区域从门板中扣除。
目录结构
src/main/java/com/qinme/archersdream/
├── ArchersDream.java # 模组主类
├── mixin/
│ └── ArrowProjectileCollisionMixin.java
└── util/
├── ArrowBlockShapes.java # 箭矢专用方块碰撞形状
└── DoorWindowShapes.java # 门/活版门纹理小窗数据
开源许可
本项目使用 MIT License。
评论 0
登录后参与评分
还没有评论,来抢沙发吧