API & extension docs & Geyser system property docs (#159)

* initial start on api docs

* oops

* oops #2

* oops #3

* move global api info to global-api.md page, fix typo

* Initial setup page

* the extensions template and list is now in the geysermc org

* add fabric event subscribe example

* fix outdated naming

* the extensions template and list is now in the geysermc org, and therefore official

* spigot/paper plugin geyser-api docs

* minor tweaks

* the setup guide should be in a separate PR, oops

* Updated docs for resource packs PR

* document system properties

* Apply suggestions from code review

Co-authored-by: Redned <redned235@gmail.com>

* move and shuffle pages, address review

* -DGeyser.BedrockNetworkThreads exists too, apparently

* turn notes into banners

* be more specific to indicate this to be advanced stuff

* adjust texts & address camotoy's review

* nms good dont disable

* add chapter on event priorities

* remove whitespace

* main instead of maven-snapshots; floodgate-api 2.2.2

* Move around pages in toc.yml, no need to fully copy event priorities

* Apply suggestions from code review

Co-authored-by: Tim203 <mctim203@gmail.com>

* apply command suggestion

Co-authored-by: Tim203 <mctim203@gmail.com>

* reduce command comments

* specify that this is the Geyser API

* Apply suggestions from code review

Co-authored-by: Redned <redned235@gmail.com>

* dont repeat that the bulk of code would go into a post init event; we already say that

* adress review

* extensions currently target Base API version

---------

Co-authored-by: JensC <jenscollaertyprive@hotmail.com>
Co-authored-by: Redned <redned235@gmail.com>
Co-authored-by: Tim203 <mctim203@gmail.com>
This commit is contained in:
authored and GitHub committed 2023-07-09 10:49:13 -05:00
1 parent fd8b563efa
commit 2f8c69185f
13 files changed
+516 -95

No files matched your search

+7 -17
View File
@@ -2,27 +2,13 @@
title: Floodgate API
---
### Floodgate has an API to extend what is possible and allow servers to get information about the Bedrock client. It also allows other plugins access to [Cumulus](/floodgate/forms/)
### Floodgate has an API to extend what is possible and allow servers to get information about the Bedrock client. It also allows other plugins access to [Cumulus](/geyser/forms/)
This page will contain information about class FloodgateApi.<br>
See the sidebar for more information about other parts of the API.
### Accessing the Floodgate API
Floodgate uses the open collaboration repo. The following example is for Maven, but the same concept applies for Gradle etc.
```xml
<repository>
<id>opencollab-snapshot</id>
<url>https://repo.opencollab.dev/maven-snapshots/</url>
</repository>
<dependency>
<groupId>org.geysermc.floodgate</groupId>
<artifactId>api</artifactId>
<version>2.2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
See [here](/geyser/getting-started-with-the-api) for how to include the Floodgate API in your project.
The Floodgate API has changed in Floodgate 2.0. The most important change is that the API methods are no longer static and instead instance-based, as shown below.
---
@@ -37,6 +23,10 @@ After you got the instance, you have access to all the methods.<br>
Use the documentation in the API module to see (and get info about) every single method available.
Most [API methods have a simple explanation](https://github.com/GeyserMC/Floodgate/tree/master/api/src/main/java/org/geysermc/floodgate/api).
<div class="alert alert-info" role="alert">
Note: To see full, detailed documentation, see the <a href="https://repo.opencollab.dev/javadoc/maven-snapshots/org/geysermc/floodgate/api/2.2.2-SNAPSHOT">javadocs</a>.
</div>
#### We'll highlight a few to get you started quickly:
`FloodgateApi#isFloodgatePlayer(UUID)`<br>
Used to check if the given UUID of an **online** player is a Bedrock player.
@@ -54,7 +44,7 @@ Click [here](/floodgate/linking/) to get more information about the PlayerLink c
`FloodgateApi#sendForm(UUID, Form(Builder))`<br>
Used to send a form to the Bedrock player with the given UUID.<br>
Click [here](/floodgate/forms/) to get more information about Forms.
Click [here](/geyser/forms/) to get more information about Forms.
### Using the API on backend servers
In order to successfully use the API on backend Spigot servers when using a proxy, `send-floodgate-data` must be set to `true` on the proxy Floodgate's config, and the `key.pem` file must be identical between all Floodgate instances.