Shared code library for GTNH mods.
- Define configs with the
@Configannotation on a class. Each field becomes a config option. - Set defaults, ranges, comments, and lang keys with field annotations like
@DefaultInt,@RangeInt, and@Comment. - The library reads, writes, and validates the
.cfgfile for you. No manualConfigurationcalls. - Mark fields
@Syncto push server values to clients on connect. - Generates a Forge config GUI straight from the annotations.
- Fires
InventoryChangedEventwhen a player's net item holdings change. Subscribe toItemAddedorItemRemoved, which carry the changedItemStackand a signed delta. - Items are matched by type and metadata ignoring NBT, so sorting an inventory fires nothing. Scans run every few ticks (configurable).
- Fires
PickBlockEventwhen a player middle-clicks a block. - Mark a class
@EventBusSubscriberto auto-register its@SubscribeEventmethods. Choose the side and load phase in the annotation. No manual registration needed.
ImmutableItemStackwraps a stack as read-only to prevent accidental mutation.ItemTransfermoves items between anItemSourceand anItemSinkwith predicate filters and count limits.- Walk any
IInventorywithInventoryIterator, including sided slots. - The source and sink interfaces abstract pulling and pushing so transfer logic works across any inventory type.
- Render items with multiple stacked texture layers by implementing
ItemWithTextures. Register withTexturedItemRenderer. CapturingTesselatorcaptures render quads off the main thread for batched or async rendering.- Helpers for animated tooltips and an above-hotbar HUD message.
- Register custom block properties: boolean, int, enum, direction, axis, and orientation.
- Pack and read property values from block metadata, so blocks behave like modern block states on 1.7.
- Includes a
blockstatecommand to inspect state at a position.
- Brigadier command API for modern command parsing, completion, and execution on 1.7.
- Register custom game rules with
GameRuleRegistry. The library hooks the vanilla game rules system to notify your rules of changes.
- Team management system with roles, membership, and admin commands.
- Register your own data on a team with
TeamDataRegistry. The library persists it to disk and syncs it to clients.
- Send titles, hotbar messages, and view distance to clients.
- Sync custom player data.
- LWJGL3-style
MemoryUtilandMemoryStackbackport in thebytebufpackage. - FNV-1a 32 and 64 bit hashing.
- Math, NBT, JSON, file, direction, and distance helpers.
- Color types for RGB and HSV.
- 3D geometry iterators and transforms.
- Capability provider helpers.
- Synced keybinds.
- ASM and bytecode helpers.
- Mod compatibility checks (Baubles, FalseTweaks, NEI).
- FastUtil shadow via https://github.com/GTNewHorizons/GTNHExtLib
Configs: Originally by FalsePattern, licensed under LGPL-3.0 in FalsePatternLib