Skip to content

Optimize ChunkUID - #335

Open
OPmasterLEO wants to merge 3 commits into
xGinko:masterfrom
OPmasterLEO:master
Open

OPmasterLEO wants to merge 3 commits into
xGinko:masterfrom
OPmasterLEO:master

Conversation

@OPmasterLEO

Copy link
Copy Markdown

No description provided.

Copilot AI lite review requested due to automatic review settings September 20, 2026 12:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Critical chunk-key collisions and undercounted falling-block spawns can bypass enforcement.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 3 High severity

Open (3)
What changed in this PR

Optimizes chunk identity and refactors falling-block enforcement for Legacy and Folia.

Changes:

  • Adds compact chunk keys and optimized hashing.
  • Replaces expiring sets with timestamp-based cooldown maps.
  • Handles falling-block spawn and block-change events.
File Review
shared/​src/​main/​java/​me/​xginko/​aef/​utils/​models/​ChunkUID.java Critical: 64-bit UUID folding can cause chunk-key collisions across worlds.
AnarchyExploitFixesLegacy/​src/​main/​java/​me/​xginko/​aef/​modules/​chunklimits/​FallingBlockLimit.java Critical: spawn events can be undercounted, allowing an extra falling block.
AnarchyExploitFixesFolia/​src/​main/​java/​me/​xginko/​aef/​modules/​chunklimits/​FallingBlockLimit.java Critical: spawn events can be undercounted, allowing an extra falling block.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread shared/src/main/java/me/xginko/aef/utils/models/ChunkUID.java Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Address unbounded cooldown maps and enforce a configured zero falling-block limit.

Review effort: Lite
Findings: None

Resolved since last review (3)
Previously missed (2)

In code that hasn't changed since last review

Medium severity Cooldown map retains chunk keys indefinitely

AnarchyExploitFixesFolia/​src/​main/​java/​me/​xginko/​aef/​modules/​chunklimits/​FallingBlockLimit.java:81

This map now retains every chunk key forever: once a cooldown expires, the entry is only overwritten if that same chunk is checked again, and no cleanup removes keys for chunks that are never revisited. Replacing the former ExpiringSet with this unbounded map can grow with every chunk reached by falling-block activity; use an expiring Caffeine cache/ExpiringSet (or an explicit bounded cleanup strategy) so cooldown entries are evicted.

Medium severity Cooldown map retains chunk keys indefinitely

AnarchyExploitFixesLegacy/​src/​main/​java/​me/​xginko/​aef/​modules/​chunklimits/​FallingBlockLimit.java:81

This map now retains every chunk key forever: once a cooldown expires, the entry is only overwritten if that same chunk is checked again, and no cleanup removes keys for chunks that are never revisited. Replacing the former ExpiringSet with this unbounded map can grow with every chunk reached by falling-block activity; use an expiring Caffeine cache/ExpiringSet (or an explicit bounded cleanup strategy) so cooldown entries are evicted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants