OR-LIB – 可穿戴物品与渲染库(Fabric)
OR-LIB 是一个小型的 Fabric 库,旨在轻松且一致地处理可穿戴物品(如戒指、护身符、饰品等)在第一人称和第三人称视角下的渲染。 它设计用于被整合包中的多个模组复用,这样你就不必每次都为姿态、变换和自定义槽位重写相同的代码。
? 用途
提供一套清晰的 API,用于定义具有专属属性的可穿戴物品。
集中管理可穿戴物品的注册、渲染和变换逻辑。
提供与外部槽位系统(类 Trinkets 槽位)的便捷集成,同时不强制对使用该库的模组施加特定的设计限制。
? 依赖项
-
加载器:Fabric
-
Trinkets
它与添加戒指、珠宝或其他饰品的内容模组配合使用时尤为有用。
仍在开发中
该库仍处于开发阶段,部分功能可能未按预期工作。
✨ 主要特性
该库的一些关键特性包括:
-
专注于可穿戴物品的 API
-
用于
WearableItem、WearableType及相关属性的类和接口。 -
采用构建器样式配置属性、增益和可穿戴行为。
-
-
集中式注册表
-
WearablesRegistry和WearableContentRegistry将所有基于 OR-LIB 的内容集中存放。 -
标签和辅助类(如
ORLibItemTags、槽位辅助类等),以实现整洁的集成。
-
-
高级可穿戴物品渲染
-
适用于基本情况的简单即用型渲染器(
SimpleWearableRenderer)。 -
使用
SlotTransform、SlotTransforms、BodyAnchor、WearablePoseContext以及默认变换提供程序构成的姿态和变换系统。 -
专用的第一人称渲染器(
FirstPersonWearableRenderer),以保持玩家视角模型与外部模型同步。
-
-
包含挂钩与混入
-
客户端侧的模型加载集成(
WearableModelLoaderMixin)以及佩戴或手持物品的渲染。 -
集中式渲染引导(
WearableRenderingBootstrap、WearableRenderRegistry),以有组织的方式初始化所有内容。
-
-
类 Trinkets 槽位兼容性
- 诸如
TrinketSlotUtil之类的实用工具,使与额外槽位系统的交互更加容易,让你可以专注于物品的外观和行为,而非样板代码。
- 诸如
?? 面向模组开发者
在项目中将 OR-LIB 作为依赖项添加(Gradle 和加载器元数据)。
通过扩展/实现提供的类(例如 WearableItem)并使用构建器进行配置来创建新的可穿戴物品。
在你的可穿戴类型、内容、标签以及任何自定义槽位中,于 OR-LIB 的注册表中注册你的可穿戴物品。
(可选)如果需要更高级的视觉效果,可通过客户端侧 API 附加自定义渲染器。
(可选)使用 OR-LIB 的工具钩入外部槽位系统(类 Trinkets),而无需编写自己的胶水代码。
⚙️ 设计与可扩展性
OR-LIB 设计为底层基础层:
它本身不添加可见内容。
它专注于 API、注册表、辅助工具和渲染。
OR-LIB – Wearables & Rendering Library (Fabric)
OR-LIB is a small Fabric library designed to make it easy and consistent to handle wearable items (rings, amulets, trinkets, etc.) and their rendering in both first and third person. It’s meant to be reused by multiple mods in the same pack, so you don’t have to rewrite the same code every time for poses, transforms, and custom slots.
? Purpose
Provide a clean set of APIs for defining Wearable Items with dedicated properties.
Centralize the logic for registration, rendering, and transformations of wearable items.
Offer convenient integration with external slot systems (trinket-like slots) without forcing a specific design on the mods that use it.
? Requirements
-
Mod Loader: Fabric
-
Trinkets
It’s especially useful together with content mods that add rings, jewelry, or other trinkets.
Still Work in progress
The library is still work in progress, some feature may work not as inteded.
✨ Key Features
Some key features of the library:
-
Wearable-focused API
-
Classes and interfaces for WearableItem, WearableType, and related properties.
-
Builder-style configuration for attributes, bonuses, and wearable behavior.
-
Centralized registries
-
WearablesRegistry and WearableContentRegistry to keep all OR-LIB-based content in one place.
-
Tags and helper classes (ORLibItemTags, slot helpers, etc.) for clean integration.
-
Advanced wearable rendering
-
Simple ready-to-use renderers (SimpleWearableRenderer) for basic cases.
-
A system of poses and transforms using SlotTransform, SlotTransforms, BodyAnchor, WearablePoseContext, and default transform providers.
-
A dedicated first-person renderer (FirstPersonWearableRenderer) to keep player-view and external model in sync.
-
Hooks & mixins included
-
Client-side integrations for model loading (WearableModelLoaderMixin) and rendering items that are worn or held.
-
Centralized rendering bootstrap (WearableRenderingBootstrap, WearableRenderRegistry) to initialize everything in an organized way.
-
Trinket-like slot compatibility
-
Utilities like TrinketSlotUtil to interact more easily with extra slot systems, so you can focus on how items look and behave, not the boilerplate.
?? For Mod Developers
Add OR-LIB as a dependency in your project (Gradle and loader metadata).
Create a new wearable by extending/implementing the provided classes (e.g. WearableItem) and configuring it with the builder.
Register your wearable in OR-LIB’s registries (wearable types, content, tags, and any custom slots).
(Optional) Attach a custom renderer via the client-side APIs if you need more advanced visuals.
(Optional) Hook into external slot systems (trinket-like) using OR-LIB’s utilities instead of writing your own glue code.
⚙️ Design & Extensibility
OR-LIB is designed as a foundation layer:
It does not add visible content by itself.
It focuses on APIs, registries, helpers, and rendering.
下载 OR-Lib
下载 OR-Lib
下载 OR-Lib
下载 OR-Lib
下载 OR-Lib
下载 OR-Lib
移植到 NeoForge
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
适用于 MC 1.18+ 的 Effekseer 加载器
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