XunLib

A common code library designed to ease mod dev

Overview

XunLib is a lightweight yet powerful utility library designed to simplify mod development by handling repetitive tasks and offering robust, reusable systems. From inventory management to spatial tools, it provides flexible APIs to minimize boilerplate.

Features

Inventory Utilities

  • Insert/extract items, validate stacks, and check container states.
  • Armor slot validation for materials/types.
  • Convert grid positions to slot indices.

Fuzzy Item Matching

  • Compare items by count, enchantments, or custom properties.
  • Configurable ignore rules (e.g., ignore durability or Data components).

Smart Effect Application

  • Intelligently extend/upgrade existing effects or apply new ones.

Color & Spatial Tools

  • Convert between RGB/HSL/HSV and blend colors dynamically.
  • Generate shapes (discs, spheres, hollow cubes) and check spatial bounds.

Data Automation

  • @PersistentNbt annotation for auto-serializing block entity data.
  • INbtAdapter for custom NBT serialization logic.

Registration System

  • Adding custom items, blocks, and entities in the common module for easing multi-loader development.

Support and Feedbacks

If you find it useful and want to support this project, considering Buy Me a Coffee.

If you found any issue, please report an issue on my Github page!

The XunLib Team

profile avatar
Owner
  • 4
    Projects
  • 1.0K
    Downloads

More from Xun_sk