diff --git a/api/src/main/java/org/geysermc/floodgate/api/FloodgateApi.java b/api/src/main/java/org/geysermc/floodgate/api/FloodgateApi.java index 38f368d8..0d2b0efd 100644 --- a/api/src/main/java/org/geysermc/floodgate/api/FloodgateApi.java +++ b/api/src/main/java/org/geysermc/floodgate/api/FloodgateApi.java @@ -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 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 diff --git a/api/src/main/java/org/geysermc/floodgate/api/player/FloodgatePlayer.java b/api/src/main/java/org/geysermc/floodgate/api/player/FloodgatePlayer.java index 584e2943..c69578c5 100644 --- a/api/src/main/java/org/geysermc/floodgate/api/player/FloodgatePlayer.java +++ b/api/src/main/java/org/geysermc/floodgate/api/player/FloodgatePlayer.java @@ -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); } diff --git a/build-logic/src/main/kotlin/Versions.kt b/build-logic/src/main/kotlin/Versions.kt index 34392cfa..97c16186 100644 --- a/build-logic/src/main/kotlin/Versions.kt +++ b/build-logic/src/main/kotlin/Versions.kt @@ -24,10 +24,10 @@ */ object Versions { - const val geyserVersion = "2.0.1-cumulus-SNAPSHOT" + const val geyserVersion = "2.0.3-cumulus-SNAPSHOT" const val cumulusVersion = "1.1-SNAPSHOT" const val configUtilsVersion = "1.0-SNAPSHOT" - const valspigotVersion = "1.13-R0.1-SNAPSHOT" + const val spigotVersion = "1.13-R0.1-SNAPSHOT" const val fastutilVersion = "8.5.3" const val lombokVersion = "1.18.20" const val guiceVersion = "5.0.1" diff --git a/core/src/main/java/org/geysermc/floodgate/api/SimpleFloodgateApi.java b/core/src/main/java/org/geysermc/floodgate/api/SimpleFloodgateApi.java index f01cd64f..94db6743 100644 --- a/core/src/main/java/org/geysermc/floodgate/api/SimpleFloodgateApi.java +++ b/core/src/main/java/org/geysermc/floodgate/api/SimpleFloodgateApi.java @@ -38,7 +38,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import lombok.RequiredArgsConstructor; import org.geysermc.cumulus.form.Form; -import org.geysermc.cumulus.util.FormBuilder; +import org.geysermc.cumulus.form.util.FormBuilder; import org.geysermc.floodgate.api.logger.FloodgateLogger; import org.geysermc.floodgate.api.player.FloodgatePlayer; import org.geysermc.floodgate.api.unsafe.Unsafe; @@ -125,6 +125,16 @@ public class SimpleFloodgateApi implements FloodgateApi { return sendForm(uuid, formBuilder.build()); } + @Override + public boolean sendForm(UUID uuid, org.geysermc.cumulus.Form form) { + return sendForm(uuid, form.newForm()); + } + + @Override + public boolean sendForm(UUID uuid, org.geysermc.cumulus.util.FormBuilder formBuilder) { + return sendForm(uuid, formBuilder.build()); + } + @Override public boolean transferPlayer(UUID uuid, String address, int port) { return pluginMessageManager