All Projects → alvin0319 → SimpleMapRenderer

alvin0319 / SimpleMapRenderer

Licence: MIT license
A PocketMine-MP Plugin that implements FilledMap

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to SimpleMapRenderer

NpcDialog
🗽 PocketMine-MP virion to add dialogs to entities easily
Stars: ✭ 55 (+120%)
Mutual labels:  pocketmine-plugin, pmmp-plugin
FormAPI-PMMP
Create a Form for Minecraft Bedrock in PocketMine-MP
Stars: ✭ 14 (-44%)
Mutual labels:  pocketmine-plugin, pmmp-plugin
PocketAI
Addon compatible AI plugin for PocketMine-MP
Stars: ✭ 25 (+0%)
Mutual labels:  pocketmine-plugin, pmmp-plugin
PocketMine-MP-Plugins
Repository full of goodies (all my awesome PocketMine-MP Plugins)
Stars: ✭ 33 (+32%)
Mutual labels:  pocketmine-plugin, pmmp-plugin
Battles
Extremely extendable and customisable duels plugin designed for PocketMine-MP servers. 🚀 ⚔️
Stars: ✭ 13 (-48%)
Mutual labels:  pocketmine-plugin, pmmp-plugin
SkyBlock
🦅 SkyBlock for PocketMine-MP
Stars: ✭ 102 (+308%)
Mutual labels:  pocketmine-plugin, pmmp-plugin
Emotes
This plugin allows players to use their favorite emotes on the server!
Stars: ✭ 15 (-40%)
Mutual labels:  pocketmine-plugin, pmmp-plugin
PocketMine-Plugins
A bunch of PocketMine plugins that aren't useful enough for their own repo
Stars: ✭ 13 (-48%)
Mutual labels:  pocketmine-plugin, pmmp-plugin
BlocksConverter
A PocketMine-MP plugin allows you to convert Minecraft PC maps to MCPE/Bedrock maps or vice-versa.
Stars: ✭ 47 (+88%)
Mutual labels:  pmmp-plugin
CosmeticMenu
Fun and Easy-to-Use Pocketmine Cosmetics plugin. (Gadgets, Particles, Trails, etc)
Stars: ✭ 22 (-12%)
Mutual labels:  pmmp-plugin
InfoAPI
Placeholder registry and formatting API.
Stars: ✭ 27 (+8%)
Mutual labels:  pocketmine-plugin
PerWorldInventory
A full-featured per world inventory plugin for PocketMine-MP.
Stars: ✭ 14 (-44%)
Mutual labels:  pocketmine-plugin
Offhand
A PocketMine-MP Plugin that implements OffHand (and OffHandInventory)
Stars: ✭ 36 (+44%)
Mutual labels:  pmmp-plugin
EasyEdit
A feature-rich World Editor for PocketMine-MP
Stars: ✭ 26 (+4%)
Mutual labels:  pmmp-plugin
MurderMysteryPE
A WIP Murder Mystery Mini-Game plugin for PMMP
Stars: ✭ 20 (-20%)
Mutual labels:  pmmp-plugin
DevTools
Development tools plugin for PocketMine-MP
Stars: ✭ 79 (+216%)
Mutual labels:  pocketmine-plugin
ScoreboardsPE
A PocketMine-MP plugin that let you easily send scoreboards by using commands on your server who comes with a rich API for developers.
Stars: ✭ 39 (+56%)
Mutual labels:  pocketmine-plugin
ServerTools
ServerTools is Pocketmine-MP plugin containing a set of tools that allows you to manage your server directly from the game!
Stars: ✭ 23 (-8%)
Mutual labels:  pmmp-plugin
MagicWE2
[MagicWE2] Lag free asynchronous world editor for PMMP with plenty of options
Stars: ✭ 109 (+336%)
Mutual labels:  pmmp-plugin
DungeonPlus
[Plugin] A Plugin support Dungeon API.
Stars: ✭ 14 (-44%)
Mutual labels:  pmmp-plugin

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 = your_map_id;
$mapData = $factory->getMapData($mapId);
Register Map info
$mapId = your_custom_map_id; 
$colors = [];
$center = new Vector3(0, 0, 0);
for($y = 0; $y < 128; $y++){
    for($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($mapId, $colors, false, $center);

$factory->registerData($mapData);
Get block color
$block = Level->getBlock($x, $y, $z);
$color = \alvin0319\SimpleMapRenderer\util\MapUtil::getMapColorByBlock($block);
Save image file
$filePath = path_to_your_png_file;
$colors = [];
for($y = 0; $y < 128; $y++){
    for($x = 0; $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...)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].