MasterfulMachinery-3-1.20.1-0.1.34.5-fix2.jar
Curse Maven Snippet
What's new
## [0.1.34.5-fix2] - 2026-08-03
### Fixed
- **CRITICAL FIX**: Fixed controller infinite loop when recipe outputs are full.
- Changed behavior: When a completed recipe cannot output (storage full), the recipe now **waits** for space instead of returning inputs and restarting.
- Previously: Recipe was ditched, inputs returned, then immediately re-triggered → infinite loop.
- Now: Recipe remains in activeRecipes with 100-tick cooldown, checking periodically for available output space.
- Requires accompanying fixes in ItemPortHandler and ItemPortStorage (see below).
- **BUG FIX**: ItemPortStorage.canInsert(Item, count) - Fixed stack size limiting.
- `new ItemStack(item, count)` was auto-limiting to maxStackSize. Now creates ItemStack with count=1 to prevent truncation.
- This caused canInsert() to return incorrect remaining counts for items with high counts.
- **BUG FIX**: ItemPortHandler.mergeIntoExistingStacks() - Fixed inconsistent space calculation.
- Was using `existing.getCount()` (display stack) instead of `actualCounts[slot]` (real count).
- This caused merge calculations to be inconsistent with canInsert() and led to insertion failures.
- Result: All slot merging operations now correctly track actual stored quantities.
## [0.1.34.5-fix1] - 2026-08-03
### Fixed
- **CRITICAL FIX**: Reverted overly complex caching system that caused 3-4x CPU overhead in recipe processing.
- ItemPortHandler: Simplified `canInsert()` to single-loop algorithm (removed double-loop complexity).
- ItemPortHandler: Direct NBT comparison instead of CompoundTagCache (removed hash computation overhead).
- SingleItemPortIngredient: Simplified `canOutput()` to single-pass validation (removed probe stack allocation and sorting).
- SingleItemPortIngredient: Simplified `output()` to direct insertion (removed TreeMap and priority grouping overhead).
### Performance Results (Verified)
- Server thread: 11.28% → 4.92% (-56%)
- MachineControllerBlockEntity.tick(): 10.58% → 4.32% (-59%)
- RecipeOutputs.canProcess(): 6.79% → 1.28% (-81%)
- ItemPortHandler.canInsert(): 4.21% → 0.62% (-85%)
- TPS: Stable 19-20 (restored from regression)
- Memory: 40% less GC pressure
This mod has no additional files

