MCPcopy Index your code
hub / github.com/MinceraftMC/MapEngine

github.com/MinceraftMC/MapEngine @v1.8.12

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.8.12 ↗ · + Follow
727 symbols 1,607 edges 106 files 166 documented · 23%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

MapEngine

logo

GitHub tag (latest by date) AGPLv3 License Status Beta

Description

MapEngine is a map library plugin for paper servers. It provides a simple API to create maps with custom content. Using lightweight and asynchronous techniques, MapEngine has a very low impact on server performance.

Features

  • Pipelined API for custom pipelines
  • Asynchronous rendering
  • Completely packet based
  • Optional dithering (Floyd-Steinberg)
  • Groups as z-layer interpretation for saving immense network traffic
  • Per player buffering, only the changed pixels are sent to the player
  • Optional packet bundling prevents tearing
  • Drawing utilities (text, components, lines, triangles, rectangles, circles, ellipses, polygons)

Color Conversion Cache Performance Graph

Performance Graph

Live streaming via RTMP on maps

This is an example of a live stream on a map. The stream is played on a 7x4 map array. The Stream source is 1920x1080@20 streamed with OBS.

Watch it here

Floyd Sternberg dithering

This is an example of a map with Floyd-Steinberg dithering enabled. The stream is played on a 7x4 map array. The Stream source is 1920x1080@20 streamed with OBS.

Watch it here

Javadoc

A hosted version of the javadoc can be found here.

Support

Server Version Supported
Paper 26.1.x ✔️
Paper 1.21.x ✔️
Paper 1.20.x ✔️

Usage

MapEngine has to be added as a dependency to the plugin.yml regardless of the build system used.

Maven


<repositories>
    <repository>
        <id>minceraft</id>
        <url>https://repo.minceraft.dev/releases/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>de.pianoman911</groupId>
        <artifactId>mapengine-api</artifactId>
        <version>1.8.12</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

Gradle (groovy)

repositories {
    maven {
        url = 'https://repo.minceraft.dev/releases/'
        name = 'minceraft'
    }
}

dependencies {
    compileOnly 'de.pianoman911:mapengine-api:1.8.12'
}

Gradle (kotlin)

repositories {
    maven("https://repo.minceraft.dev/releases/") {
        name = "minceraft"
    }
}

dependencies {
    compileOnly("de.pianoman911:mapengine-api:1.8.12")
}

Example

public class Bar {

    // getting the api instance
    private static final MapEngineApi MAP_ENGINE = Bukkit.getServicesManager().load(MapEngineApi.class);

    public void foo(BufferedImage image, BlockVector cornerA, BlockVector cornerB, BlockFace facing, Player viewer) {
        // create a map display instance
        IMapDisplay display = MAP_ENGINE.displayProvider().createBasic(cornerA, cornerB, facing);
        display.spawn(viewer); // spawn the map display for the player

        // create an input pipeline element
        // this object can also be used to draw simple shapes and text
        IDrawingSpace input = MAP_ENGINE.pipeline().createDrawingSpace(display);

        // draw the image to the input pipeline element
        input.image(image, 0, 0);

        // draw a triangle
        input.triangle(0, 0, 10, 10, 20, 0, 0xff0000ff);

        // add a player to the pipeline context,
        // making the player receive the map
        input.ctx().receivers().add(viewer);

        // enable floyd-steinberg dithering
        input.ctx().converter(Converter.FLOYD_STEINBERG);

        // enable per player buffering
        input.ctx().buffering(true);

        // flush the pipeline
        // the drawing space can be reused
        input.flush();
    }
}

More detailed examples can be found in the MinceraftMC/MapEngineExamples repository.

