mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Add some basic javadocs
This commit is contained in:
1 parent
3818957b56
commit
7fc4c7c8c1
4 files changed
+19
No files matched your search
@@ -2,5 +2,8 @@ package net.draycia.carbon.api.events;
|
||||
|
||||
import net.kyori.event.Cancellable;
|
||||
|
||||
/**
|
||||
* Represents a {@link CarbonEvent} that's cancellable.
|
||||
*/
|
||||
public abstract class CancellableCarbonEvent extends Cancellable.Impl implements CarbonEvent {
|
||||
}
|
||||
@@ -8,6 +8,9 @@ import java.util.List;
|
||||
|
||||
import static net.kyori.adventure.text.Component.translatable;
|
||||
|
||||
/**
|
||||
* {@link CancellableCarbonEvent} that's called when chat components are rendered for online players.
|
||||
*/
|
||||
public class CarbonChatEvent extends CancellableCarbonEvent {
|
||||
private @NonNull PlayerComponentRenderer renderer = (sender, recipient, message) -> {
|
||||
return translatable("chat.type.text", sender.displayName(), message);
|
||||
|
||||
@@ -10,12 +10,15 @@ import java.util.UUID;
|
||||
|
||||
public interface CarbonPlayer extends Audience, Identified {
|
||||
|
||||
/** The player's username. */
|
||||
@NonNull String username();
|
||||
|
||||
/** The player's display name, shown in places like chat and tab menu. */
|
||||
@NonNull Component displayName();
|
||||
|
||||
void displayName(final @Nullable Component displayName);
|
||||
|
||||
/** The player's UUID. */
|
||||
@NonNull UUID uuid();
|
||||
|
||||
@NonNull Component createItemHoverComponent();
|
||||
|
||||
@@ -7,8 +7,18 @@ import java.util.UUID;
|
||||
|
||||
public interface UserManager {
|
||||
|
||||
/**
|
||||
* Loads and returns a {@link CarbonPlayer} with the given {@link UUID}.
|
||||
* @param uuid The player's UUID.
|
||||
* @return The {@link CarbonPlayer}, or null if the player doesn't exist.
|
||||
*/
|
||||
@Nullable CarbonPlayer carbonPlayer(final @NonNull UUID uuid);
|
||||
|
||||
/**
|
||||
* Loads and returns a {@link CarbonPlayer} with the given username.
|
||||
* @param username The player's username.
|
||||
* @return The {@link CarbonPlayer}, or null if the player doesn't exist.
|
||||
*/
|
||||
@Nullable CarbonPlayer carbonPlayer(final @NonNull String username);
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user