跳到正文

RegistryLib

作者:suried

A high-efficiency registry library for NeoForge modders, using a fluent API to make registering blocks, items, and more faster, cleaner, and easier to extend.

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

RegistryLib

WIKI : https://registrylib.gtodyssey.com/

RegistryLib is a NeoForge library mod built to reduce registry boilerplate and make common content setup feel much more consistent. Instead of scattering item registration, block setup, fluid definitions, tooltip logic, and data-related glue code across multiple classes, you can keep that work inside a clean fluent builder workflow.

The RegistryLibTest module shows the everyday use cases that matter most for real mod development. It covers fast item and block registration, automatic item bindings, custom loot behavior, grouped configuration for content families, and tooltip composition that stays readable even when your content starts getting more complex.

RegistryLib also gives fluid content a much cleaner setup path. The examples include tinted fluids, vanilla-style texture reuse, linked fluid blocks, and bucket item customization, which makes it a strong fit for tech mods, material-heavy mods, and projects that need to add a lot of structured content without drowning in setup code.

For larger projects, the library goes beyond basic registration. RegistryLibTest demonstrates CompositeItem attachments, BlockEntity binding, client renderer integration, and structured tooltip nodes, so the API remains useful even after your mod grows past simple items and decorative blocks.

If you want a registry workflow that scales from quick prototypes to full content mods without turning into maintenance-heavy boilerplate, RegistryLib is designed for that job. It is a practical builder-based toolkit for NeoForge developers who want cleaner registration code and more time to focus on gameplay.

Example Snippets

Basic Item Registration

public static final ItemEntry<Item> COPPER_COIN = RegistryLibTest.REGISTRYLIB
        .item("copper_coin", Item::new)
        .lang("Copper Coin")
        .register();

Block With Custom Loot And Tooltip

public static final BlockEntry<Block> DECORATIVE_STONE = RegistryLibTest.REGISTRYLIB
        .block("decorative_stone", Block::new)
        .initialProperties(() -> Blocks.STONE)
        .lang("Decorative Stone")
        .simpleItem()
        .register();

Shared Configuration With Groups

public static final Group TIMER_GROUP = RegistryLibTest.REGISTRYLIB
    .group("timers")
    .langPrefix("Timer")
    .blockProperties(p -> p.strength(5.0F, 6.0F))
    .build();

public static final BlockEntry<TimerBlock> TIMER_TIER_1 = TIMER_GROUP.block(
    "tier_1",
    p -> new TimerBlock(p, 1),
    block -> {
        block.initialProperties(() -> Blocks.IRON_BLOCK)
            .item(itemBuilder -> itemBuilder.tooltip((collector, stack) -> {
            collector.node(new SubNode.Basic(Component.literal("Tier 1 Timer"), 0), true, false);
            collector.node(new SubNode.Basic(Component.literal("Tick interval: 20"), 10));
            }));
    });

Fluid, Block, And Bucket Setup In One Flow

private static final Identifier FLUID_STILL =
        Identifier.fromNamespaceAndPath("registrylib", "block/fluid/liquid_still");
private static final Identifier FLUID_FLOW =
        Identifier.fromNamespaceAndPath("registrylib", "block/fluid/liquid_flow");

public static final FluidEntry<BaseFlowingFluid.Flowing> ACID =
        RegistryLibTest.REGISTRYLIB
                .fluid("acid", FLUID_STILL, FLUID_FLOW)
                .lang("Acid")
                .clientExtension(FLUID_STILL, FLUID_FLOW)
                .register();

常见问题

RegistryLib 支持哪些 Minecraft 版本?

RegistryLib 支持 Minecraft Java 版 1.21.1–26.1.2,共 3 个版本,可用的加载器:NeoForge。下载时注意选择和你游戏版本一致的文件。

RegistryLib 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

suried 的其他作品

查看全部 →