Xunlib v2.1.4 Changelog
Additions
- Set Identification:
- Added
getName()
method toToolSet
andArmorSet
- Returns base material name (e.g.
ruby
for "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
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)
- Changed
- Registry Utilities:
- Restored static
Registries
map in common utils class to resolvegetKey()
/getRegistryId()
problem
- Restored static
Features
- Custom Smithing Templates:
- Added
UpgradeSmithingTemplateItem
with extracted Netherite upgrade logic from vanilla - Customize icons, description text, and material requirements.
- Added
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.
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
RegistryHolder
subclasses).
- 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
/RegistryBlock
instead of lazy references - Forge users: Switch to Fabric/NeoForge or stay on v1.6.x
Xunlib v1.5.1 Changelog (Hotfix)
Fixes
- Critical Registry Errors:
- Fixed
ArmorSet
andToolSet
classes instantiating item instances too late, causing:- Forge/NeoForge:
Registry is already frozen
errors. - Fabric:
This registry can't create intrusive holders
crashes.
- Forge/NeoForge:
- Solution: Delayed item initialization to avoid unsafe registry access during class loading.
- Fixed
Features
- AABB Utilities: Added to
BlockPosUtils
for axis-aligned bounding box operations:createAABBFromCenter(BlockPos center, double xRadius, double yRadius, double zRadius)
expandAABB(AABB original, double x, double y, double z)
getUnionAABB(AABB a, AABB b)
isAABBWithinBlock(AABB box, BlockPos pos)
Upgrade Immediately if you use ArmorSet
/ToolSet
to resolve registry crashes. The new AABB utilities simplify collision detection and spatial queries.
Xunlib v1.5 Changelog
Features
- New Effect Stacking Strategy: Added
Prevent Stacking
option to the effect stacking strategy enum. - Mob Effect Instance Builder: Create and customize mob effect instances with a fluent builder API.
- Tickable Block Entities:
- Added
ITickableBlockEntity
interface for dynamic block entity updates. - Introduced
Ticking Entity Block
base class for simplified ticking logic.
- Added
- Tool and Armor Sets:
ToolSet
builder for defining tool collections (sword, axe, pickaxe, hoe, shovel).ArmorSet
builder for armor sets (helmet, chestplate, leggings, boots).
Breaking Changes
- Package Reorganizations:
- Moved
@PersistentNbt
annotation from.nbt
to.annotations
package. - Relocated all exceptions to the new
.exceptions
package.
- Moved
- Renamed Classes:
InventorySection
→PlayerInventorySection
.EffectUtils
→MobEffectUtils
(aligns with utility focus).
- Removed Fuzzy Config Options:
- Removed
ALL
filter mode from fuzzy item matching configurations.
- Removed
Upgrade Notes:
- Update imports for
@PersistentNbt
, exceptions, and renamed classes (PlayerInventorySection
,MobEffectUtils
). - Replace
ALL
filter mode in fuzzy configs with alternative strategies.
Xunlib v1.4 Changelog
Features
- Added
@PersistentNbt
annotation: Automatically serialize/deserialize block entity data to from NBT. Â
 Simplify data persistence by annotating fields in your block entity classes. - Custom NBT Adapters: Implement the
INbtAdapter
interface to define custom serialization/deserialization logic. Â
 Override default NBT handling for advanced use cases.
Breaking Changes
- Moved
setModId
method: Relocated fromCommonUtils
to theModSetup
class. Â
 Update your mod initialization code to callModSetup.setModId(...)
instead. - Renamed inventory methods: Â
 -addItems(...)
→insertItems(...)
Â
 -removeItems(...)
→extractItems(...)
Â
 Refactor existing code to use the new method names.
Improvements
- Enhanced Fuzzy Matching System: Â
 Added whitelist/blacklist support for custom predicates. Â
 Define inclusion/exclusion rules for item matching with greater flexibility.
Upgrade Note: If you rely on the old addItems
or removeItems
methods or setModId
in CommoUtils
, update your code to avoid runtime errors. Check the documentation for migration examples.