Updated Developer Documentation (markdown)

NotMyFault 2020-02-16 17:11:33 +01:00
parent fb7239ea6e
commit 164921b8c4
2 changed files with 75 additions and 166 deletions

75
API-Documentation.md Normal file

@ -0,0 +1,75 @@
## API Documentation for PlotSquared
## Bukkit: Maven 1.13+
If you need to access the bukkit module of PlotSquared, you need to add `PlotSquared-BukkitAPI` as `<artifactId>` and declare it as non-transitive.
```xml
<!-- PlotSquared repository -->
<repository>
<id>plotsquared-repo</id>
<url>https://ci.athion.net/job/PlotSquared-v5-Releases/ws/mvn/</url>
</repository>
<!-- WorldEdit -->
<repository>
<id>enginehub</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
<!-- PlotSquared API -->
<dependency>
<groupId>com.github.intellectualsites.plotsquared</groupId>
<artifactId>PlotSquared-CoreAPI</artifactId>
<version>5.1</version>
</dependency>
```
## Bukkit: Gradle 1.13+
If you need to access the bukkit module of PlotSquared, you need to add `PlotSquared-BukkitAPI` into the `dependencies` block and declare it as non-transitive.
```gradle
// PlotSquared repository
repositories {
maven { url = "https://ci.athion.net/job/PlotSquared-v5-Releases/ws/mvn/" }
maven { url = "https://maven.enginehub.org/repo/" } // WorldEdit
}
// PlotSquared API
dependencies {
"implementation"("com.github.intellectualsites.plotsquared:PlotSquared-CoreAPI:5.1")
}
```
You can compile PlotSquared with Gradle, which is included with this repository:
$ `gradlew build`
## Useful classes for PlotSquared
[[PlotAPI|https://github.com/IntellectualSites/PlotSquared/blob/v5/Core/src/main/java/com/github/intellectualsites/plotsquared/api/PlotAPI.java]]
[[PlotPlayer|https://github.com/IntellectualSites/PlotSquared/blob/v5/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java]]
[[Plot|https://github.com/IntellectualSites/PlotSquared/blob/v5/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java]]
[[FlagManager|https://github.com/IntellectualSites/PlotSquared/blob/v5/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/FlagManager.java]]
[[MainUtil|https://github.com/IntellectualSites/PlotSquared/blob/v5/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java]]
[[SchematicHandler|https://github.com/IntellectualSites/PlotSquared/blob/v5/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java]]
[[ChunkManager|https://github.com/IntellectualSites/PlotSquared/blob/v5/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java]]
[[UUIDHandler|https://github.com/IntellectualSites/PlotSquared/blob/v5/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandler.java]]
## Tutorials
[Scripting with javascript](https://github.com/IntellectualSites/PlotSquared/wiki/Scripting)
## Terminology:
#### Plot area:
A plot area is any area that PlotSquared will manage/handle. If this is an infinite plot world, the entire world is considered to be a plot area. If you use plot clusters, then only part of the world will be a plot area, and anything outside this area will not be handled by PlotSquared.
See: [MainUtil.java](https://github.com/IntellectualSites/PlotSquared/blob/v5/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java)#getPlotAreaByString(...)
#### Clusters
Clusters can be created within existing plot areas, or they can be created in a previously non-plot world, which will in turn create it's own plot area.
See: [PlotCluster.java](https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java)
See: [PlotSquared.java](https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java(...))
#### Road
A road is what separates each plot, and includes the wall around each plot. Attempting to get a plot at this location will return null.
See: [Location.java](https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java)#isPlotRoad(...)
#### Plot
A plot can be claimed or unclaimed. Getting a plot at a location where one isn't claimed will return a new unowned plot object.
See: [MainUtil.java](https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java)#getPlots(...)
>If you have made a tutorial, or an addon for PlotSquared, and want us to link it here, please create a ticket. We'd really appreciate it!

@ -1,166 +0,0 @@
## API Documentation for PlotSquared
### This documentation covers PlotSquared version 4.X. Documentation for the legacy version (3.X) exists only as javadocs or you browse the `legacy/1.8-1.12` branch.
## Bukkit Maven:
[1.8 - 1.12.2](https://github.com/IntellectualSites/PlotSquared/wiki/Developer-Documentation#bukkit-maven-18---1122)<br>
[1.13+](https://github.com/IntellectualSites/PlotSquared/wiki/Developer-Documentation#bukkit-maven-113)
## Bukkit Gradle:
[1.8 - 1.12.2](https://github.com/IntellectualSites/PlotSquared/wiki/Developer-Documentation#bukkit-gradle-18---1122)<br>
[1.13+](https://github.com/IntellectualSites/PlotSquared/wiki/Developer-Documentation#bukkit-gradle-113)
## Nukkit
[Nukkit Maven](https://github.com/IntellectualSites/PlotSquared/wiki/Developer-Documentation#nukkit-maven)<br>
[Nukkit Gradle](https://github.com/IntellectualSites/PlotSquared/wiki/Developer-Documentation#nukkit-gradle)
## Bukkit: Maven 1.8 - 1.12.2
If you need to access the bukkit module of PlotSquared, you need to add `plotsquared-bukkitapi` as `<artifactId>` and declare it as non-transitive.
```xml
<!-- PlotSquared legacy repository -->
<repository>
<id>p2-repo</id>
<url>http://ci.athion.net/job/PlotSquared-Legacy/ws/mvn/</url>
</repository>
<!-- WorldEdit -->
<repository>
<id>enginehub</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
<!-- PlotSquared legacy API -->
<dependency>
<groupId>com.plotsquared</groupId>
<artifactId>plotsquared-api</artifactId>
<version>latest</version>
</dependency>
```
## Bukkit: Gradle 1.8 - 1.12.2
If you need to access the bukkit module of PlotSquared, you need to add `plotsquared-bukkitapi` into the `dependencies` block and declare it as non-transitive.
```gradle
// PlotSquared legacy repository
repositories {
maven { url = "http://ci.athion.net/job/PlotSquared-Legacy/ws/mvn/" }
}
// PlotSquared legacy API
dependencies {
"implementation"("com.plotsquared:plotsquared-api:latest")
}
```
You can compile PlotSquared legacy with Gradle, which is included with this repository:
$ `gradlew setupDecompWorkspace` - is only needed if you want to work with Forge
$ `gradlew build` OR `gradle :Bukkit:build`
## Bukkit: Maven 1.13+
If you need to access the bukkit module of PlotSquared, you need to add `PlotSquared-BukkitAPI` as `<artifactId>` and declare it as non-transitive.
```xml
<!-- PlotSquared repository -->
<repository>
<id>p2-repo</id>
<url>http://ci.athion.net/job/PlotSquared-Releases/ws/mvn/</url>
</repository>
<!-- Jenkins4J -->
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<!-- WorldEdit -->
<repository>
<id>enginehub</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
<!-- PlotSquared API -->
<dependency>
<groupId>com.github.intellectualsites.plotsquared</groupId>
<artifactId>PlotSquared-API</artifactId>
<version>4.453</version>
</dependency>
```
## Bukkit: Gradle 1.13+
If you need to access the bukkit module of PlotSquared, you need to add `PlotSquared-BukkitAPI` into the `dependencies` block and declare it as non-transitive.
```gradle
// PlotSquared repository
repositories {
maven { url = "https://ci.athion.net/job/PlotSquared-Releases/ws/mvn/" }
maven { url = "https://jitpack.io" } // Jenkins4J
maven { url = "https://maven.enginehub.org/repo/" } // WorldEdit
}
// PlotSquared API
dependencies {
"implementation"("com.github.intellectualsites.plotsquared:PlotSquared-API:4.453")
}
```
You can compile PlotSquared with Gradle, which is included with this repository:
$ `gradlew build`
## Nukkit: Maven
```xml
<!-- PlotSquared legacy repository -->
<repository>
<id>p2-repo</id>
<url>http://ci.athion.net/job/PlotSquared-Legacy/ws/mvn/</url>
</repository>
<!-- PlotSquared legacy API -->
<dependency>
<groupId>com.plotsquared</groupId>
<artifactId>plotsquared-nukkitapi</artifactId>
<version>latest</version>
</dependency>
```
## Nukkit: Gradle
```gradle
// PlotSquared legacy repository
repositories {
maven { url = "http://ci.athion.net/job/PlotSquared-Legacy/ws/mvn/" }
}
// PlotSquared legacy API
dependencies {
"implementation"("com.plotsquared:plotsquared-nukkitapi:latest")
}
```
You can compile PlotSquared legacy with Gradle, which is included with this repository:
$ `gradlew setupDecompWorkspace` - is only needed if you want to work with Forge
$ `gradlew build`
## Useful classes for PlotSquared
[[PlotAPI|https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/api/PlotAPI.java]]
[[PlotPlayer|https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java]]
[[Plot|https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java]]
[[FlagManager|https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/flag/FlagManager.java]]
[[MainUtil|https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java]]
[[SchematicHandler|https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/SchematicHandler.java]]
[[ChunkManager|https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/ChunkManager.java]]
[[UUIDHandler|https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/UUIDHandler.java]]
## Tutorials
[Scripting with javascript](https://github.com/IntellectualSites/PlotSquared/wiki/Scripting)
[[Getting an instance of PlotSquared]]
[[Adding a subcommand]]
[[Adding custom flags]]
[[Using the PlotAPI class]]
[[Using PlotPlayer]]
[[Adding a custom world generator]]
## Developer Stuff
[Github](https://github.com/IntellectualSites/PlotSquared) - Source code
## Terminology:
#### Plot area:
A plot area is any area that PlotSquared will manage/handle. If this is an infinite plot world, the entire world is considered to be a plot area. If you use plot clusters, then only part of the world will be a plot area, and anything outside this area will not be handled by PlotSquared.
See: [MainUtil.java](https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java)#getPlotAreaByString(...)
#### Clusters
Clusters can be created within existing plot areas, or they can be created in a previously non-plot world, which will in turn create it's own plot area.
See: [PlotCluster.java](https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotCluster.java)
See: [PlotSquared.java](https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java(...))
#### Road
A road is what separates each plot, and includes the wall around each plot. Attempting to get a plot at this location will return null.
See: [Location.java](https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Location.java)#isPlotRoad(...)
#### Plot
A plot can be claimed or unclaimed. Getting a plot at a location where one isn't claimed will return a new unowned plot object.
See: [MainUtil.java](https://github.com/IntellectualSites/PlotSquared/blob/v4/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/util/MainUtil.java)#getPlots(...)
>If you have made a tutorial, or an addon for PlotSquared, and want us to link it here, please create a ticket. We'd really appreciate it!