介绍
中文介绍正在准备中,下面暂时显示原文。
S-Lib
S-Lib is a lightweight utility and config library for Minecraft modding.
Example mod: Check out the S-Lib Test Mod repository for complete config usage examples and GUI generation using YACL.
Features
Annotation-Driven Configs
- Register synced or local configs in a single line of code using
SLibConfig.syncedBuilder()orSLibConfig.localBuilder(). - Network
@SyncOptions: OVERRIDE_CLIENT: server authoritative config, syncs to the client. Config broadcasts on login and updates in real time. Supports configurable permission checks (e.g., OP-only).INFORM_SERVER: local config, informs server of changesNONE: local config, no network sync- Newly added fields are automatically populated with defaults, obsolete keys are removed, and values are clamped to specified ranges when using the annotations
@RangeInt,@RangeFloat, and@RangeDouble. - Insert comments using the
@Commentannotation on top of fields, directly in your config class. - Backups are automatically created if file corruption or invalid syntax is detected, preserving the broken config if you accidentally make a mistake.
- Use the
@Nestannotation to allow usage of nested classes for more complex config structures. - Use the
@Ignoreannotation to ignore a field entirely. - Built-in type adapters compatible with serialization for AWT’s
Color, Minecraft’sTextColor,Identifier,Pattern, andUUIDclasses.
Custom YACL Controllers
Custom controllers for YACL:
- Advanced Color Controller: Supports hex codes (
#RRGGBBAA), Minecraft color names, and legacy formatting codes (&a,&3). - Item or Tag Controller: Autocomplete dropdown for matching exact items, tags (
#c:swords), namespaces (minecraft:*), and regex patterns. - Simple Dropdowns: Dropdown selectors for Enums and Strings.
General Utilities
- Target Matcher Engine: Item matching via exact IDs, tags, namespaces, wildcards (
*), and regex (regex:.*_sword). - Platform Helpers: Abstractions for loader-specific methods, both as a general utility (
PlatformHelper) and for network-related features (NetworkHelper). - Math and Color Utils: Easing functions (lerp, ease-out, clamp), text gradient generators, color utilities, and more.
常见问题
S-Lib 支持哪些 Minecraft 版本?
S-Lib 支持 Minecraft Java 版 1.20.1–1.21.1,共 2 个版本,可用的加载器:Fabric / Forge / NeoForge。下载时注意选择和你游戏版本一致的文件。
S-Lib 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Forge / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端和服务端都要装。
Stalemated 的其他作品
查看全部 →Prominence™ II: Hasturian Era
by ElocinDev, Stalemated 等
一款基于自定义内容打造、充满丰富背景故事的 RPG 整合包。通过天赋树升级变强,锻造并强化属于你自己的神器武器,挑战强大的 Boss,阻止虚空入侵。
1555万
4 天前
Modrinth · CurseForge
Spell Enchants Expanded – Fix for the RPG Enchants
by almdudlerking, Stalemated
这个数据包让更多盔甲能够使用日炎、充能和霜魂。主要适用于执政官、先驱以及Prominence II中的部分弓箭手盔甲。
286.1万
2 个月前
Modrinth · CurseForge
Spell Enchants for All! – Prominence II
by Stalemated
为大多数武器添加法术附魔。
277.2万
6 个月前
CurseForge · Modrinth
MouseTweaks x Accessories Fix
by Stalemated
Disables the Wheel Tweak in the Accessories GUI
241万
4 个月前
CurseForge
评论
登录后评论和评分