Add javadoc to event

This commit is contained in:
rtm516 2024-04-25 16:30:32 +01:00
parent 2d25a89e4e
commit 9c1d252057
No known key found for this signature in database
GPG Key ID: 331715B8B007C67A
3 changed files with 57 additions and 7 deletions

View File

@ -45,42 +45,92 @@ public abstract class SessionSkinApplyEvent extends ConnectionEvent {
private final String username; private final String username;
private final UUID uuid; private final UUID uuid;
private final boolean slim; private final boolean slim;
private final boolean isBedrock; private final boolean bedrock;
private final SkinData skinData; private final SkinData skinData;
public SessionSkinApplyEvent(@NonNull GeyserConnection connection, String username, UUID uuid, boolean slim, boolean isBedrock, SkinData skinData) { public SessionSkinApplyEvent(@NonNull GeyserConnection connection, String username, UUID uuid, boolean slim, boolean bedrock, SkinData skinData) {
super(connection); super(connection);
this.username = username; this.username = username;
this.uuid = uuid; this.uuid = uuid;
this.slim = slim; this.slim = slim;
this.isBedrock = isBedrock; this.bedrock = bedrock;
this.skinData = skinData; this.skinData = skinData;
} }
/**
* The username of the player.
*
* @return the username of the player
*/
public String username() { public String username() {
return username; return username;
} }
/**
* The UUID of the player.
*
* @return the UUID of the player
*/
public UUID uuid() { public UUID uuid() {
return uuid; return uuid;
} }
/**
* If the player is using a slim model.
*
* @return if the player is using a slim model
*/
public boolean slim() { public boolean slim() {
return slim; return slim;
} }
public boolean isBedrock() { /**
return isBedrock; * If the player is using a Bedrock skin.
*
* @return if the player is using a Bedrock skin
*/
public boolean bedrock() {
return bedrock;
} }
/**
* The skin data of the player.
*
* @return the skin data of the player
*/
public SkinData skinData() { public SkinData skinData() {
return skinData; return skinData;
} }
/**
* Change the skin of the player.
*
* @param newSkin the new skin
*/
public abstract void skin(@NonNull Skin newSkin); public abstract void skin(@NonNull Skin newSkin);
/**
* Change the cape of the player.
*
* @param newCape the new cape
*/
public abstract void cape(@NonNull Cape newCape); public abstract void cape(@NonNull Cape newCape);
/**
* Change the geometry of the player.
*
* @param newGeometry the new geometry
*/
public abstract void geometry(@NonNull SkinGeometry newGeometry); public abstract void geometry(@NonNull SkinGeometry newGeometry);
/**
* Change the geometry of the player.
* <p>
* Constructs a generic {@link SkinGeometry} object with the given data.
*
* @param geometryName the name of the geometry
* @param geometryData the data of the geometry
*/
public void geometry(@NonNull String geometryName, @NonNull String geometryData) { public void geometry(@NonNull String geometryName, @NonNull String geometryData) {
geometry(new SkinGeometry("{\"geometry\" :{\"default\" :\"" + geometryName + "\"}}", geometryData)); geometry(new SkinGeometry("{\"geometry\" :{\"default\" :\"" + geometryName + "\"}}", geometryData));
} }

View File

@ -30,7 +30,7 @@ package org.geysermc.geyser.api.skin;
* *
* @param textureUrl The URL of the cape texture * @param textureUrl The URL of the cape texture
* @param capeId The ID of the cape * @param capeId The ID of the cape
* @param capeData The raw cape image data * @param capeData The raw cape image data in ARGB format
* @param failed If the cape failed to load, this is for things like fallback capes * @param failed If the cape failed to load, this is for things like fallback capes
*/ */
public record Cape(String textureUrl, String capeId, byte[] capeData, boolean failed) { public record Cape(String textureUrl, String capeId, byte[] capeData, boolean failed) {

View File

@ -29,7 +29,7 @@ package org.geysermc.geyser.api.skin;
* Represents a skin. * Represents a skin.
* *
* @param textureUrl The URL/ID of the skin texture * @param textureUrl The URL/ID of the skin texture
* @param skinData The raw skin image data * @param skinData The raw skin image data in ARGB
* @param failed If the skin failed to load, this is for things like fallback skins * @param failed If the skin failed to load, this is for things like fallback skins
*/ */
public record Skin(String textureUrl, byte[] skinData, boolean failed) { public record Skin(String textureUrl, byte[] skinData, boolean failed) {