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.
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.
- CPlotClaimAddon: An addon for performing certain actions (changing the plot's biome, border and wall) once a plot is claimed.
- CPlotRedstoneCircuitIntegration: An addon for integrating the RedstoneCircuit plugin into plot worlds.
CPlot provides a number of events that can be used to hook into the plugin's code. Currently, the following events can be used:
- ColinHDev\CPlot\event\PlayerEnteredPlotEvent: Always called when a player entered a plot.
- ColinHDev\CPlot\event\PlayerEnterPlotEvent: Sometimes called when a player enters a plot.
- ColinHDev\CPlot\event\PlayerLeavePlotEvent: Sometimes called when a player leaves a plot.
- ColinHDev\CPlot\event\PlayerLeftPlotEvent: Always called when a player left a plot.
- ColinHDev\CPlot\event\PlotBiomeChangeAsyncEvent: Called when the biome of a plot is changed.
- ColinHDev\CPlot\event\PlotBorderChangeAsyncEvent: Called when the border of a plot is changed.
- ColinHDev\CPlot\event\PlotClaimAsyncEvent: Called when a plot is claimed by a player.
- ColinHDev\CPlot\event\PlotClearAsyncEvent: Called when a plot is cleared.
- ColinHDev\CPlot\event\PlotClearedAsyncEvent: Called when a plot was successfully cleared.
- ColinHDev\CPlot\event\PlotMergeAsyncEvent: Called when two plots are merged.
- ColinHDev\CPlot\event\PlotMergedAsyncEvent: Called when two plots were successfully merged into one single plot.
- ColinHDev\CPlot\event\PlotPlayerAddAsyncEvent: Called when a plot player (e.g. helper) is added to a plot by a player.
- ColinHDev\CPlot\event\PlotPlayerRemoveAsyncEvent: Called when a plot player (e.g. helper) is removed from a plot by a player.
- ColinHDev\CPlot\event\PlotResetAsyncEvent: Called when a plot is reset.
- ColinHDev\CPlot\event\PlotWallChangeAsyncEvent: Called when the wall of a plot is changed.
- ColinHDev\CPlot\event\PlotWorldGenerateAsyncEvent: Called when a new plot world is generated.
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.
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.
While Schematics are a great addition to CPlot and an advantage over other plot plugins, they are far from finished. The way they are stored is very limited. Although I like the idea of having a single file, which can be easily shared across folders and other servers, it currently is not be an optimised way of storing.
At the moment, each coordinate hash holds the numerical ID, meta value and string representation of the block, while air blocks are excluded. Although this is not bad, it is not good either. Eventually, when PM5 is released and schematics would need to be adopted to support NBT block states and the blocks from Minecraft: Bedrock Edition version 1.13+, the file size could drastically increase when storing every block state for each coordinate.
We could do it the same way PM5 will probably do it, by just storing a list of all used block states and giving those IDs, while the coordinate hashes would only store the ID of their block state. We might be able to use PMMP's PalettedBlockArrays for that. But there weren't any tests done regarding that solution, so this is purely speculating and could be complete rubbish.
- improve async/sync mess in plot classes
- chunk locking
- make entities that are allowed to cross plot borders modifiable OR remake that complete Task