/CPlot

Land and world management plugin for PocketMine-MP

Primary LanguagePHPGNU General Public License v3.0GPL-3.0

CPlot

CPlot is a land and world management plugin for the Minecraft: Bedrock Edition server software PocketMine-MP.

I, ColinHDev, started the development of CPlot way back in 2019 after using MyPlot on my server for a few years. Originally, CPlot was meant to be an expanded version of MyPlot that should support many more features. But after running into problems with the old codebase, I started working on my own thing from the start, although my previous codebase was heavily influenced by MyPlot's code style. Over the years, CPlot underwent many rewrites, so it is no longer comparable with its version from 2019.

While CPlot was meant to be closed-source to provide a good plot system for my server back then, I now decided to make it open-source so that other plugin developers, server owners and players have the possibility to benefit from CPlot.

While it was always the goal to provide with CPlot an alternative with a whole load of unique features to MyPlot, the biggest focus is to provide a stable, lag-free and smooth experience for both server owners and players.

Features

Economy Support

By default, CPlot hast built-in support for the most commonly used economy plugins within the PocketMine-MP plugin ecosystem.
Currently, this includes the following plugins: BedrockEconomy, Capital
If you use one of these plugins and want to charge users for certain actions regarding plots, you can head over to the economy configuration in the plugin's config.yml file.

Addons

For developers

CPlot's events

CPlot provides a number of events that can be used to hook into the plugin's code. Currently, the following events can be used:

But, be aware that every event with the AsyncEvent suffix is created with the help of the libAsyncEvent virion, which allows the creation of asynchronous event execution. To understand how those events need to be handled, look at libAsyncEvent's documentation.

Support for third-party economy plugins

The requirement for an economy plugin to be supported by default by CPlot is basically only to be open-source, be commonly used and have a relatively stable API.
But maybe your plugin is not well-known or closed-source and only for your own server, which would make it impossible for CPlot to support your plugin by default. Nonetheless, you can still make your economy plugin compatible with CPlot by using its internal API.
The EconomyManager class (namespace: ColinHDev\CPlot\provider) allows you to set your own economy provider class. Just create a class within your plugin that extends CPlot's EconomyProvider class (namespace: ColinHDev\CPlot\provider). Then, simply connect your class's getCurrency(), removeMoney(), etc. methods to your economy plugin's API. If you did this, just make sure your plugin loads after CPlot and during its enabling, set CPlot's economy provider to your provider class by calling EconomyManager::getInstance()->setProvider(new YourEconomyProviderClass()); in your plugins onEnable() method.