Custom projectiles on Flywheel, and 1.21's operation names
This is Apoli 1.104.0 and Origins 1.46.9. Origins has no changes of its own this time, and is built against the new Apoli.
Custom projectiles on Flywheel
With Flywheel installed, the projectiles that apoli:fire_projectile fires are now drawn with instancing, the same way Vanillin draws minecarts and chests. Each model is built once and shared, and the GPU draws every projectile that uses it in one go instead of one at a time.
They look the same as before. A custom_model_render geometry model keeps its render type, colour, scale, body parts and animations. A flat texture_location sprite still turns to face you. A held_item projectile shows its item as long as Vanillin 1.1.3 or newer is installed to build the item model, and without it, that one projectile draws the vanilla way.
With 400 model projectiles in view, frame rates were about three times higher:
| Loader | Without Flywheel | With Flywheel |
|---|---|---|
| NeoForge 1.21.1 | About 700 FPS | About 2,150 FPS |
| Fabric 1.21.1 | About 770 FPS | About 2,070 FPS |
| Fabric 1.20.1 | About 610 FPS | About 1,900 FPS |
With only a few projectiles in view there's little to gain. The powers that fire volleys and barrages benefit most.
Flywheel can't draw everything, so a projectile goes back to the vanilla renderer while it uses the energy_swirl render type, while it's on fire, while its name tag shows and while hitboxes are on. Everything that already hands entities back to the vanilla renderer covers projectiles too, so apoli:prevent_entity_render still hides them and glowing still outlines them. If Flywheel ever fails while drawing one, Apoli logs it once and draws projectiles the vanilla way for the rest of the session. The performance mods page has the details.
1.21's operation names
Vanilla 1.21 renamed the attribute modifier operations: addition became add_value, multiply_base became add_multiplied_base, and multiply_total became add_multiplied_total. Apoli already took the 1.20 names and the upper case 1.21 ones, but a lower case add_value failed with Unknown attribute modifier operation. All three spellings now work anywhere an attribute modifier operation goes, on every version.
That page also had two mistakes of its own. It gave multiply_total_additive as Total * (Total * Modifier) when it has always been Total + (Total * Modifier), and it left out add_total_early and add_total_late. Both are fixed.