Visualize minecraft player coordinates generated from the coordinates cmap-paper sent using Leaflet.js for rendering the image tiles on the website. This is similar to 2b2t Nocom heatmap, but with each coordinate represented as a dot and not being a heatmap.
realtimeChunkImage.py main script.
app.js backend of the page.
Example map taken from here
This repository has 2 main folders:
- cmap_minecraft: Source code for the cmap plugin. See the repository.
- cmap_scripts: Cmap related python scripts.
Generates blank white images. Each zoom_level the quality of the image doesnt increase, the number of tiles does.
py realtimeChunkImage.py init [<type=OVERWORLD | nether | end> <zoom_level=1>]
Updates the image with the coordinates. The coordinates are black pixels on the image.
py realtimeChunkImage.py update [<type=OVERWORLD | nether | end>]\n
Update the entire overworld, nether, end tiles in realtime (approx. 11-13s each operation)
py realtimeChunkImage.py realtime
| Command | Operation |
|---|---|
| py realtimeChunkImage.py init | initialize blank white tiles (overworld) |
| py realtimeChunkImage.py init end | specify the tiles to make |
| py realtimeChunkImage.py init end 2 | make tiles for end with 2 zoom level (for leaflet) |
| py realtimeChunkImage.py update | update the image with the coords from the coordinate files (overworld, along the zoom levels) |
| py realtimeChunkImage.py update nether | update the nether tiles only |
| py realtimeChunkImage.py realtime | update the entire overworld, nether, end tiles in realtime |
Note: You must have Git, Python 3 or above, Node.js and npm installed prior to this setup.
- Clone the repository on your machine:
git clone https://github.com/yuan-miranda/cmap.git
- Install the following
npm install leaflet
pip install pillow numpy matplotlib
- Run this schema on your PostgreSQL (pgAdmin4)
CREATE TABLE IF NOT EXISTS overworld (
id SERIAL PRIMARY KEY,
x INT NOT NULL,
z INT NOT NULL
);
CREATE TABLE IF NOT EXISTS nether (
id SERIAL PRIMARY KEY,
x INT NOT NULL,
z INT NOT NULL
);
CREATE TABLE IF NOT EXISTS the_end (
id SERIAL PRIMARY KEY,
x INT NOT NULL,
z INT NOT NULL
);- Setup the database details (realtimeChunkImage.py)
DB_HOST = ""
DB_PORT = 5432
DB_NAME = ""
DB_USER = ""
DB_PASSWORD = ""- Run the interactive map
node app.js
- Generate the tiles for overworld, nether, end with no zoom
cd cmap_scripts
py realtimeChunkImage.py init overworld
py realtimeChunkImage.py init nether
py realtimeChunkImage.py init end
- Run the realtimeChunkImage.py in realtime (assuming you have the tiles generated)
cd cmap_scripts
py realtimeChunkImage.py realtime
