
一款实用模组,包含为众多模组提供的非常有用的代码。
该库提供:
- 简单、基于注解的内容注册。
- 对于方块,HammerLib 会自动注册 BlockItem(s)。如果您想禁用 BlockItem(s),请让您的方块实现 INoItemBlock、ICustomBlockItem 或 ICreativeTabBlock,具体取决于您想要实现的功能。
- 对于 BlockEntity 渲染,自定义的 BlockEntityType 常量可以拥有额外的 @TileRenderer,指向一个 IBESR<Tile> 类。
- 旧式语言解析器,格式为 "key=value",而非 JSON(文件名和格式类似于旧版游戏版本,但您需要在模组的构造函数中调用 LanguageAdapter.registerMod(MOD_ID); 才能进行注册。)
- 模组来源检查,允许您检查模组是否从带有广告软件/恶意软件的网站下载,并向用户发出警告。
- 基于 Java 的合成配方注册,使用简单的 RegisterRecipesEvent,在 HammerLib.EVENT_BUS 上运行,允许您像以前一样通过代码注册合成配方。
- 基于 Java 的标签填充,使用 BuildTagsEvent,在 HammerLib.EVENT_BUS 上运行。
- 大幅简化的网络通信,使用 Network 类,以及 IPacket + INBTPacket,以实现无缝且直观的数据包代码开发。
- 方块采集的包装器,已迁移至标签系统 - BlockHarvestAdapter
- 基于字段的 NBT 序列化,这样您就不会打错字或忘记编写序列化/反序列化代码。
- 经典的老式 TileEntity 包装器,包含 TileSyncable 和 TileSyncableTickable,允许同步初始状态,以及注册将独立同步的属性。
- BlockEntities 的 ContainerAPI,允许完全避免使用 MenuType<?>(无需注册屏幕提供者、菜单类型等)
- ItemStack -> Color[] API,包含 TexturePixelGetter.getAllColors
- 基于注解的自定义模型加载器(在 IUnbakedGeometry<SELF> 上使用 @LoadUnbakedGeometry),通过创建通用包装器来避免使用几何体加载器类。
- ……以及更多功能!
以及为模组开发者提供的丰富功能。
还不够?您可以直接在 GitHub 上查看源代码,它是免费的!
权限:
- 您可以在整合包中使用此模组。
- 是的,您可以构建依赖 Hammer Core 的模组,但不得将其嵌入其中!
- 未经我许可(
Zeitheron 在 Discord 上),您不得在未提供 CurseForge/Modrinth 下载链接的情况下将此模组重新发布到其他站点。 - 您不得将此模组(或 DragonForge 团队的其他任何模组)包含在您自己的模组中。然而,构建插件是允许的,但最好先友好地私信告知。
注意:
- 唯一支持的 Minecraft 版本是该模组存在的最新版本。请勿要求降级!
加入 Discord 服务器并在 Twitter 上关注 Zeitheron!
如果您希望支持我的工作,您可以通过 Patreon 成为赞助者。 ![]()

Utility mod that contains really useful code for quite a few mods.
This library provides:
- Simple, annotation-based content registration.
- For Blocks, HammerLib automagically registers BlockItem(s). If you want to disable BlockItem(s), let your block implement INoItemBlock, ICustomBlockItem, or ICreativeTabBlock, depending on what you want to achieve.
- For BlockEntity rendering, custom BlockEntityType constants may have additional @TileRenderer, pointing to an IBESR<Tile> class.
- Old-styled language parsers in format of "key=value", instead of JSONs (the file names and format is like in older game versions, but you need to call LanguageAdapter.registerMod(MOD_ID); inside your mod's constructor for it to register.
- Mod Source checks, that allow you to check if the mod was downloaded from adware/malware sites, AND warn users about it.
- Java-based recipe registration with a simple RegisterRecipesEvent, that runs on HammerLib.EVENT_BUS, allowing you, as a developer, to register crafting recipes like before, with code.
- Java-based tag population, with BuildTagsEvent, that runs on HammerLib.EVENT_BUS.
- Vastly simplified networking, using Network class, and IPacket + INBTPacket to allow for flawless and intuitive packet code development.
- Wrappers for block harvesting, that has been moved over to tags - BlockHarvestAdapter
- Field-based NBT serialization, so that you don't make a typo/forget to write serialization/deserialization code.
- Good old TileEntity wrappers, with TileSyncable and TileSyncableTickable, that allow synchronization of initial state, as well as registering properties that will be synchronized independently.
- ContainerAPI for BlockEntities, allowing to avoid MenuType<?> altogether (no need to register screen providers, menu types etc)
- ItemStack -> Color[] API, with TexturePixelGetter.getAllColors
- Annotation-based custom model loaders (@LoadUnbakedGeometry on IUnbakedGeometry<SELF>), avoids using the geometry loader class by making a common wrapper.
- ...And a whole lot more!
And a lot of rich features for mod devs.
Not enough? You can just view sources on GitHub, it's free!
Permissions:
- You can use this mod in your modpack.
- Yes, you are allowed to build a mod that requires Hammer Core, but not embeds it!
- You are not allowed to repost this mod to other sites without providing a CurseForge/Modrinth download link and my permission (
Zeitheron on Discord) - You are not allowed to include this (or any other mods of DragonForge team) in your own mod. Building addons, however, is allowed, but a friendly PM would be good.
Note:
- The only supported version of minecraft is the latest one that this mod exists for. DO NOT ASK TO DOWNGRADE!
Join the discord server and follow Zeitheron on Twitter!
If you would like to support my work, you can become a patron via Patreon. ![]()
版本游戏版本平台发布时间本站下载
正式版
21.0.17
1.21.11.21 NeoForge 1 个月前 ·
0
1.21.1
1.21
NeoForge
1 个月前
0
下载 HammerLib
正式版
21.0.16
1.21.11.21 NeoForge 2 个月前 ·
0
1.21.1
1.21
NeoForge
2 个月前
0
下载 HammerLib
正式版
21.0.15
1.21.11.21 NeoForge 2 个月前 ·
0
1.21.1
1.21
NeoForge
2 个月前
0
下载 HammerLib
正式版
12.2.66
HammerLib 12.2.66
1.12.2 Forge 4 个月前 ·
0
1.12.2
Forge
4 个月前
0
下载 HammerLib
正式版
12.2.65
HammerLib 12.2.65
1.12.2 Forge 4 个月前 ·
0
1.12.2
Forge
4 个月前
0
下载 HammerLib
正式版
12.2.63
1.12.2 Forge 5 个月前 ·
0
1.12.2
Forge
5 个月前
0
下载 HammerLib
正式版
12.2.62
HammerLib 12.2.62
1.12.2 Forge 5 个月前 ·
0
1.12.2
Forge
5 个月前
0
下载 HammerLib
正式版
12.2.61
HammerLib 12.2.61
1.12.2 Forge 5 个月前 ·
0
1.12.2
Forge
5 个月前
0
下载 HammerLib
正式版
12.2.60
HammerLib 12.2.60
1.12.2 Forge 5 个月前 ·
0
1.12.2
Forge
5 个月前
0
下载 HammerLib
正式版
12.2.59
HammerLib 12.2.59
1.12.2 Forge 5 个月前 ·
0
1.12.2
Forge
5 个月前
0
下载 HammerLib
21.0.17
正式版
2026-09-25
更新日志:
- 从 FlowGui 1.20.1 移植缺失的功能;(19cc5c798574d5c) by Zeith
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
Woot Revived
pharuxtan
一个用于收集生物掉落物的多区块模组。
生物科技
349
模组
玉Jade ?
Snownee
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
实用前置
247
模组
物品管理器Just Enough Items (JEI)
mezz
查看物品与配方
前置实用
229
模组
KubeJS
Lat
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
前置实用
181
模组
AAA Particles
ChloePrime
适用于 MC 1.18+ 的 Effekseer 加载器
前置装饰
173
模组
开放派对与认领Open Parties and Claims
thexaero
添加区块认领和玩家组队功能,并与 Xaero's Minimap 和 World Map 集成
前置实用
153

评论 0
登录后参与评分
还没有评论,来抢沙发吧