Flat Fixer is a program that repairs an area of a world on which structures have been built and perhaps the grass and dirt have been destroyed.
The Flat Fixer code is explained more thoroughly in the video. The first code segment in Flat Fixer, checks the on-chat argument values to verify they are in the correct range. If not, they are set to default values. The variable origin is set to be the initial player world position, but just above were the grass would normally be in a flat world.
Air is repaired one Y value at a time in a for loop, one pass through the loop for each Y value. A loop is used instead of varying Y in a fill, because repairs may be needed to high in the sky, say 100 blocks, causing fill block limits to be exceeded.
Two layers of dirt are restored above the bedrock at Y = 1 and Y = 2. The grass is restored at Y = 3.
Flat Fixer is a companion program to Bang. Using the two programs, Bang can make a mess and Flat Fixer can clean it up again and again and …
Get the Code
The code is shared at https://makecode.com/_LC4dzUPe4bYg where it can be downloaded and run in MakeCode for Minecraft.
Flat Fixer code is shared on Code Connection at this URL
To get and use the code, follow these steps.
Click the Import button , which is upper right in the Code Connection window just below the banner. This will open the window shown below.
Click the Import URL button , which is on the right, to open the window shown below.
Paste the URL supplied for the program you want to use in the space under the text “Copy the URL …”
Click the Go ahead! button .
The next window you will see will be the MakeCode window with the code downloaded from the URL. At this point, you can treat it like any other code, e.g., run it, save it locally, modify it, publish your changes or whatever else your heat desires.
We have tested several other methods of downloading the code using the URL, for example, pasting the URL in a browser. No joy. For more detailed instruction see our post How to Use Shared MakeCode on Microsoft Code Connection for Minecraft.