Skip to content

fix: edge case in AiTickThrottler legacycleanup and added exclusion support#17

Open
Xytronix wants to merge 10 commits intoIroriPowered:masterfrom
Xytronix:ft-aithrottler-exlusion
Open

fix: edge case in AiTickThrottler legacycleanup and added exclusion support#17
Xytronix wants to merge 10 commits intoIroriPowered:masterfrom
Xytronix:ft-aithrottler-exlusion

Conversation

@Xytronix
Copy link
Contributor

@Xytronix Xytronix commented Mar 3, 2026

Summary

Separates cleanup and legacy cleanup and adds optiona exclusion support for specific, mountable and flying NPCs to the AITickThrottler.

The old cleanup system entangled normal cleanup and legacy cleanup in a single if/else branch gated behind CleanupFrozenEntities. This caused an edge case where LegacyCleanup=true with CleanupFrozenEntities=true would skip cleanup on entities that had the TickThrottled marker.

Related issues

User reported issues with NPCs not cleaning up

[2026/03/03 18:22:48 SEVERE] [SpawnMarkerBlockStateSystems] Creating new spawn marker due to desync with entity: Ref{store=class com.hypixel.hytale.component.Store@1440655386, index=58}
[2026/03/03 18:22:48 SEVERE] [SpawnMarkerBlockStateSystems] Creating new spawn marker due to desync with entity: Ref{store=class com.hypixel.hytale.component.Store@1440655386, index=275}

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)

Implementation details

AiTickThrottlerCleanupSystem — Cleanup and legacy cleanup are now two independent sequential code paths instead of an if/else:

  1. Normal cleanup: fires when CleanupFrozenEntities=true and entity has TickThrottled marker → removes all 3 components, then returns early
  2. Legacy cleanup: fires when LegacyCleanup=true and entity has orphaned Frozen/StepComponent without TickThrottled → removes those. No longer gated behind CleanupFrozenEntities.
  3. Fixed issue with SpawnMarkerBlockStateSystem, now not throttled by design.

Each path has its own independent NPC type exclusion list (CleanupExcludedNpcTypes, LegacyCleanupExcludedNpcTypes).

AiTickThrottlerService — Added exclusion checks using ECS components from the Hytale server:

  • ThrottleExcludedNpcTypes — NPC type IDs via NPCEntity.getNPCTypeId()
  • ThrottleExcludeMounts (default false) — skips entities with NPCMountComponent
  • ThrottleExcludeFlying (default false) — skips entities with MovementStatesComponent.getMovementStates().flying == true

Checklist

  • Code compiles successfully
  • Pull request does not contain unrelated changes
  • Changes follow this project's code style (Use spotlessApply when necessary)
  • Changes are tested or will be tested after submission.

@Xytronix Xytronix changed the title fix: edge case in legacycleanup and added exclusion support fix: edge case in AiTickThrottler legacycleanup and added exclusion support Mar 3, 2026
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.

1 participant