Fixes
- Populated
FleaPriceRoubles, HandbookPriceRoubles, HandbookParentId field mappings during NewItem object initialization (#9)
- Fixed validation logic defects for
HandbookParentId in CreateItemFromClone and CreateNewItem, removed incorrect required checks (#10, #11, #12)
- Fixed redundant parameter issue in
AddItemToAssort method calls
Refactoring & Optimization
- Removed legacy
AbstractNewItem abstract base class and its subclasses (NewItemCommon, NewItemAmmo, NewItemDrinkOrFood, NewItemMedical)
- Unified
NewItem architecture: All item types now share the NewItem class, with property application determined by the assigned AbstractInfo instance
- Marked
AmmoInfo class as [Obsolete], planned for refactoring in a future version
- Marked
BaseInfo.IsHadInit property as [Obsolete], to be removed after version 0.2.0
- Added
NewItemExtensions extension class, implementing ToStringWithStatus() and ToIdNameString() methods for unified log formatting output
- Removed unused dependency injections (
ISptLogger, DatabaseService) from DataLoader constructor
- Added
[UsedImplicitly] attribute to INewItem.PropertyOverride property to eliminate warnings
Data Format Changes
- Removed the
$type field from item templates (backward compatible reading retained)
- Type mechanism clarification: Item properties are determined by the actually assigned
Info fields, independent of baseInfo.type
- Data files now support JSONC comments (single-line
// and multi-line /* */), added StripJsoncComments method to DataLoader with state machine parsing logic
New Features
- Support for Chinese rarity keys (Common, Rare, Super Rare, Nonexistent)
- Support for Chinese item sound keys
- Support for ammunition type item validation
Configuration Updates
- Added
cacheInitialized configuration option to control cache initialization skipping and state persistence
- Added
alwaysUpdateCache configuration option to force cache updates
- Added
requiredItemIds configuration option to validate existence and enabled status of required items
- See Mod Configuration documentation for details
Validation System
- Built a unified validator system, implementing
IValidator interface and chaining calls
- Added
BaseInfoValidator: validates required fields, MongoId format, type validity
- Added
AttributeInfoValidator: validates positive integer dimensions, rarity, sound type
- Added
BuffsInfoValidator: validates Buff effect configurations
- Added
MedicalInfoValidator, DrinkFoodInfoValidator, AmmoInfoValidator: respectively validate medical, food/drink, and ammunition configuration logic
- Removed invalid negative weight validation logic
- Enhanced error collector to carry item path information for easier problem localization
Architecture Optimization
- Changed
UpdateProperties and UpdateDatabaseService methods to protected, restricting external calls
- Enhanced null validation logic for
BaseInfo and BuffsInfo
- Improved deserialization error logging, added complete exception stack traces