mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-12 09:06:55 -04:00
(see previous revision, I forgot to add these changes) Trees will only generate if the block directly under the trunk is a grass block, and it replaces that grass block with a dirt block when done
parent
8df13da10e
commit
c91df4835b
@ -322,7 +322,7 @@ Repeat 20 times {
|
||||
}
|
||||
```
|
||||
|
||||
Where **isSpaceForTree()** is a method which checks for an empty region of AIR blocks treeHeight high and with a width and depth of 3 by 3 for the trunk and 5 by 5 for the canopy (the last 3 layers). This position is centered on the given position x,z coordinates and upwards from the y coordinate.
|
||||
Where **isSpaceForTree()** is a method which checks for an empty region of AIR blocks treeHeight high and with a width and depth of 3 by 3 for the trunk and 5 by 5 for the canopy (the last 3 layers). This position is centered on the given position x,z coordinates and upwards from the y coordinate. It also checks if the block directly below the trees position is a grass block.
|
||||
|
||||
If such a space is found then isSpaceForTree() returns true, otherwise false.
|
||||
|
||||
@ -342,6 +342,8 @@ O tree trunk
|
||||
% contains leaves 50% of the time
|
||||
```
|
||||
|
||||
After this, it creates the rest of the trunk and sets the block below the trunk to dirt.
|
||||
|
||||
# Final adjustments to returned object
|
||||
|
||||
Once map generation is complete the resulting block array is put into a new Minecraft Level object along with the width, height, depth and water level. The level create time is set to system clock time in milliseconds, the level creator to creator's name and the level name set to the place-holder text "A Nice World".
|
||||
|
Loading…
x
Reference in New Issue
Block a user