AgeingCheckCache

AgeingCheckCache

Cache the iteration results of Ageing Spawner codes for better performance

by
1.6K Downloads
forgeoptimization
Rent Server with this Mod

About this Mod

AgeingCheckCache

This is an addon of Ageing Spawner that optimizes its code by cache.

How Does It Work

I've noticed a point about List#contains (checking if a list contains a specific element). 
Many mod authors open up blacklists or whitelists in config files to achieve higher configurability. 
However, if the list contains too many elements (whether they are default configurations or user-added ones), iterating through List#contains calls can become quite expensive, affecting the game's performance in specific situations 
(Embeddium Extras significantly improved FPS after addressing this performance issue). The solution I've come up with is to transform it into checking the properties of the List#contains target, perform the check only once, and directly call the cached boolean value obtained from this initial check. 
This avoids repeatedly traversing the array. 
The initial check's location and method might vary depending on the properties of the check target. 
For example, if the check target is EntityType, you could create an ExtendedEntityType interface, implement it using a mixin with EntityType, and include a boolean value for "is included in the configuration file" within the mixin. 
Then, in certain places (such as FMLCommonSetupEvent), you can directly use the configuration file's array to check all EntityType instances using ForgeRegistries and mark whether they are included in the array. 
In practical applications, instead of using List#contains, you can use ((ExtendedEntityType)entityType).isInConfig() (check speed goes brrrrrrrrrr).

Why Don't You Send A Pull Request To Ageing Spawner?

1.I have created an issue for this (See here) but the author just did the basic caching in 1.20 version, while this mod is for 1.16.5

2.I'm lazy.

Btw you can do this by yourself as this mod is in public domain.

Will Ageing Spawner's Behavior Change After Using This Mod?

Yes.

Initially, Ageing Spawner will track all vanilla & modded spawners (like the Land Spawner in BrassAmber BattleTowers (In short, babt)). This mod has an additional patch that defaultly blacklists the modded spawners.

This improves compatibility with babt so your tower's advancement will not be completely blocked due to the spawners disappear :)

If you want a modded spawner block to be affected by Ageing Spawner, you can write the block's registry name down in config/ageingcheckcache-common.toml

Logo Credit

Thanks to reereeq!

Misc

Available Versions

AgeingCheckCache 1.16.5-0.0.2release
MC 1.16.5forge
December 6, 2023

How to Install AgeingCheckCache on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set forge Loader

In the panel under "Egg", select the forge loader and matching Minecraft version (1.16.5).

3

Install Mod

Open the mod browser in the dashboard and search for "AgeingCheckCache". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

forge

Minecraft Versions

1.16.5

Server-side

Required

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

AgeingCheckCache server crashes on startup – what to do?

Most common cause: wrong forge version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.16.5). You can switch loaders with one click in the panel.

Is AgeingCheckCache compatible with forge?

AgeingCheckCache officially supports forge for Minecraft 1.16.5. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with AgeingCheckCache – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if AgeingCheckCache consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install AgeingCheckCache with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
LicenseRef-The-Unlicense
Server-side
Required

Supported Versions

1.16.5