mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-10-31 08:32:18 +01:00
Some changes to placeholders
This commit is contained in:
parent
8058d6a3ff
commit
993b4e90f0
@ -24,6 +24,7 @@
|
||||
package com.discordsrv.api.player;
|
||||
|
||||
import com.discordsrv.api.component.MinecraftComponent;
|
||||
import com.discordsrv.api.placeholder.annotation.Placeholder;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@ -40,6 +41,7 @@ public interface DiscordSRVPlayer {
|
||||
* @return the player's username
|
||||
*/
|
||||
@NotNull
|
||||
@Placeholder("name")
|
||||
String username();
|
||||
|
||||
/**
|
||||
@ -47,6 +49,7 @@ public interface DiscordSRVPlayer {
|
||||
* @return the player's unique id
|
||||
*/
|
||||
@NotNull
|
||||
@Placeholder(value = "uuid", relookup = "uuid")
|
||||
UUID uniqueId();
|
||||
|
||||
/**
|
||||
|
@ -53,19 +53,6 @@ public interface IOfflinePlayer extends Identified {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Placeholder(value = "skin", relookup = "skin")
|
||||
SkinInfo skinInfo();
|
||||
|
||||
@Placeholder("skin_texture_id")
|
||||
@Nullable
|
||||
default String skinTextureId() {
|
||||
SkinInfo info = skinInfo();
|
||||
return info != null ? info.textureId() : null;
|
||||
}
|
||||
|
||||
@Placeholder("skin_model")
|
||||
@Nullable
|
||||
default String skinModel() {
|
||||
SkinInfo info = skinInfo();
|
||||
return info != null ? info.model() : null;
|
||||
}
|
||||
}
|
||||
|
@ -58,12 +58,10 @@ public interface IPlayer extends DiscordSRVPlayer, IOfflinePlayer, ICommandSende
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Placeholder("name")
|
||||
String username();
|
||||
|
||||
@Override
|
||||
@ApiStatus.NonExtendable
|
||||
@Placeholder(value = "uuid", relookup = "uuid")
|
||||
default @NotNull UUID uniqueId() {
|
||||
return identity().uuid();
|
||||
}
|
||||
|
@ -18,6 +18,10 @@
|
||||
|
||||
package com.discordsrv.common.abstraction.player.provider.model;
|
||||
|
||||
import com.discordsrv.api.placeholder.annotation.Placeholder;
|
||||
import com.discordsrv.api.placeholder.annotation.PlaceholderPrefix;
|
||||
|
||||
@PlaceholderPrefix("skin_")
|
||||
public class SkinInfo {
|
||||
|
||||
private final String textureId;
|
||||
@ -28,10 +32,12 @@ public class SkinInfo {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
@Placeholder("texture_id")
|
||||
public String textureId() {
|
||||
return textureId;
|
||||
}
|
||||
|
||||
@Placeholder("model")
|
||||
public String model() {
|
||||
return model;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user