favorite-place/readme.md

2.2 KiB

Favorite Place

Simple Minecraft Server that generates terrain based on simple mathematical equations.

Imagine your favorite place. For me, it is a meadow with grass and some wild flowers, and it is on a hill that can defined by a mathematical equation.

Running

Cloning

git clone https://purplecello.serveminecraft.net/git/KylerOlsen/favorite-place.git

Dependencies

  • Python 3
    • It is recommended to use the pypy distribution of python for increased speed and performance.
  • Python bitstring 3.1.9
    • Anything newer is incompatible with quarry.
  • Python quarry
  • Python requests (Optional)
    • Used to download the Minecraft 1.18.2 Java Server jar for the data generator.
  • Java 17+ (Optional)
    • Used to run the data generator from the Minecraft 1.18.2 Java Server jar.

Data Reports

The data reports are used by the server to encode game data correctly for the client to receive it.

The reports from the data generator must be in generate_data\generated\reports. If the optional dependencies are installed and the generate_data directory does not exists, the sever will download the jar and run the data generator.

Running

In the root directory of the repository run:

python3 server/main.py

Customizing

A way to change the equation may be implemented in the future, but currently it is hard coded.

You can change the function YTDServerFactory.func(x: int, y: int, z: int) in server/main.py to implement your own equation. This function accepts the world coordinates and returns a dictionary representing the block at that location.

Here are examples of block representations accepted by quarry. These definitions are from the top of server/main.py.

BLOCK_EMPTY = {'name': 'minecraft:air'}
BLOCK_SURFACE = {'name': 'minecraft:grass_block', 'snowy': 'false'}
BLOCK_SUBSURFACE = {'name': 'minecraft:dirt'}
BLOCK_UNDERGROUND = {'name': 'minecraft:stone'}
BLOCK_DEFAULT = {'name': 'minecraft:cobblestone'}

Information about blocks and block states can be found in generate_data\generated\reports\blocks.json if the data generator has been ran. You can also find this information online from the Minecraft Wiki.