From c91df4835b90cf755b68d73c15c165a1baa443e2 Mon Sep 17 00:00:00 2001 From: simon_34545 <70719312+Simon34545@users.noreply.github.com> Date: Tue, 3 May 2022 16:34:33 -0700 Subject: [PATCH] (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 --- Minecraft-Classic-map-generation-algorithm.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Minecraft-Classic-map-generation-algorithm.md b/Minecraft-Classic-map-generation-algorithm.md index fbff587..8144555 100644 --- a/Minecraft-Classic-map-generation-algorithm.md +++ b/Minecraft-Classic-map-generation-algorithm.md @@ -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".