★ Starshadow Lib
Starshadow 模组的基础库。
Starshadow Lib 是用于 Minecraft Fabric 模组的共享小部件工具包和实用程序库。它提供了驱动 Starshadow 配置界面、模组列表和启动画面的基础模块——你也可以在自己的模组中使用它们。
“小部件、布局和渲染——那些枯燥的部分,做得恰到好处。”
✨ 特性
?️ 小部件工具包
基于原版屏幕组件构建的即用型 Minecraft GUI 小部件:
| 小部件 |
描述 |
| ToggleWidget |
带动画效果的开/关切换开关 |
| SliderWidget |
具有可配置范围的数值滑块 |
| IntStepperWidget |
带有 +/- 按钮的整数值 |
| EnumCycleWidget |
通过点击循环枚举值 |
| StarWidget |
用于构建自定义小部件的基础小部件类 |
? 布局系统
用于一致且响应式 GUI 布局的工具:
| 组件 |
描述 |
| EntryRow |
具有统一对齐方式的标签 + 小部件行 |
| Spacing |
用于 UI 一致性的标准化间距常量 |
? 容器小部件
用于组织内容的高级容器:
| 容器 |
描述 |
| ScrollablePanel |
具有平滑滚动功能的可滚动内容区域 |
| SectionCard |
带有标题和可折叠内容的卡片式容器 |
| VerticalTabBar |
多部分界面的选项卡条 |
? 渲染工具
| 工具 |
描述 |
| RenderBridge |
跨版本渲染抽象层 |
| Colors |
标准化的调色板常量 |
? 日志辅助工具
| 工具 |
描述 |
| LogLevelHelper |
用于调试日志切换的动态 Log4j2 级别控制 |
? 安装
面向模组开发者
添加到你的 build.gradle.kts 中:
dependencies {
modstitchModImplementation("com.starshadow:starshadow-lib:${property("starshadow_version")}")
include("com.starshadow:starshadow-lib:${property("starshadow_version")}")
}
面向玩家
Starshadow Lib 已捆绑在使用它的模组内部——你通常不需要单独安装它。如果某个模组需要将其作为外部依赖项:
- 为你的 Minecraft 版本安装 Fabric Loader
- 安装 Fabric API
- 将 Starshadow Lib
.jar 放入你的 mods/ 文件夹
- 启动 Minecraft
支持: Minecraft 1.20.1 · 1.20.4 · 1.21.1 — 仅限 Fabric
? 使用示例
Toggle Widget
ToggleWidget toggle = new ToggleWidget(x, y, width, height,
Text.literal("Enable Feature"),
() -> config.isEnabled(),
value -> config.setEnabled(value));
Slider Widget
SliderWidget slider = new SliderWidget(x, y, width, height,
Text.literal("Volume"),
0, 100, config.getVolume(),
value -> config.setVolume(value));
Scrollable Panel
ScrollablePanel panel = new ScrollablePanel(x, y, width, height);
panel.addChild(new EntryRow(label, widget));
panel.addChild(new EntryRow(label2, widget2));
? 兼容性
| 模组 |
兼容性 |
| Fabric API |
✅ 必需 |
| Starshadow Config |
✅ 使用 Lib 进行配置界面小部件 |
| Starshadow Menu |
✅ 使用 Lib 进行模组列表 UI |
| Starshadow Splash |
✅ 间接通过 Config 使用 Lib |
? 要求
| 依赖项 |
是否必需? |
| Fabric Loader |
✅ 是 |
| Fabric API |
✅ 是 |
Starshadow Lib 除了 Fabric 本身外没有其他依赖项——它是基础层。
? 构建更好的 UI
停止为每个模组重新发明小部件。Starshadow Lib 提供了一套一致且经过测试的 UI 组件,让你可以专注于让你的模组独具特色。
由 Ghent Starshadow 用 ❤️ 制作
根据 MPL-2.0 许可——可免费使用、分享和修改。
★ Starshadow Lib
The foundation for Starshadow mods.
Starshadow Lib is a shared widget toolkit and utility library for Minecraft Fabric mods. It provides the building blocks that power Starshadow's config screens, mod list, and splash screen — and you can use them in your own mods too.
"Widgets, layout, and rendering — the boring parts, done right."
✨ Features
?️ Widget Toolkit
Ready-to-use Minecraft GUI widgets built on vanilla screen components:
| Widget |
Description |
| ToggleWidget |
On/off toggle switch with animation |
| SliderWidget |
Numeric slider with configurable range |
| IntStepperWidget |
Integer value with +/- buttons |
| EnumCycleWidget |
Cycle through enum values with click |
| StarWidget |
Base widget class for building custom widgets |
? Layout System
Utilities for consistent, responsive GUI layouts:
| Component |
Description |
| EntryRow |
Label + widget row with consistent alignment |
| Spacing |
Standardized spacing constants for UI consistency |
? Container Widgets
Higher-level containers for organizing content:
| Container |
Description |
| ScrollablePanel |
Scrollable content area with smooth scrolling |
| SectionCard |
Card-style container with header and collapsible content |
| VerticalTabBar |
Tab strip for multi-section screens |
? Rendering Utilities
| Utility |
Description |
| RenderBridge |
Cross-version rendering abstraction layer |
| Colors |
Standardized color palette constants |
? Logging Helpers
| Utility |
Description |
| LogLevelHelper |
Dynamic Log4j2 level control for debug logging toggles |
? Installation
For Mod Developers
Add to your build.gradle.kts:
dependencies {
modstitchModImplementation("com.starshadow:starshadow-lib:${property("starshadow_version")}")
include("com.starshadow:starshadow-lib:${property("starshadow_version")}")
}
For Players
Starshadow Lib is bundled inside mods that use it — you typically don't need to install it separately. If a mod requires it as an external dependency:
- Install Fabric Loader for your Minecraft version
- Install Fabric API
- Drop the Starshadow Lib
.jar into your mods/ folder
- Launch Minecraft
Supported: Minecraft 1.20.1 · 1.20.4 · 1.21.1 — Fabric only
? Usage Examples
Toggle Widget
ToggleWidget toggle = new ToggleWidget(x, y, width, height,
Text.literal("Enable Feature"),
() -> config.isEnabled(),
value -> config.setEnabled(value));
Slider Widget
SliderWidget slider = new SliderWidget(x, y, width, height,
Text.literal("Volume"),
0, 100, config.getVolume(),
value -> config.setVolume(value));
Scrollable Panel
ScrollablePanel panel = new ScrollablePanel(x, y, width, height);
panel.addChild(new EntryRow(label, widget));
panel.addChild(new EntryRow(label2, widget2));
? Compatibility
| Mod |
Compatibility |
| Fabric API |
✅ Required |
| Starshadow Config |
✅ Uses Lib for config screen widgets |
| Starshadow Menu |
✅ Uses Lib for mod list UI |
| Starshadow Splash |
✅ Uses Lib indirectly via Config |
? Requirements
| Dependency |
Required? |
| Fabric Loader |
✅ Yes |
| Fabric API |
✅ Yes |
Starshadow Lib has no dependencies beyond Fabric itself — it's the foundation layer.
? Build Better UIs
Stop reinventing widgets for every mod. Starshadow Lib provides a consistent, tested set of UI components so you can focus on what makes your mod unique.
Made with ❤️ by Ghent Starshadow
Licensed under MPL-2.0 — free to use, share, and modify.
评论 0
登录后参与评分
还没有评论,来抢沙发吧