-
Notifications
You must be signed in to change notification settings - Fork 4
PlotMaster Setup
The basic setup for PlotMaster is designed to be pretty simple, containing a lot of default values that should fit most servers needs with minor tweaks. However, nearly everything that controls the way PlotMaster works can be configured to your liking. The configuration file for PlotMaster is called config.json and is located in the root of the PlotMaster configuration folder. Since this plugin uses json instead of yml which most people are probably used to, I will start this tutorial by going over json and how I will reference different parts of the config.
Why did I choose to use Json? There are a few reasons. First off, it is hugely easier, cleaner and more straightforward to code with. Secondly, the Gson parser that I use is faster than the SnakeYML parser that Bukkit uses. Lastly, it allows the config to be more customizable and extensible than if I were to use yml.
So, lets dive into using json. Here is an example of a json file.
{
"school": "Example School 1",
"enrolled": 900,
"students": [
{
"first": "Oliver",
"last" : "Queen",
"grade": 11
},
{
"first": "Slade",
"last": "Wilson",
"grade" : 12
}
],
"address": {
"street": "123 Example Drive",
"city": "Starling City",
}
}Lets look at this piece by piece. (Please note, spacing does not matter in json. The above example could have been all on a single line, each value is seperated by a ,, [], or {} depending on the type)
"school": "Example School 1", is a "key value" pair. I would refer to this as school with a value of Example School 1. If I said, set school to Example School 2, this would be the value you changed.
"students": [ is the beginning of an array. Arrays can contain an arbitrary amount of values, seperated by commas. In this example, we have 2 student object values (objects are enclosed with {}). If I was to refer to the array itself, I would just say the student array. If I wanted to refer to a specific object in this array (say I want to get the first name of the first student) I would say students[1].first. If I was referring to an arbitrary student or to all students, I would reference it by students[].first or just students.first. You can add more values to an array.
"address": { is an object in json. Objects themselves contain more key value pairs, arrays or objects. In the above example there are two key/value pairs in the address object. address.street and address.city
This is the default configuration that this tutorial will reference.
{
"version": 1,
"setup": false,
"worlds": [
{
"type": "grid",
"world": "world",
"backend": "flatfile",
"grid": {
"width": 99,
"height": 99,
"border": "road",
"allow_expand": false
},
"plotTypes": {
"default": {
"name": "default",
"width": 50,
"height": 50,
"schematic": "",
"border": "small"
},
"donator": {
"name": "donator",
"width": 99,
"height": 99,
"schematic": "",
"border": "small"
}
},
"generator": {
"levels": [
{
"y": 30,
"block": "GRASS"
},
{
"y": 29,
"block": "DIRT"
},
{
"y": 1,
"block": "BEDROCK"
}
]
}
}
],
"backends": {
"flatfile": {
"location": "./plots",
"debug": true
},
"mysql": {
"host": "localhost",
"port": 3306,
"database": "plots",
"user": "root",
"pass": ""
},
"sqlite": {
"location": "./plots.db"
}
}
}For most people, you will just need to tweak a few values to get up and running. This section will cover the common things that will need to be configured.
First off, a little explanation of how PlotMaster works. It is a little different than your typical Plot plugin. There are different "Plot Manager" types that control how your plot system works. These are extensible and plugin developers can even implement their own. The two that will be included with the plugin are the "Grid" type, which is your typical creative plot type, and the "Free" style, which lets you manually set places where people can claims plots, useful for creating towns or cities in a survival world where players can claim plots. Unlike other plugins, there are two types of "containers" in PlotMaster, "Regions" and "Plots." A Region is a Plot container and can contain zero, one or more plots. When you are using the "Grid" type system, each cell on the grid is a region. In the "Free" style system, a Region could be an entire town, divided into multiple plots for users to claim. Regions dont do anything by themselves, but act as a container for plots. The Plot is the thing that a player can actually claim and edit. Each Plot can be different sizes, have different bases & schematics, and have their own borders.
As of now, only the Grid style plot system is implemented, with the Free style coming later. This tutorial will mostly focus on the Grid style, but most settings will be interchangeable.
The default configuration contains one world already setup for using the Grid Manager. This can be edited to your liking.
worlds[].world will set the world this manager uses. If is something other than "world," set this here.
worlds[].grid contains the grid settings. Changing the width and height values will set the size of each cell in the grid. The border setting changes the border that is used between each region. (See: Creating Borders for more info). The allow_expand option is not yet implemented, but in the future, if set to true, will allow regions to be merged to form larger regions and plots.
worlds[].plotTypes is a list of all the different plot types for this world. PlotTypes allow you to configure different type of plots for different ranks, or configure plots that have different settings. By default, 2 types are included. The type "default" is the type that will be automatically created when a user uses /p claim. The other types can be accessed using /p claim <type>. These are configured on a per-world basis. To access a plot type, the perm plot.type.<name>.<world> must be given to the user (This allows plot.type.<name>.* if you use the same plotTypes between worlds and don't want to add the perm for each world).
worlds[].generator is specific to the Grid Manager and tells the world generator how to generate the base of your world. These options go from the top down, meaning everything above your top value will be air, and every block below will be set to that block until another value is reached.