Virtuoel / Pehkui

Fabric/Forge/NeoForge/Quilt mod that allows for changing the size of any entity.
MIT License
87 stars 33 forks source link

[Suggestion]: ScaleCacheUtil#CACHE - Use an Enum instead of a normal class and index by its ordinal #522

Open ByThePowerOfScience opened 2 weeks ago

ByThePowerOfScience commented 2 weeks ago

What is your suggestion?

The ArrayMap implementation in this class is very costly when run so many times, and is contributing a not-insignificant amount of time to the server. Since the caching order is determined at compile-time, consider using an enum or a trimmed Reference2IntMap to store the index of that scale type?