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

add relevance check to avoid creating additional entity #27

Merged
merged 5 commits into from
Oct 21, 2020

Conversation

pollend
Copy link
Member

@pollend pollend commented Oct 4, 2020

some slight optimization for dummy entity for loading chunks. creating these RelevanceRegion Entities seems to be add a usability problem to writing test cases.

pollend added a commit to Terasology/SimpleFarming that referenced this pull request Oct 5, 2020
Copy link
Contributor

@skaldarnar skaldarnar left a comment

Choose a reason for hiding this comment

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

Looks good to me - I'd like to see some JavaDoc for the EmptyWorldGenerator, but this could also be done in a follow-up PR.

If you could just throw together a few words on how to use it that would be great!

Comment on lines +252 to +254
if (worldProvider.isBlockRelevant(blockPos)) {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Totally makes sense! 👍

import java.util.List;

@RegisterWorldGenerator(id = "empty", displayName = "empty")
public class EmptyWorldGenerator extends BaseFacetedWorldGenerator {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this supposed to be used for? Could we add a little bit of JavaDoc explaining the intended use case?

@skaldarnar
Copy link
Contributor

I can reproduce the failing tests locally, although it needed two runs for both to show up 🙄

  • ExampleTest.testExample()
  • WorldProviderTest.defaultWorldSetBlockTest()

As the associated error messages state that the actual state was unloaded I suspect this is in fact related to this PR… I did not double check this assumption, though.

org.opentest4j.AssertionFailedError: expected: <engine:air> but was: <engine:unloaded>

@jdrueckert jdrueckert merged commit a17b936 into develop Oct 21, 2020
@jdrueckert jdrueckert deleted the feature/optimize-test branch October 21, 2020 07:29
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.

3 participants