Move API into wiki

This commit is contained in:
rtm516 committed 2024-07-18 10:38:53 +01:00
1 parent 4ec59587c9
commit e77fa6f180
91 files changed
+80 -80

No files matched your search

+53
View File
@@ -0,0 +1,53 @@
---
title: Floodgate API
description: Floodgate has an API to allow servers to get information about the Bedrock client. It also allows plugins access to Cumulus, an API to send and collect form data from Bedrock players.
---
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](/wiki/geyser/forms/)
This page will contain information about class FloodgateApi.
See the sidebar for more information about other parts of the API.
### Accessing the Floodgate API {#accessing-the-floodgate-api}
See [here](/wiki/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.
The class FloodgateApi is the base class of the API and you need to use it to access any part of the API.
To access it, you simply type:
```java
FloodgateApi.getInstance();
```
After you got the instance, you have access to all the methods.
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).
:::note
To see full, detailed documentation, see the [javadocs](https://repo.opencollab.dev/javadoc/maven-snapshots/org/geysermc/floodgate/api/2.2.2-SNAPSHOT).
:::
#### We'll highlight a few to get you started quickly: {#well-highlight-a-few-to-get-you-started-quickly}
`FloodgateApi#isFloodgatePlayer(UUID)`
Used to check if the given UUID of an **online** player is a Bedrock player.
`FloodgateApi#getPlayer(UUID)`
Used to get the FloodgatePlayer instance of an **online** player.
Click [here](/wiki/floodgate/player/) to get more information about the FloodgatePlayer class.
**Note**: You don't need to wait until the Bedrock player is online to use the getPlayer and isFloodgatePlayer methods.
You can even use them in the pre-login events.
`FloodgateApi#getPlayerLink()`
Used to get the PlayerLink instance used by Floodgate to check for linked accounts.
Click [here](/wiki/floodgate/linking/) to get more information about the PlayerLink class
`FloodgateApi#sendForm(UUID, Form(Builder))`
Used to send a form to the Bedrock player with the given UUID.
Click [here](/wiki/geyser/forms/) to get more information about Forms.
### Using the API on backend servers {#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.
+10
View File
@@ -0,0 +1,10 @@
---
title: Commands
description: Commands and their associated permission nodes for Floodgate.
---
| Command | Permission | Description |
|:---:|:---:|:---:|
| `fwhitelist` | `floodgate.command.fwhitelist` | Whitelist command for Floodgate players. See [here](/wiki/floodgate/features#whitelist-command) for details. |
| `linkaccount` | `floodgate.command.linkaccount` | Link your account for local linking. |
| `unlinkaccount` | `floodgate.command.unlinkaccount` | Unlink your account for local linking. |
+41
View File
@@ -0,0 +1,41 @@
---
title: FAQ
description: Frequently asked questions about Floodgate such as changing prefixes, obtaining Bedrock player UUIDs, and using Floodgate with PlaceholderAPI and Skript.
---
import { Questions, Q, A } from "@site/src/components/Questions";
Here you can find answers to frequently asked questions about Floodgate - if you have a question that isn't answered here, feel free to ask in our [Discord](https://discord.gg/GeyserMC)!
<Questions>
<Q>
How do I change or disable the prefix of Bedrock players?
<A>
***Please note: we do not recommend removing the prefix unless you are certain that no one will share a username between a Java and Bedrock player. Duplicated usernames will cause weird situations, like being unable to teleport to one of the players.***
In your Floodgate config, change `username-prefix` to whichever prefix you desire - you can set it to `""` and there will be no prefix.
On some older Paper servers (or any forks that use them), you may need to also shut down your server and delete your `usercache.json` file located in the same folder as your server jar to prevent users who already joined from having the old prefix. See [this issue](/wiki/floodgate/issues#prefix-is-not-changing-on-the-server-after-changing-it-in-the-config) for more information.
</A>
</Q>
<Q>
How do I obtain the UUIDs of Bedrock players?
<A>
Check your server logs, or use [this](https://mcprofile.io/) page. If this doesn't work, then try this method:
First, you'll need to get the XUID of the player. There are several third-party websites to find this, for example, [this one](https://www.cxkes.me/xbox/xuid) (unaffiliated with Geyser). Make sure to choose "Hexidecimal." You'll need to enter the player's Xbox Gamertag, and, once submitted, and it should display the XUID in the format of `xxxxxxxxxxxxxxxx`. To turn the XUID into a UUID that Java Edition can recognize, you need to put the XUID in this format: `00000000-0000-0000-xxxx-xxxxxxxxxxxx`. If formatted right, Java Edition should accept it as a UUID.
</A>
</Q>
<Q>
How do I get placeholders from PlaceolderAPI for Bedrock players?
<A>
If you're using the Spigot version of Floodgate, download the Placeholder plugin [here](https://github.com/rtm516/FloodgatePlaceholders/). Using the placeholders shouldn't require additional setup other than having [PlaceholderAPI](https://www.spigotmc.org/resources/6245/) installed. See the section above on installing Floodgate on backend servers if you wish to use this on BungeeCord.
</A>
</Q>
<Q>
How do I use Skript with Floodgate?
<A>
If you're using the Spigot version of Floodgate, there is an unofficial plugin that adds Skript support [here](https://github.com/kejonaMC/floodgate-skript).
</A>
</Q>
</Questions>
+24
View File
@@ -0,0 +1,24 @@
---
title: Features
description: Learn about the features of Floodgate 2.0, including the whitelist command and skin uploading.
---
## Whitelist command {#whitelist-command}
Floodgate 2.0 has a whitelist command, `fwhitelist`, that should be used for adding or removing Floodgate players to whitelist.json. The username prefix doesn't need to be included.
`fwhitelist add Tim203`
`fwhitelist remove Tim203`
You can also specify a UUID: `fwhitelist add 00000000-0000-0000-0009-01f64f65c7c3`
The permission node is `floodgate.command.fwhitelist`.
## What is skin uploading? {#what-is-skin-uploading}
Skins of Bedrock player should be visible to Java players on servers with Floodgate 2.0 installed.
If they aren't, it's most likely that the skin uploading queue has grown too large and can take a while to upload your skin.
Skin uploading is also a part of the [Global Api](/wiki/geyser/global-api). It is responsible for converting Bedrock skins to Java skins and uploading them to Mojang servers make them show up on Java Edition.
We're using MineSkin internally. MineSkin is running on accounts donated by the community. So if you want to support MineSkin and make the upload times faster, feel free to look at [this page](https://mineskin.org/account) for more info.
![Example skin upload](/img/wiki/skin_upload_example.png)
+15
View File
@@ -0,0 +1,15 @@
---
title: Floodgate
permalink: /floodgate/
description: 'Floodgate is a hybrid mode plugin that allows Minecraft: Bedrock Accounts to join Minecraft: Java Edition servers without needing a Minecraft: Java Edition account.'
---
# Floodgate
## What is Floodgate? {#what-is-floodgate}
Floodgate is a hybrid mode plugin that allows Minecraft: Bedrock Accounts to join Minecraft: Java Edition servers without needing a Minecraft: Java Edition account.
This is something you install in addition to Geyser. Unlike Geyser, Floodgate can only be installed as a plugin on Spigot (including Paper and forks), Bungeecord, Velocity, and as a mod on Fabric servers, and can only be utilized on servers that have it installed.
## What has Floodgate 2.0 to offer? {#what-has-floodgate-20-to-offer}
Floodgate 2.0 is a rewrite of Floodgate 1.0, with various bugfixes and improvements. It also introduces new features: being able to [see Bedrock player skins on Java edition](/wiki/floodgate/features#what-is-skin-uploading),
being able to [use Bedrock forms](/wiki/geyser/forms/), link your account once and login on every server that has [Global Linking](/wiki/floodgate/linking#what-is-global-linking) enabled,
and the [Global Api](/wiki/geyser/global-api).
+60
View File
@@ -0,0 +1,60 @@
---
title: Issues
description: Troubleshoot common Floodgate issues. Get solutions for connection problems, configuration errors, and known limitations.
---
# Known Issues & Caveats
If an issue you're experiencing is not listed here, please consider joining the Geyser [Discord](http://discord.geysermc.org/).
## Running commands {#running-commands}
In some instances, like if you have the `username-prefix` set to `*`, you may need to wrap the Bedrock player's username in quotes; for example: `/tp "*BedrockPlayer"`. Setting the prefix to `.` should also fix this.
## If you wish to use IP forwarding, please enable it in your BungeeCord config as well! {#if-you-wish-to-use-ip-forwarding-please-enable-it-in-your-bungeecord-config-as-well}
It is likely you have enabled `send-floodgate-data` in your Floodgate config but either Floodgate isn't installed on the target server, or your floodgate key isn't the same between the installs of the plugin (please copy them so they all use the same key).
## `java.lang.IllegalStateException: Cannot reply to EncryptionRequestPacket without profile and access token.` {#javalangillegalstateexception-cannot-reply-to-encryptionrequestpacket-without-profile-and-access-token}
Make sure the server has Floodgate installed and started up correctly. Otherwise, see if the next line fixes your error.
## `javax.crypto.AEADBadTagException: Tag mismatch!` {#javaxcryptoaeadbadtagexception-tag-mismatch}
If Geyser and Floodgate are on the same server, shut down your server, delete the `floodgate` plugin folder, delete any key file in the Geyser folder, and restart your server.
If Geyser and Floodgate are not on the same server and you had to copy the key file, this could also be an error related to uploading through FTP. Using ASCII will not work here, and you need to make sure you're on binary when uploading. We recommend using [WinSCP](https://winscp.net) if you need to use FTP.
## java.lang.NumberFormatException: For input string: "" {#javalangnumberformatexception-for-input-string-}
You're trying to log in without an Xbox account. Floodgate requires an Xbox account to authenticate the Bedrock player.
## Geyser-Floodgate:51777 lost connection: Internal Exception: java.lang.NumberFormatException: For input string: "SfqdXv36" (or a similar error) {#geyser-floodgate51777-lost-connection-internal-exception-javalangnumberformatexception-for-input-string-sfqdxv36-or-a-similar-error}
Set `ip-forwarding` in your BungeeCord to `true`.
## "Please connect through the official Geyser" disconnect message {#please-connect-through-the-official-geyser-disconnect-message}
Ensure that Floodgate and Geyser are both up-to-date.
## Prefix is not changing on the server after changing it in the config. {#prefix-is-not-changing-on-the-server-after-changing-it-in-the-config}
Between the Paper builds of 1.15.2-355 and 1.16.5-505, there was a bug where Floodgate players who had already connected to the server would not have their prefixed changed. Paper builds 1.16.5-506 and later fix this issue.
Ensure that you removed the `usercache.json` file from the server root directory and restart your server.
## Issues with LuckPerms and prefixes {#issues-with-luckperms-and-prefixes}
Set `allow-invalid-usernames` to `true` in LuckPerms' config.
## Failed to verify username! (with Paper) {#failed-to-verify-username-with-paper}
To completely mitigate this issue, disable `perform-username-validation` in the [unsupported settings of the `config/paper-global.yml` file](https://paper.readthedocs.io/en/latest/server/configuration.html#unsupported_settings) (`paper.yml` in the root server folder on servers below 1.19). Using Floodgate on the backend servers will also mitigate this issue.
## Error with Forge or Fabric Bukkit Hybrid {#error-with-forge-or-fabric-bukkit-hybrid}
At this time, there is no way to run Floodgate on servers that mix Forge and Bukkit or Fabric and Bukkit (For example: Magma, Mohist, and Cardboard/Bukkit4Fabric) - most hybrids do not support the complicated procedures we need to do in order to allow Bedrock players to connect (for the technically minded: these server softwares typically don't support NMS).
If you wish to use Floodgate in combination with hybrid servers, we recommend putting these servers behind a BungeeCord or Velocity proxy, and running Floodgate on the proxy.
## After enabling global linking in offline mode, player data is not synced between Java and Bedrock players. {#after-enabling-global-linking-in-offline-mode-player-data-is-not-synced-between-java-and-bedrock-players}
This occurs in offline mode because the UUID of the Java account linked to the Bedrock account does not match the online mode UUID returned by Floodgate's global linking server.
When using global linking, ensure `online-mode` in `server.properties` is set to `true`. Otherwise, Bedrock players will not be authenticated with the same UUID they receive when playing on Java Edition, resulting in lost progress. This does not occur with local linking.
+55
View File
@@ -0,0 +1,55 @@
---
title: Linking
description: Learn how to link your Java and Bedrock Minecraft accounts for crossplay. Understand builtin Global Linking or how to set up optional local linking.
---
## What is Global Linking? {#what-is-global-linking}
Instructions and information about how to link can also be found here: [https://link.geysermc.org/](https://link.geysermc.org/)
Before we introduced Global Linking, you always had to link your Java and Bedrock account on every individual server you visited (that has Floodgate). Global Linking is here to fix that problem. Link once, join everywhere.
Keep in mind: While having your accounts linked, you will use the Java account's location, inventory data, and achievements etc. regardless of which platform you sign in from (therefore, "synchronising" the player data). The player data from the Bedrock account will not be accessible until you unlink again. As a result, you should transfer everything (ender chest contents, items, armor) to the Java account before linking to not "lose" your Bedrock progress. If you forgot to do this, you can unlink, transfer everything over, and link again.
Global Linking is part of the [Global Api](/wiki/geyser/global-api) and uses the GlobalLinkServer to link your account. To be able to link your account you have to do the following:
1. Join the GlobalLinkServer with both your Java and Bedrock account
(IP: `link.geysermc.org`, Java port: `25565`, Bedrock port: `19132`)
2. Start the linking process by typing `/linkaccount` on your Java **or** Bedrock account
3. You'll get a message with a random number that you have to enter on the account that you did not start the linking process on.
4. Enter the random number on the other account by typing `/linkaccount <code>`
5. You should get kicked from the server on both your Bedrock and Java account with the message that it had successfully linked your accounts.
To unlink your globally linked accounts, join the GlobalLinkServer (as described above for linking) on either Java or Bedrock, and use the `/unlinkaccount` command.
Global Linking should be enabled by default on every server running Floodgate 2.0, but in the case that you disabled it, you can enable it again by opening your Floodgate config and make sure that the `player-link` section looks similar to this:
```yml
# Configuration for player linking
player-link:
# Whether to enable the linking system. Turning this off will prevent
# players from using the linking feature even if they are already linked.
enabled: true
# Whether to use global linking. Global linking uses a central server to request link
# accounts, allowing people to link once, join everywhere (on servers with global linking).
use-global-linking: true
```
([see the default config](https://github.com/GeyserMC/Floodgate/blob/master/core/src/main/resources/config.yml))
Once you saved the config and restarted your server you should be using Global Linking.
If you don't want to use Global Linking, you can disable `enable-global-linking` in the Floodgate config.
## Local Linking {#local-linking}
You can also set up a local linking database on your server. Local linking can work with Global Linking at the same time. Link entries in your local database will override entries in the Global Linking Server.
Note that you only have to follow these steps on your proxy (BungeeCord or Velocity), if you have one.
1. Download one of the linking databases extensions [here](https://ci.opencollab.dev/job/GeyserMC/job/Floodgate/job/old%252F2.1/).
If you need help picking the right one: choose `mysql` if you already have a database or want to have a multi-proxy setup. For anything else choose `sqlite`. The full name should be `floodgate-*type*-database.jar`.
2. Copy the database extension jar you just downloaded *into* the floodgate 2.0 plugin folder (e.g. `/plugins/floodgate/`).
3. Enable `enable-own-linking` in the `player-link` section of Floodgate.
4. Set `type` in the `player-link` section to your database type (currently either `mysql` or `sqlite`). (If you used Floodgate 1.0 and had linking enabled back then; the database type was `sqlite`).
5. Restart your server
If you have selected `mysql` a new data folder for the database should be generated inside the Floodgate data folder. You can enter your database credentials in there. After you did that restart your server once more.
That should be it. You can then link your accounts by following the instructions you get when typing `/linkaccount`.
+9
View File
@@ -0,0 +1,9 @@
---
title: FloodgatePlayer
description: FloodgatePlayer is the main class for accessing bedrock player data.
---
FloodgatePlayer is something that every player who's connect through Floodgate has.
It contains information about the Bedrock client which can be useful in various situations.
You can get a FloodgatePlayer by using the `FloodgateApi#getPlayer(uuid)` method (where uuid is the unique id of the connected player)
+40
View File
@@ -0,0 +1,40 @@
---
title: Floodgate Setup
page_sidebar: false
description: Set up Floodgate to allow Bedrock users to authenticate with their Bedrock account on your Java Minecraft server.
---
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import Fabric from './setup/fabric.mdx';
import ProxyServers from './setup/proxy-servers.mdx';
import PaperSpigot from './setup/paper-spigot.mdx';
import ViaProxy from './setup/viaproxy.mdx';
import Standalone from './setup/standalone.mdx';
import PlatformIcon from '@site/src/components/PlatformIcon'
import FabricIcon from '@site/static/img/icons/fabric.png';
import ProxyServersIcon from '@site/static/img/icons/velocity.png';
import PaperSpigotIcon from '@site/static/img/icons/paper.png';
import ViaProxyIcon from '@site/static/img/icons/viaproxy.png';
import StandaloneIcon from '@site/static/img/icons/geyser.png';
<Tabs queryString="platform">
<TabItem value="paper-spigot" label={<PlatformIcon img={PaperSpigotIcon} text="Paper / Spigot"/>} default>
<PaperSpigot/>
</TabItem>
<TabItem value="fabric" label={<PlatformIcon img={FabricIcon} text="Fabric"/>}>
<Fabric/>
</TabItem>
<TabItem value="proxy-servers" label={<PlatformIcon img={ProxyServersIcon} text="Proxy Servers"/>}>
<ProxyServers/>
</TabItem>
<TabItem value="viaproxy" label={<PlatformIcon img={ViaProxyIcon} text="ViaProxy"/>}>
<ViaProxy/>
</TabItem>
<TabItem value="standalone" label={<PlatformIcon img={StandaloneIcon} text="Standalone"/>}>
<Standalone/>
</TabItem>
</Tabs>
+15
View File
@@ -0,0 +1,15 @@
---
title: Floodgate Fabric Setup
description: Learn how to set up Floodgate on your Fabric server.
hide_title: true
---
1. Download Floodgate-Fabric from the [modrinth page](https://modrinth.com/mod/floodgate).
2. Place the Floodgate-Fabric.jar in the `mods` folder, and restart the server. **You also need [FabricAPI](https://modrinth.com/mod/fabric-api) installed.**
3. Change `auth-type` in Geyser's config to `floodgate`.
4. Restart the server.
:::note Note for Fabric behind a Velocity proxy
You will need to configure FabricProxyLite to allow the Fabric server to receive data from Velocity.
:::
+10
View File
@@ -0,0 +1,10 @@
---
title: Floodgate Paper / Spigot Setup
description: Learn how to set up Floodgate on your Paper or Spigot server.
hide_title: true
---
1. Download Floodgate-Spigot from the [download page](https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot).
2. Place the Floodgate-Spigot.jar in the `plugins` folder, and restart the server.
3. Change `auth-type` in Geyser's config to `floodgate`.
4. Restart the server.
+31
View File
@@ -0,0 +1,31 @@
---
title: Floodgate Proxy Servers Setup
description: Learn how to set up Floodgate on your Bungee, Waterfall, or Velocity server.
hide_title: true
---
:::info
You only need to install Floodgate on the BungeeCord or Velocity proxy server, unless you want to use the Floodgate API on the backend servers.
Additionally, it will display Bedrock edition skins properly.
:::
1. Download Floodgate for your proxy software from the [download page](https://geysermc.org/download#floodgate).
2. Place the Floodgate jar in the `plugins` folder, and restart the proxy server.
3. Change `auth-type` in Geyser's config to `floodgate`.
4. Restart the server.
### Installing Floodgate on servers behind the proxy {#installing-floodgate-on-servers-behind-the-proxy}
This is only needed when you want to use the Floodgate API on your backend server(s) behind a proxy.
1. After installing Floodgate on the proxy, install Floodgate on the backend servers (either Floodgate-Spigot, or Floodgate-Fabric).
2. Enable `ip_forward` in your BungeeCord `config.yml` if using BungeeCord. For Velocity, set up [player information forwarding](https://docs.papermc.io/velocity/player-information-forwarding).
3. Set `bungeecord` to `true` in your spigot.yml. When using Velocity, see their guide, as they have multiple options that require different setups.
4. Start the proxy server.
5. Edit the Floodgate config on your proxy server and set `send-floodgate-data` to `true`.
6. Copy the `key.pem` file in the proxy Floodgate config folder to all backend servers’ Floodgate config folder.
7. Restart the backend servers and proxy server.
:::danger
DO NOT DISTRIBUTE THIS KEY TO ANYBODY! This key is what allows for Bedrock accounts to bypass the Java Edition authentication, and if anyone gets ahold of this, they can wreak havoc on your server.
:::
+19
View File
@@ -0,0 +1,19 @@
---
title: Floodgate Geyser Standalone Setup
description: Learn how to set up Floodgate with Geyser Standalone.
hide_title: true
---
:::info
To be able to use Floodgate authentication, you need to be able to install Floodgate on the Java server you are connecting to.
:::
1. Download and install the platform-specific Floodgate jar (e.g. floodgate-spigot, or floodgate-fabric) [here](https://geysermc.org/download#floodgate).
See the platform setup instructions for a detailed, platform specific setup guide. Then, continue with the instructions below.
2. Change `auth-type` in Geyser Standalone's config to `floodgate`.
3. Copy the `key.pem` file in the Floodgate config folder to the same directory as Geyser Standalone.
4. Restart Geyser-Standalone.
:::danger
DO NOT DISTRIBUTE THIS KEY TO ANYBODY! This key is what allows for Bedrock accounts to bypass the Java Edition authentication, and if anyone gets ahold of this, they can wreak havoc on your server.
:::
+18
View File
@@ -0,0 +1,18 @@
---
title: Floodgate ViaProxy Setup
description: Learn how to set up Floodgate with ViaProxy.
hide_title: true
---
:::info
To be able to use Floodgate authentication, you need to be able to install Floodgate on the Java server you are connecting to.
:::
1. Download and install the platform-specific Floodgate jar (e.g. floodgate-spigot, or floodgate-fabric) [here](https://geysermc.org/download#floodgate).
See the platform setup instructions for a detailed, platform specific setup guide. Then, continue with the instructions below.
2. Copy the `key.pem` file in the Floodgate config folder to the `/plugins/Geyser/´ directory.
3. Restart ViaProxy.
:::danger
DO NOT DISTRIBUTE THIS KEY TO ANYBODY! This key is what allows for Bedrock accounts to bypass the Java Edition authentication, and if anyone gets ahold of this, they can wreak havoc on your server.
:::