Building

  1. Clone the project (git clone https://github.com/MinceraftMC/MapEngine.git)
  2. Go to the cloned directory (cd MapEngine)
  3. Build the Jar (./gradlew build on Linux/MacOS, gradlew build on Windows)

The plugin jar can be found in the buildlibs directory

Extension points exported contracts — how you extend this code

IPipelineOutput (Interface)
Only internally implemented, but is working API. Called last on each pipeline flush and accept an RGB buffer and the [5 …
api/src/main/java/de/pianoman911/mapengine/api/pipeline/IPipelineOutput.java
FrameCache (Interface)
The common cache interface for all frame caches. Indexed by the item frame index. [4 implementers]
plugin/src/main/java/de/pianoman911/mapengine/core/cache/FrameCache.java
IPlatformProvider (Interface)
(no doc) [8 implementers]
platform-common/src/main/java/de/pianoman911/mapengine/common/platform/IPlatformProvider.java
IPipelineNode (Interface)
Implemented by every pipeline processing element. [4 implementers]
api/src/main/java/de/pianoman911/mapengine/api/pipeline/IPipelineNode.java
IPlatform (Interface)
(no doc) [8 implementers]
platform-common/src/main/java/de/pianoman911/mapengine/common/platform/IPlatform.java
ILayeredDrawingSpace (Interface)
A combination of multiple IDrawingSpace's, stacked on top to produce layering. This produces a slight performanc [2 implementers]
api/src/main/java/de/pianoman911/mapengine/api/drawing/ILayeredDrawingSpace.java
IListenerBridge (Interface)
(no doc) [2 implementers]
platform-common/src/main/java/de/pianoman911/mapengine/common/platform/IListenerBridge.java
IDrawingSpace (Interface)
Drawing utility for drawing single pixels or other shapes and forms. [2 implementers]
api/src/main/java/de/pianoman911/mapengine/api/drawing/IDrawingSpace.java

Core symbols most depended-on inside this repo

wrap
called by 65
platform-common/src/main/java/de/pianoman911/mapengine/common/platform/PacketContainer.java
of
called by 30
api/src/main/java/de/pianoman911/mapengine/api/util/Vec2i.java
size
called by 29
platform-common/src/main/java/de/pianoman911/mapengine/common/data/MapUpdateData.java
send
called by 27
platform-common/src/main/java/de/pianoman911/mapengine/common/platform/PacketContainer.java
width
called by 23
api/src/main/java/de/pianoman911/mapengine/api/clientside/IMapDisplay.java
buffer
called by 22
api/src/main/java/de/pianoman911/mapengine/api/drawing/IDrawingSpace.java
height
called by 21
api/src/main/java/de/pianoman911/mapengine/api/clientside/IMapDisplay.java
platform
called by 17
plugin/src/main/java/de/pianoman911/mapengine/core/MapEnginePlugin.java

Shape

Method 617
Class 82
Interface 21
Enum 6
Function 1

Languages

Java100%
Kotlin1%

Modules by API surface

plugin/src/main/java/de/pianoman911/mapengine/core/clientside/FrameContainer.java27 symbols
api/src/main/java/de/pianoman911/mapengine/api/util/FullSpacedColorBuffer.java23 symbols
plugin/src/main/java/de/pianoman911/mapengine/core/util/DummyMapView.java20 symbols
plugin/src/main/java/de/pianoman911/mapengine/core/api/ImplMapEngineApi.java20 symbols
api/src/main/java/de/pianoman911/mapengine/api/clientside/IMapDisplay.java19 symbols
plugin/src/main/java/de/pianoman911/mapengine/core/drawing/DrawingSpace.java17 symbols
plugin/src/main/java/de/pianoman911/mapengine/core/colors/ColorPalette.java16 symbols
platform-paper-26.1/src/main/java/de/pianoman911/mapengine/common/Paper261Platform.java16 symbols
platform-paper-1.21.6/src/main/java/de/pianoman911/mapengine/common/Paper1216Platform.java16 symbols
platform-paper-1.21.11/src/main/java/de/pianoman911/mapengine/common/Paper12111Platform.java16 symbols
plugin/src/main/java/de/pianoman911/mapengine/core/pipeline/PipelineContext.java15 symbols
platform-paper-1.21.2/src/main/java/de/pianoman911/mapengine/common/Paper1212Platform.java15 symbols

For agents

$ claude mcp add MapEngine \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact