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

NukkitX standard generator #1303

Merged
merged 147 commits into from
Apr 19, 2020
Merged

NukkitX standard generator #1303

merged 147 commits into from
Apr 19, 2020

Conversation

DaMatrix
Copy link
Member

(Continuation of #1221)

This PR intends to provide a highly extensible and customizable terrain generator. The goal is to have most aspects of generation be controlled by configuration files. A variety of basic decorators and populators will be provided by default, and plugins will have the ability to register their own. In addition, full configuration presets for simple overworld, nether and end worlds will be provided.

Structure generation will be a huge project beyond the scope of this PR and will be implemented separately. However, some boilerplate code for structures may make its way in.

Breaking changes:

  • All code in cn.nukkit.level.generator.* and cn.nukkit.level.biome.* has completely changed or been deleted
  • NukkitRandom has been removed
  • All overloads of NukkitMath#randomRange have been removed

temp commit because i have to go and will need to access from home when i get there
customization will come later
generation actually works now, as does the demo superflat generator!

also added a void generator for empty worlds.
…needed `NukkitRandom` allocations by using `ThreadLocalRandom`
…write

# Conflicts:
#	src/main/java/cn/nukkit/Server.java
#	src/main/java/cn/nukkit/level/generator/NormalGenerator.java
#	src/main/java/cn/nukkit/level/generator/SimpleChunkManager.java
#	src/main/java/cn/nukkit/level/manager/LevelChunkManager.java
this is probably the same bug that's been causing cut off trees in nukkit and pmmp for years
…write

# Conflicts:
#	src/main/java/cn/nukkit/Server.java
#	src/main/java/cn/nukkit/level/LevelBuilder.java
#	src/main/java/cn/nukkit/level/LevelData.java
#	src/main/java/cn/nukkit/level/generator/FlatGenerator.java
#	src/main/java/cn/nukkit/level/generator/Generator.java
#	src/main/java/cn/nukkit/level/generator/GeneratorFactory.java
#	src/main/java/cn/nukkit/level/generator/NetherGenerator.java
#	src/main/java/cn/nukkit/level/generator/NormalGenerator.java
…write

# Conflicts:
#	src/main/java/cn/nukkit/level/generator/FlatGenerator.java
…write

# Conflicts:
#	src/main/java/cn/nukkit/level/chunk/Chunk.java
#	src/main/java/cn/nukkit/level/generator/PopChunkManager.java
#	src/main/java/cn/nukkit/level/generator/function/ChunkGenerateFunction.java
#	src/main/java/cn/nukkit/level/generator/function/ChunkPopulateFunction.java
…nerator

# Conflicts:
#	src/main/java/cn/nukkit/registry/GeneratorRegistry.java
…write

# Conflicts:
#	src/main/java/cn/nukkit/utils/Identifier.java
…-generator

# Conflicts:
#	src/main/java/cn/nukkit/level/generator/populator/impl/PopulatorLava.java
@DaMatrix DaMatrix marked this pull request as ready for review April 18, 2020 15:21
@DaMatrix
Copy link
Member Author

i think this is just about ready to go, feel free to test it yourself and point out any bugs

@ghost
Copy link

ghost commented Apr 19, 2020

Bug: If setworldspawn is not setted, you are teleported to 0,64,0 (i think) and that can be on water. Maybe you can do you can be respawned upside water not in water?

@ghost
Copy link

ghost commented Apr 19, 2020

Bug: In plains biomes we have grass on water, it's that ok?
image

@DaMatrix
Copy link
Member Author

Bug: If setworldspawn is not setted, you are teleported to 0,64,0 (i think) and that can be on water. Maybe you can do you can be respawned upside water not in water?

that isn't an issue with the generator, but rather nukkit's spawn point generation code.

Bug: In plains biomes we have grass on water, it's that ok?

fixed in dc8209c

…-generator

# Conflicts:
#	src/main/java/cn/nukkit/player/Player.java
@ghost
Copy link

ghost commented Apr 19, 2020

Tested, all works ok. I think can be merged.

@DaMatrix
Copy link
Member Author

the only bug i'm aware of at the moment is that lakes that generate over a population border can sometimes end up with trees floating over them when the neighbouring chunk is populated, which i plan on solving by re-implementing lakes as structures applied during initial generation later.

@CloudburstMC CloudburstMC deleted a comment Apr 19, 2020
@SupremeMortal SupremeMortal merged commit 7747a0e into 2.0 Apr 19, 2020
@DaMatrix DaMatrix deleted the dev/nukkitx-standard-generator branch April 19, 2020 15:07
@elmatonrn
Copy link

a mi me tira para bajo de la roca madre como la primera vez que lo lo iniciar teletransporte abajo de esta y caía al vacío incluso el setblocks no funciona.it me saca de la roca como la primera vez que empecé me teletransporto hacia abajo y cayó en el vacío incluso los bloques de set no funcionan
it pulls me down from the bedrock like the first time I started it I teleport down from it and it fell into the void even the setblocks don't work

LoboMetalurgico added a commit to FlamingKnight/Nukkit that referenced this pull request Jul 3, 2022
…g-bug

Fix nametag being applied on adventure mode (CloudburstMC#1298)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants