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.

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.

The AE2 KeyCounter Overflow Fix Team

profile avatar
  • 6
    Followers
  • 15
    Projects
  • 63.7K
    Downloads

More from takenokoshi_023View all