作者:rebot | 分类:模组
Minecraft 版本: 1.20 1.20.1 1.20.2 1.20.3 1.20.4 1.20.5 1.20.6 1.21 1.21.1 1.21.2 1.21.3 1.21.4 1.21.5 1.21.6 1.21.7 1.21.8 1.21.9 1.21.10 1.21.11 26.1 26.1.1 26.1.2
平台: paper purpur
标签: library utility
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.
A hosted version of the javadoc can be found here.
| Server Version | Supported |
|---|---|
| Paper 1.21.11 | ✔️ |
| Paper 1.21.10 | ✔️ |
| Paper 1.21.9 | ✔️ |
| Paper 1.21.8 | ✔️ |
| Paper 1.21.7 | ✔️ |
| Paper 1.21.6 | ✔️ |
| Paper 1.21.5 | ✔️ |
| Paper 1.21.4 | ✔️ |
| Paper 1.21.3 | ✔️ |
| Paper 1.21.2 | ✔️ |
| Paper 1.21.1 | ✔️ |
| Paper 1.21 | ✔️ |
| Paper 1.20.x | ✔️ |
| Paper 1.19.4 | ✔️ |
| Paper 1.19.3 | ✔️ |
MapEngine has to be added as a dependency to the plugin.yml regardless of the build system used.
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.
git clone https://github.com/MinceraftMC/MapEngine.git)cd MapEngine)./gradlew build on Linux/MacOS, gradlew build on Windows)The plugin jar can be found in the build → libs directory
请登录后举报
暂无评论,抢个沙发吧~