Provided performance optimizations for Mystical Agriculture.
| No. | Original | Change | Effect |
|---|---|---|---|
| 1 | Soul Extractor queries the recipe manager every tick, even with an empty input slot (full scan of 39 soul extraction recipes) | Returns null immediately when the input slot is empty | One full recipe scan and one CraftingInput allocation saved per idle machine per tick; scales with machine count |
| 2 | Infusion Altar scans its 8 pedestal positions and performs a recipe lookup every tick while it has an input; the client HUD does the same every frame | Returns null immediately when the input slot is empty | Empty altars cost nothing per tick on the server or per frame on the client |
| 3 | Awakening Altar scans its pedestal/vessel positions and performs a recipe lookup every tick while it has an input | Returns null immediately when the input slot is empty | Same as 2 |
| 4 | Infusion Altar rescans all 8 pedestal positions on every call; the client HUD calls it every frame | Reuses the pedestal list for the current game tick | 8 position lookups per frame become one per tick while pointing at an altar; no behavior change |
| 5 | Every mob death linearly scans all 23 mob soul types (registry key lookup + set contains per type) | Caches the EntityType → MobSoulType mapping; cleared on register/add/remove | 23 scans per death become one hash lookup in soul farms |
| 6 | Every XP orb pickup scans the whole inventory (36 slots + offhand) for an experience capsule | Scans once per player per tick and reuses the result within that tick | XP farms no longer rescan the inventory for every orb |
| 7 | Running machines broadcast their full BE NBT (Harvester: 16-slot inventory) to every player within 64 blocks every tick | Machines without a TESR sync only while a player has their GUI open; the Soulium Spawner syncs only when a player is within 64 blocks; other BEs unchanged | No packets or NBT serialization when nobody is watching; identical behavior while the GUI is open |