AE2 KeyCounter Overflow Fix
Modby takenokoshi_023
Fixes an integer overflow issue in Applied Energistics 2's `VariantCounter` that can cause AE2 key counts to overflow when approaching the `long` limit.
Description
AE2 KeyCounter Overflow Fix
AE2's VariantCounter uses a long to store the amount of each AEKey. When the stored amount approaches the maximum value of a long, adding more items can cause an integer overflow, resulting in an incorrect (potentially negative) amount.
This mod fixes this issue by preventing VariantCounter from exceeding the valid range of a Java long.
When an addition would cause an overflow, the amount is automatically clamped to the maximum or minimum representable value instead.
This mod is intended as a lightweight compatibility and bug-fix mod. It does not add any new gameplay features or content.
Recommended Gear
AffiliateHardware and extras that pair well with this mod.
As an Amazon Associate I earn from qualifying purchases.
Similar Mods
Xenorite
Adding New Blocks & Items With A Good/Bad Effects!
.2doors.jar
adds the 2 doors series from LookOut3D's to your world
FPV Drones
Adds flyable FPV Drones with in-depth signal & battery mechanics -explosive mosquito simulator
Peaks
Exposed large ore veins, designed with quarries in mind.
Simple Enemy
An Addon that works with TaCZ and adds NPCs to the game equipped with weapons from the latter mod, with the goal of bala...
Vanilla Progression Chaos Cubed Edition
A vanilla-style progression mod that locks advancement behind quests, auto-tracks objectives, rewards XP by difficulty,...