Coder Social home page Coder Social logo

finixbase123 / imageonmap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from czechpmdevs/imageonmap

0.0 0.0 0.0 96 KB

๐Ÿ–ผ๏ธ Easy to use PocketMine plugin, which allows loading images on maps

License: GNU General Public License v3.0

PHP 100.00%

imageonmap's Introduction

ImageOnMap



โœ”๏ธ Simple usage, without external convertors
โœ”๏ธ Supporting both .png and .jpg image formats
โœ”๏ธ Image is automatically resized to fit item frame
โœ”๏ธ Supports last PocketMine API version

Commands

  • Plugin implements command /image with aliases /img and /iom.
  • To use this command, permission imageonmap.command is needed.
  • This command can be used only in game.
  • There are implemented these subcommands:
Sub-Command Description
/img help Shows all the available subcommands
/img list Displays all the available images found in /plugin_data/ImageOnMap/images/* path.
/img obtain <image> [<xChunkCount> <yChunkCount> <x> <y>] Obtains specific image (or it's specific part) from file as map item.

Chunk count argument represents to how many parts should be the image split. X and Y coordinates represents which part of that chunked image will be given to player's inventory.

Aliases: /img o
/img place <image> Places the whole images on to item frames in selected area.

To place an image properly, first execute the command (/img p image). Afterwards, break the first corner of the target position and then break the block to select second position. The image will be placed automatically.

Aliases: /img p

API

  • Obtaining plugin instance
$api = \czechpmdevs\imageonmap\ImageOnMap::getInstance();
  • Loading image from file
// This method caches the map and returns its id. Afterwards the id can be used to obtain map item.
$id = $api->getImageFromFile(
	file: "path/to/image.png",
	xChunkCount: 1,
	yChunkCount: 1,
	xOffset: 0,
	yOffset: 0
);
  • Obtaining Map item, assigning id & giving it to player
/** @var \czechpmdevs\imageonmap\item\FilledMap $map */
$map = (FilledMap::get())->setMapId($id);
/** @var \pocketmine\player\Player $player */
$player->getInventory()->addItem($map);

๐Ÿ’ก License

ImageOnMap - Easy to use PocketMine plugin, which allows loading images on maps
Copyright (C) 2021 - 2022 CzechPMDevs

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

imageonmap's People

Contributors

vixikhd avatar finixbase123 avatar nerahikada avatar dependabot[bot] avatar poggit-bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.