1
0
mirror of https://github.com/GeyserMC/Floodgate.git synced 2025-12-19 14:59:20 +00:00

Re-added the old sendForm methods

This commit is contained in:
Tim203
2022-06-06 11:16:11 +02:00
parent 8bd2e2d39a
commit e824d0f4d1
4 changed files with 58 additions and 14 deletions

View File

@@ -29,7 +29,7 @@ import java.util.Collection;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import org.geysermc.cumulus.form.Form;
import org.geysermc.cumulus.util.FormBuilder;
import org.geysermc.cumulus.form.util.FormBuilder;
import org.geysermc.floodgate.api.link.PlayerLink;
import org.geysermc.floodgate.api.player.FloodgatePlayer;
import org.geysermc.floodgate.api.unsafe.Unsafe;
@@ -84,8 +84,8 @@ public interface FloodgateApi {
/**
* Checks if the uuid of the player has the {@link #createJavaPlayerId(long)} format. This
* method can't validate a linked player uuid, since that doesn't equal the format. Use {@link
* #isFloodgatePlayer(UUID)} if you want to include linked accounts.
* method can't validate a linked player uuid, since that doesn't equal the format. Use
* {@link #isFloodgatePlayer(UUID)} if you want to include linked accounts.
*
* @param uuid the uuid to check
* @return true if the given uuid has the correct format.
@@ -96,6 +96,20 @@ public interface FloodgateApi {
boolean sendForm(UUID uuid, FormBuilder<?, ?, ?> formBuilder);
/**
* @deprecated since Cumulus 1.1 and will be removed when Cumulus 2.0 releases. Please use the
* new form classes instead.
*/
@Deprecated
boolean sendForm(UUID uuid, org.geysermc.cumulus.Form<?> form);
/**
* @deprecated since Cumulus 1.1 and will be removed when Cumulus 2.0 releases. Please use the
* new form classes instead.
*/
@Deprecated
boolean sendForm(UUID uuid, org.geysermc.cumulus.util.FormBuilder<?, ?> formBuilder);
boolean transferPlayer(UUID uuid, String address, int port);
/**
@@ -108,9 +122,9 @@ public interface FloodgateApi {
CompletableFuture<Long> getXuidFor(String gamertag);
/**
* Get the xuid of the player that has the given gamertag. It does the same thing as {@link
* #getXuidFor(String)} except that this method will return the xuid in Floodgate uuid format
* instead of just a long
* Get the xuid of the player that has the given gamertag. It does the same thing as
* {@link #getXuidFor(String)} except that this method will return the xuid in Floodgate uuid
* format instead of just a long
*
* @param gamertag the gamertag of the player
* @return the xuid of the player with the given gamertag, or null when there is no player with

View File

@@ -27,7 +27,7 @@ package org.geysermc.floodgate.api.player;
import java.util.UUID;
import org.geysermc.cumulus.form.Form;
import org.geysermc.cumulus.util.FormBuilder;
import org.geysermc.cumulus.form.util.FormBuilder;
import org.geysermc.floodgate.api.FloodgateApi;
import org.geysermc.floodgate.util.DeviceOs;
import org.geysermc.floodgate.util.InputMode;
@@ -49,14 +49,16 @@ public interface FloodgatePlayer {
UUID getJavaUniqueId();
/**
* Returns the uuid that the server will use as uuid of that player. Will return {@link
* #getJavaUniqueId()} when not linked or {@link LinkedPlayer#getJavaUniqueId()} when linked.
* Returns the uuid that the server will use as uuid of that player. Will return
* {@link #getJavaUniqueId()} when not linked or {@link LinkedPlayer#getJavaUniqueId()} when
* linked.
*/
UUID getCorrectUniqueId();
/**
* Returns the username the server will as username for that player. Will return {@link
* #getJavaUsername()} when not linked or {@link LinkedPlayer#getJavaUsername()} when linked.
* Returns the username the server will as username for that player. Will return
* {@link #getJavaUsername()} when not linked or {@link LinkedPlayer#getJavaUsername()} when
* linked.
*/
String getCorrectUsername();
@@ -119,6 +121,24 @@ public interface FloodgatePlayer {
return sendForm(formBuilder.build());
}
/**
* @deprecated since Cumulus 1.1 and will be removed when Cumulus 2.0 releases. Please use the
* new form classes instead.
*/
@Deprecated
default boolean sendForm(org.geysermc.cumulus.Form<?> form) {
return sendForm(form.newForm());
}
/**
* @deprecated since Cumulus 1.1 and will be removed when Cumulus 2.0 releases. Please use the
* new form classes instead.
*/
@Deprecated
default boolean sendForm(org.geysermc.cumulus.util.FormBuilder<?, ?> formBuilder) {
return sendForm(formBuilder.build());
}
default boolean transfer(String address, int port) {
return FloodgateApi.getInstance().transferPlayer(getCorrectUniqueId(), address, port);
}