SimpleMapRenderer

SimpleMapRenderer

por poggit-archive
No disponible

Incompatible con la versión actual de PocketMine-MP — Could not load plugin 'SimpleMapRenderer': Incompatible API version (plugin requires one of: 3.0.0) · Probado en PocketMine-MP 5.50.0 (PHP 8.4.27).

Variospocketmine
5visitas
0descargas

SimpleMapRenderer

Simple Map Plugin for PocketMine-MP

How to use

Just put the plugin on plugins folder and enjoy it!

API

Get MapFactory instance

$factory = \alvin0319\SimpleMapRenderer\MapFactory::getInstance();

Get MapData object

mapId=yourmapid;mapId = your_map_id; mapData = factory−>getMapData(factory->getMapData(mapId);

Register Map info

mapId=yourcustommapid;mapId = your_custom_map_id; colors = []; center=newVector3(0,0,0);for(center = new Vector3(0, 0, 0); for(y = 0; y<128;y < 128; y++){ for(x=0;x = 0; x < 128; x++){ colors[] = new \pocketmine\utils\Color(mt_rand(0, 128), mt_rand(0, 128), mt_rand(0, 128)); } } mapData=new\alvin0319\SimpleMapRenderer\data\MapData(mapData = new \alvin0319\SimpleMapRenderer\data\MapData(mapId, colors,false,colors, false, center);

factory−>registerData(factory->registerData(mapData);

Get block color

block=Level−>getBlock(block = Level->getBlock(x, y,y, z); color=\alvin0319\SimpleMapRenderer\util\MapUtil::getMapColorByBlock(color = \alvin0319\SimpleMapRenderer\util\MapUtil::getMapColorByBlock(block);

Save image file

filePath=pathtoyourpngfile;filePath = path_to_your_png_file; colors = []; for(y=0;y = 0; y < 128; y++){ for(x = 0; x<128;x < 128; x++){ colors[] = new \pocketmine\utils\Color(mt_rand(0, 128), mt_rand(0, 128), mt_rand(0, 128)); } } \alvin0319\SimpleMapRenderer\util\ImageUtil::toPNG(filePath, $colors);

Note

$mapId cannot overlap with an existing ID.

  • The $color must be a two-dimensional array from 0 to 128. (ex: [y][x] = Color)

To-Do

  • Implement MapDecoration (tracking player, mob, etc...)