promotional bannermobile promotional banner

AE2 KeyCounter Overflow Fix

Fixes an integer overflow issue in Applied Energistics 2's `VariantCounter` that can cause AE2 key counts to overflow when approaching the `long` limit.
Back to Files

ae2keycounteroverflowfix-1.21.1-1.0.0.jar

File nameae2keycounteroverflowfix-1.21.1-1.0.0.jar
Uploaded
Aug 7, 2026
Downloads
21
Size
3.5 KB
Mod Loaders
NeoForge
File ID
8598422
Type
R
Release
Supported game versions
  • 1.21.1

Curse Maven Snippet

NeoForge

implementation "curse.maven:ae2-keycounter-overflow-fix-1643789:8598422"

Learn more about Curse Maven

What's new

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.

*This is the Fisrt Release, so I write Description insteadof changelog

This mod has no additional files