1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2026-01-04 15:31:36 +00:00

API 2.8.3: Support 1.21.100, support sending skins via api (#5742)

* Support 1.21.100

* Add GeyserConnection#sendSkin, #joinAddress and #joinPort (#5641)

* Add GeyserConnection#sendSkin and GeyserConnection#clientConnectionAddress

* address reviews

* Bump to 2.8.3

* Split into joinAddress / joinPort

* Update api/src/main/java/org/geysermc/geyser/api/connection/GeyserConnection.java

* Update api/src/main/java/org/geysermc/geyser/api/connection/GeyserConnection.java

* improve address / port parsing
This commit is contained in:
chris
2025-08-05 16:25:23 +02:00
committed by GitHub
parent bea10781bd
commit a41cc9e4a3
14 changed files with 22203 additions and 2049 deletions

View File

@@ -26,6 +26,7 @@
package org.geysermc.geyser.api.connection;
import org.checkerframework.checker.index.qual.NonNegative;
import org.checkerframework.checker.index.qual.Positive;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.api.connection.Connection;
@@ -35,8 +36,11 @@ import org.geysermc.geyser.api.command.CommandSource;
import org.geysermc.geyser.api.entity.EntityData;
import org.geysermc.geyser.api.entity.type.GeyserEntity;
import org.geysermc.geyser.api.entity.type.player.GeyserPlayerEntity;
import org.geysermc.geyser.api.skin.SkinData;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
/**
@@ -118,6 +122,50 @@ public interface GeyserConnection extends Connection, CommandSource {
*/
void sendCommand(String command);
/**
* Gets the hostname or ip address the player used to join this Geyser instance.
* Example:
* <ul>
* <li> {@code test.geysermc.org} </li>
* <li> {@code 127.0.0.1} </li>
* <li> {@code 06e9:c755:4eff:5f13:9b4c:4b21:9df2:6a73} </li>
* </ul>
*
* @throws NoSuchElementException if called before the session is fully initialized
* @return the ip address or hostname string the player used to join
* @since 2.8.3
*/
@NonNull
String joinAddress();
/**
* Gets the port the player used to join this Geyser instance.
* Example:
* <ul>
* <li> {@code 19132} </li>
* <li> {@code 2202} </li>
* </ul>
*
* @throws NoSuchElementException if called before the session is fully initialized
* @return the port the player used to join
* @since 2.8.3
*/
@Positive
int joinPort();
/**
* Applies a skin to a player seen by this Geyser connection.
* If the uuid matches the {@link GeyserConnection#javaUuid()}, this
* will update the skin of this Geyser connection.
* If the player uuid provided is not known to this connection, this method
* will silently return.
*
* @param player which player this skin should be applied to
* @param skinData the skin data to apply
* @since 2.8.3
*/
void sendSkin(@NonNull UUID player, @NonNull SkinData skinData);
/**
* @param javaId the Java entity ID to look up.
* @return a {@link GeyserEntity} if present in this connection's entity tracker.