149 lines
4.2 KiB
Markdown
149 lines
4.2 KiB
Markdown
# minecraft-kartverket
|
|
|
|
Mapping is my passionfruit!
|
|
|
|
## What is this?
|
|
|
|
This project is meant to let PVV members contribute map data for PVV's minecraft server, like coordinates for bases, cities, and other points of interest.
|
|
These markers are written in python so that we easily can do things like generating points in a loop, calculating distances, and other types of automation.
|
|
|
|
There is also a cli tool that we use to export these points into the formats of several popular minecraft map implementations.
|
|
|
|
## Marker sets
|
|
|
|
Here is an overview of the different marker sets, and what they are meant for.
|
|
|
|
- **Overworld**
|
|
- Area Names: larger areas with names
|
|
- Buildings: important buildings and world wonders.
|
|
- Cities: an area that consist of several bases and/or public infrastructure.
|
|
- Homes: single bases consisting of 1-3 people.
|
|
- Huts: small huts, meant for visitors and travelers.
|
|
- Infrastructure: public infrastructure, like bridges, ports, tunnels, etc.
|
|
- Mines: public mines
|
|
- Nature: similar to "Area Names", but specifically for mostly untouched nature-named areas.
|
|
- Other: anything that doesn't fit into the other categories
|
|
- Railways: railways
|
|
- Roads: roads
|
|
- Villages: villages generated by minecraft (as opposed to player made cities)
|
|
|
|
- **Nether**
|
|
- Ice Tracks: ice tracks meant for boats.
|
|
- Other: anything that doesn't fit into the other categories
|
|
- Portals: named portals that lead back to the overworld.
|
|
- Railways: railways
|
|
|
|
- **The End**
|
|
- Other: anything that doesn't fit into the other categories
|
|
- Portals: end portals that send you back to the center of the map
|
|
|
|
## How to add a point marker
|
|
|
|
1. Find the correct marker set directory in `src/minecraft_kartverket/marker_sets`.
|
|
2. Create a new file in this directory with the name of the marker and the extension `.py`.
|
|
Note that this needs to be underscored (no spaces or hyphens), and valid ascii.
|
|
e.g. `Min svære base` -> `min_svaere_base.py`
|
|
3. Add the marker to the file. You can use the following template or look at other markers for inspiration.
|
|
|
|
```python
|
|
from minecraft_kartverket.lib_marker import Point
|
|
|
|
MARKERS = [
|
|
Point(
|
|
name="Nyverdenhytta",
|
|
icon = None,
|
|
x = 848,
|
|
y = 70,
|
|
z = 1583,
|
|
),
|
|
]
|
|
```
|
|
|
|
4. Register the marker(s) to the marker set by editing the marker set's `__init__.py` file.
|
|
Add the following line to the file, replacing `<marker_name>` with the name of the marker file.
|
|
Notice that there needs to be a `*` before the marker name inside the `markers` list.
|
|
|
|
```python
|
|
...
|
|
|
|
from .<marker_name> import MARKERS as <marker_name>_markers
|
|
|
|
...
|
|
|
|
markers = [
|
|
...
|
|
*<marker_name>_markers,
|
|
]
|
|
```
|
|
|
|
5. Run the cli tool to verify that the marker has been added correctly.
|
|
|
|
```bash
|
|
uv run mckart verify
|
|
uv run mckart print
|
|
```
|
|
|
|
6. Open a PR
|
|
|
|
## How to add a railway / road
|
|
|
|
This is very similar to adding a point marker, but the content of the marker is different.
|
|
|
|
You can follow the previous guide, but for step 3, use this template or look at other markers for inspiration.
|
|
|
|
```python
|
|
from minecraft_kartverket.lib_marker import Track
|
|
|
|
MARKERS = [
|
|
Track(
|
|
name="Nordbanen",
|
|
icon = None,
|
|
points = [
|
|
(848, 70, 1583),
|
|
(920, 70, 1583),
|
|
(920, 70, 1200),
|
|
...
|
|
],
|
|
),
|
|
]
|
|
```
|
|
|
|
## How to add a new marker set
|
|
|
|
To add a new marker set, you need to:
|
|
|
|
1. Create a new directory alongside the other marker sets in `src/minecraft_kartverket/marker_sets/<world>`.
|
|
2. Create an `__init__.py` file in this directory with the following content:
|
|
|
|
```python
|
|
from minecraft_kartverket.lib_marker.marker_set import MarkerSet
|
|
|
|
MARKER_SET = MarkerSet(
|
|
name="My Marker Set",
|
|
markers=[
|
|
],
|
|
)
|
|
```
|
|
|
|
3. Add the marker set to the `MARKER_SETS` list in `src/minecraft_kartverket/marker_sets/<world>/__init__.py`.
|
|
|
|
```python
|
|
from .<marker_set_name> import MARKER_SET as <marker_set_name>_marker_set
|
|
|
|
MARKER_SETS = [
|
|
...
|
|
portals_marker_set,
|
|
]
|
|
```
|
|
|
|
See the other marker sets for inspiration.
|
|
|
|
## How to add icons
|
|
|
|
TODO: Write this section
|
|
|
|
## See also
|
|
|
|
- [BlueMap documentation for markers](https://bluemap.bluecolored.de/wiki/customization/Markers.html)
|
|
- [Mapcrafter documentation for markers](https://mapcrafter.readthedocs.io/en/latest/markers.html)
|