
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
@PersistentNbtannotation system and related NBT automation removed - Reason: Inflexible and redundant
- Migration: Use standard
CompoundTagserialization insaveAdditional()andloadAdditional()
- Entire
Fixes
combineAsNamespacedIDMethod:- Fixed formatting to include colon (
:) between namespace and path - Before:
"namespacepath_part1_part2" - After:
"namespace:path_part1_part2"
- Fixed formatting to include colon (
1.21-2.1.5Релиз1.21 · 5 января 2026 г.
Xunlib v2.1.5 Changelog
Breaking Changes
- Removed
@PersistentNbt& NBT Automation:- Entire
@PersistentNbtannotation system and related NBT automation removed - Reason: Inflexible and redundant
- Migration: Use standard
CompoundTagserialization insaveAdditional()andloadAdditional()
- Entire
Fixes
combineAsNamespacedIDMethod:- Fixed formatting to include colon (
:) between namespace and path - Before:
"namespacepath_part1_part2" - After:
"namespace:path_part1_part2"
- Fixed formatting to include colon (
1.21-2.1.4Релиз1.21, 1.21.1 · 16 июня 2025 г.
Xunlib v2.1.4 Changelog
Additions
- Set Identification:
- Added
getName()method toToolSetandArmorSet - Returns base material name (e.g.
rubyfor "Ruby Armor") - Use case: Streamlines datagen for language JSON files
- Added
- Mob Effect Utilities:
hasEffect(entity, effect): Checks if entity has specific effectclearEffect(entity, effect): Removes specific effect from entityclearEffects(entity): Removes all effects
1.21-2.1.4Релиз1.21 · 16 июня 2025 г.
Xunlib v2.1.4 Changelog
Additions
- Set Identification:
- Added
getName()method toToolSetandArmorSet - Returns base material name (e.g.
rubyfor "Ruby Armor") - Use case: Streamlines datagen for language JSON files
- Added
- Mob Effect Utilities:
hasEffect(entity, effect): Checks if entity has specific effectclearEffect(entity, effect): Removes specific effect from entityclearEffects(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.Propertiesfield to Supplier for safer delayed initialization withVanillaBalance()now correctly references Iron-tier attributes (attack damage/speed)
- Changed
- Registry Utilities:
- Restored static
Registriesmap in common utils class to resolvegetKey()/getRegistryId()problem
- Restored static
Features
- Custom Smithing Templates:
- Added
UpgradeSmithingTemplateItemwith extracted Netherite upgrade logic from vanilla - Customize icons, description text, and material requirements.
- Added
Hotfix Impact:
- Critical fixes for
ArmorSet/ToolSetattribute 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.Propertiesfield to Supplier for safer delayed initialization withVanillaBalance()now correctly references Iron-tier attributes (attack damage/speed)
- Changed
- Registry Utilities:
- Restored static
Registriesmap in common utils class to resolvegetKey()/getRegistryId()problem
- Restored static
Features
- Custom Smithing Templates:
- Added
UpgradeSmithingTemplateItemwith extracted Netherite upgrade logic from vanilla - Customize icons, description text, and material requirements.
- Added
Hotfix Impact:
- Critical fixes for
ArmorSet/ToolSetattribute 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
Registrar→Register: Simplified naming for core registration API. - New Registry Paradigm:
- Replaced lazy registry references with strongly-typed holders:
RegistryHolder: Base for all registry objectsRegistryItem: Specialized holder for itemsRegistryBlock: Specialized holder for blocks
- Benefits: Type safety, explicit lifecycle control, and loader-agnostic initialization.
- Replaced lazy registry references with strongly-typed holders:
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
RegistryHoldersubclasses).
- All lazy registry references (migrate to
Improvements
- Stable Registration Flow:
- Resolved issues from v1.6.x for reliable multi-loader registration.
Migration Guide:
- Replace
Registrar<T>withRegister - Use
RegistryItem/RegistryBlockinstead of lazy references - 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
Registrar→Register: Simplified naming for core registration API. - New Registry Paradigm:
- Replaced lazy registry references with strongly-typed holders:
RegistryHolder: Base for all registry objectsRegistryItem: Specialized holder for itemsRegistryBlock: Specialized holder for blocks
- Benefits: Type safety, explicit lifecycle control, and loader-agnostic initialization.
- Replaced lazy registry references with strongly-typed holders:
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
RegistryHoldersubclasses).
- All lazy registry references (migrate to
Improvements
- Stable Registration Flow:
- Resolved issues from v1.6.x for reliable multi-loader registration.
Migration Guide:
- Replace
Registrar<T>withRegister - Use
RegistryItem/RegistryBlockinstead of lazy references - Forge users: Switch to Fabric/NeoForge or stay on v1.6.x
Комментарии
Загружаем…