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

When chunk is loaded, block entities are added into manager one by one #1720

Open
MarcinSc opened this issue May 10, 2015 · 0 comments
Open
Labels
Topic: Architecture Requests, Issues and Changes related to software architecture, programming patterns, etc. Type: Bug Issues reporting and PRs fixing problems

Comments

@MarcinSc
Copy link
Contributor

MarcinSc commented May 10, 2015

When a chunk is loaded, I believe what is happening is (pseudo code):
for (EntityData entity : chunkEntityData) {
addEntityToBlockEntityRegistry(entity);
callOnActivatedEventsOnTheEntity(entity);
}

As a result, if the OnActivatedComponent event listener asks for another entity that is in that chunk, and has not been added to the BlockEntityRegistry yet, it will get a default entity from the block at that position, which might (and most likely will) have different values.

What should be happening instead (IMO) is:
for (EntityData entity : chunkEntityData) {
addEntityToBlockEntityRegistry(entity);
}
for (EntityData entity: chunkEntityData) {
callOnActivatedEventsOnTheEntity(entity);
}

So, the events should be called after all the block entities in that chunk have been added to the registry.

@MarcinSc MarcinSc added Type: Bug Issues reporting and PRs fixing problems Topic: Architecture Requests, Issues and Changes related to software architecture, programming patterns, etc. labels May 10, 2015
@skaldarnar skaldarnar removed the Api label May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: Architecture Requests, Issues and Changes related to software architecture, programming patterns, etc. Type: Bug Issues reporting and PRs fixing problems
Projects
None yet
Development

No branches or pull requests

2 participants