Перейти к содержимому
Mineforgian

XunLib

A common code library designed to ease mod development

Загрузки
985
Подписчики
0
Обновлён
5 января 2026 г.
Лицензия
MIT

Опубликован 21 апреля 2025 г.

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.

Registration System

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

Ченджлог

1.21-2.1.5Релиз1.21, 1.21.1 · 5 января 2026 г.

Xunlib v2.1.5 Changelog

Breaking Changes

  • Removed @PersistentNbt & NBT Automation:
    • Entire @PersistentNbt annotation system and related NBT automation removed
    • Reason: Inflexible and redundant
    • Migration: Use standard CompoundTag serialization in saveAdditional() and loadAdditional()

Fixes

  • combineAsNamespacedID Method:
    • Fixed formatting to include colon (:) between namespace and path
    • Before: "namespacepath_part1_part2"
    • After: "namespace:path_part1_part2"
1.21-2.1.5Релиз1.21 · 5 января 2026 г.

Xunlib v2.1.5 Changelog

Breaking Changes

  • Removed @PersistentNbt & NBT Automation:
    • Entire @PersistentNbt annotation system and related NBT automation removed
    • Reason: Inflexible and redundant
    • Migration: Use standard CompoundTag serialization in saveAdditional() and loadAdditional()

Fixes

  • combineAsNamespacedID Method:
    • Fixed formatting to include colon (:) between namespace and path
    • Before: "namespacepath_part1_part2"
    • After: "namespace:path_part1_part2"
1.21-2.1.4Релиз1.21, 1.21.1 · 16 июня 2025 г.

Xunlib v2.1.4 Changelog

Additions

  • Set Identification:
    • Added getName() method to ToolSet and ArmorSet
    • Returns base material name (e.g. ruby for "Ruby Armor")
    • Use case: Streamlines datagen for language JSON files
  • Mob Effect Utilities:
    • hasEffect(entity, effect): Checks if entity has specific effect
    • clearEffect(entity, effect): Removes specific effect from entity
    • clearEffects(entity): Removes all effects
1.21-2.1.4Релиз1.21 · 16 июня 2025 г.

Xunlib v2.1.4 Changelog

Additions

  • Set Identification:
    • Added getName() method to ToolSet and ArmorSet
    • Returns base material name (e.g. ruby for "Ruby Armor")
    • Use case: Streamlines datagen for language JSON files
  • Mob Effect Utilities:
    • hasEffect(entity, effect): Checks if entity has specific effect
    • clearEffect(entity, effect): Removes specific effect from entity
    • clearEffects(entity): Removes all effects
1.21-2.1.3Релиз1.21, 1.21.1 · 14 июня 2025 г.

Xunlib v2.1.3 Changelog

Fixes & Improvements

  • ArmorSet/ToolSet Builders:
    • Changed Item.Properties field to Supplier for safer delayed initialization
    • withVanillaBalance() now correctly references Iron-tier attributes (attack damage/speed)
  • Registry Utilities:
    • Restored static Registries map in common utils class to resolve getKey()/getRegistryId() problem

Features

  • Custom Smithing Templates:
    • Added UpgradeSmithingTemplateItem with extracted Netherite upgrade logic from vanilla
    • Customize icons, description text, and material requirements.

Hotfix Impact:

  • Critical fixes for ArmorSet/ToolSet attribute calculations and registry lookups

Upgrade Recommended for all users experiencing registry ID errors or custom tool/armor balance issues.

1.21-2.1.3Релиз1.21 · 14 июня 2025 г.

Xunlib v2.1.3 Changelog

Fixes & Improvements

  • ArmorSet/ToolSet Builders:
    • Changed Item.Properties field to Supplier for safer delayed initialization
    • withVanillaBalance() now correctly references Iron-tier attributes (attack damage/speed)
  • Registry Utilities:
    • Restored static Registries map in common utils class to resolve getKey()/getRegistryId() problem

Features

  • Custom Smithing Templates:
    • Added UpgradeSmithingTemplateItem with extracted Netherite upgrade logic from vanilla
    • Customize icons, description text, and material requirements.

Hotfix Impact:

  • Critical fixes for ArmorSet/ToolSet attribute calculations and registry lookups

Upgrade Recommended for all users experiencing registry ID errors or custom tool/armor balance issues.

1.21-2.1Релиз1.21, 1.21.1 · 6 июня 2025 г.

Xunlib v2.1 Changelog

Registration System Overhaul

  • Renamed RegistrarRegister: Simplified naming for core registration API.
  • New Registry Paradigm:
    • Replaced lazy registry references with strongly-typed holders:
      • RegistryHolder: Base for all registry objects
      • RegistryItem: Specialized holder for items
      • RegistryBlock: Specialized holder for blocks
    • Benefits: Type safety, explicit lifecycle control, and loader-agnostic initialization.

Breaking Changes

  • Forge Support Removed:
    • Discontinued due to API incompatibilities with the finite registration system.
    • Still Supported: Fabric and NeoForge
  • Deprecated/Removed:
    • All lazy registry references (migrate to RegistryHolder subclasses).

Improvements

  • Stable Registration Flow:
    • Resolved issues from v1.6.x for reliable multi-loader registration.

Migration Guide:

  1. Replace Registrar<T> with Register
  2. Use RegistryItem/RegistryBlock instead of lazy references
  3. Forge users: Switch to Fabric/NeoForge or stay on v1.6.x
1.21-2.1Релиз1.21 · 6 июня 2025 г.

Xunlib v2.1 Changelog

Registration System Overhaul

  • Renamed RegistrarRegister: Simplified naming for core registration API.
  • New Registry Paradigm:
    • Replaced lazy registry references with strongly-typed holders:
      • RegistryHolder: Base for all registry objects
      • RegistryItem: Specialized holder for items
      • RegistryBlock: Specialized holder for blocks
    • Benefits: Type safety, explicit lifecycle control, and loader-agnostic initialization.

Breaking Changes

  • Forge Support Removed:
    • Discontinued due to API incompatibilities with the finite registration system.
    • Still Supported: Fabric and NeoForge
  • Deprecated/Removed:
    • All lazy registry references (migrate to RegistryHolder subclasses).

Improvements

  • Stable Registration Flow:
    • Resolved issues from v1.6.x for reliable multi-loader registration.

Migration Guide:

  1. Replace Registrar<T> with Register
  2. Use RegistryItem/RegistryBlock instead of lazy references
  3. Forge users: Switch to Fabric/NeoForge or stay on v1.6.x

Комментарии

Загружаем…