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

Implement NOVA-Worldgen #1

Closed
wants to merge 17 commits into from
Closed

Conversation

ExE-Boss
Copy link
Member

@ExE-Boss ExE-Boss commented Jan 2, 2017

This PR contains my implementation of NOVA-Worldgen wrappers and WorldManager.
Depends on NOVA-Team/NOVA-Monorepo#229, NOVA-Team/NOVA-Monorepo#231 and NOVA-Team/NOVA-Monorepo#232.

To do list:

  • Implement WorldInfo (Leave that for another PR)

Completed:

  • WorldgenManager dependency injection

// DEEPERER = 20 (15-25)
// REALLYDEEP = 10 (5-15)

if (ore.oreLayers.allows(OreHeight.SURFACE))

Choose a reason for hiding this comment

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

No. That's a loop.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed now

oreHeightMap.put(j++, OreHeight.REALLYDEEP);
Iterator<OreHeight> iterator = Arrays.stream(OreHeight.values()).filter(ore.oreLayers::allows).iterator();

for (OreHeight height = iterator.next(); iterator.hasNext();) {
Copy link

@RX14 RX14 Jan 3, 2017

Choose a reason for hiding this comment

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

.forEach on the stream?

Copy link
Member Author

@ExE-Boss ExE-Boss Jan 3, 2017

Choose a reason for hiding this comment

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

Fixed now.
The main reason I did it that way initially, is because I made use of the local variable j, which must be final or effectively final to be used in lambda expressions.

Reason: Consistency with already implemented wrappers
Reason: Worldgen is not just ores.
Additional changes: OreGenerationRegistry was replaced with
Registry<Ore>, as it was redundant.
@ExE-Boss
Copy link
Member Author

Split into #2 and #3

@ExE-Boss ExE-Boss closed this Jan 14, 2017
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