Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Entity tracking state is incorrectly updated on chunk status upgrades #87

Open
Owen1212055 opened this issue Dec 29, 2024 · 0 comments
Labels
bug Something isn't working needs-triage

Comments

@Owen1212055
Copy link

Owen1212055 commented Dec 29, 2024

Minecraft Version

1.21.4

Moonrise Version

0973595

Mod Loader

Both (NeoForge and Fabric)

Logs and Crash Reports

N/A

Additional Context

This was initially reported on Paper, but is replicatable on Fabric with Moonrise installed as well.
When chunk statuses are upgraded, entity tracking methods are incorrectly called multiple times.

This occurs when spawning into a chunk with an Allay already existing:

(Paper logs- what I had easily availiable)
https://pastes.dev/jAhalfZrJE
tracking start -> tracking end -> tracking start

(Vanilla)
https://pastes.dev/nf7zpAdu0r
tracking start

Paper Issue: PaperMC/Paper#11751

This behavior causes small breaks, for example, DynamicGameEventListener does not expect tracking start to be called in this nature.
Vanilla stores the lastSection for which dynamic game event listeners were registered into. When the entity is first spawned, it registers the listeners, but when it's (incorrectly) untracked it unregisters them. However, when the entity is retracked lastSection is already set, so game event listeners do not get re-registered when the entity is added.

A "bandaid" fix is to set lastSection = null on DynamicGameEventListener#remove. But again, this is fundamentally a behavior change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant