mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Consistent spacing
This commit is contained in:
1 parent
dcfbb5655b
commit
ab23703b4a
13 files changed
+20
No files matched your search
@@ -6,6 +6,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
public final class CarbonChatProvider {
|
||||
|
||||
private CarbonChatProvider() {
|
||||
|
||||
}
|
||||
|
||||
private static @Nullable CarbonChat instance;
|
||||
|
||||
@@ -6,4 +6,5 @@ import net.kyori.event.Cancellable;
|
||||
* Represents a {@link CarbonEvent} that's cancellable.
|
||||
*/
|
||||
public abstract class CancellableCarbonEvent extends Cancellable.Impl implements CarbonEvent {
|
||||
|
||||
}
|
||||
@@ -12,6 +12,7 @@ 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);
|
||||
};
|
||||
@@ -41,4 +42,5 @@ public class CarbonChatEvent extends CancellableCarbonEvent {
|
||||
public @NonNull List<@NonNull CarbonPlayer> recipients() {
|
||||
return this.recipients;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
package net.draycia.carbon.api.events;
|
||||
|
||||
public interface CarbonEvent {
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface PlayerComponentRenderer {
|
||||
|
||||
/**
|
||||
* Renders a Component for the specified recipient.
|
||||
* @param sender The player that sent the message.
|
||||
@@ -19,4 +20,5 @@ public interface PlayerComponentRenderer {
|
||||
Component render(final @NonNull CarbonPlayer sender,
|
||||
final @NonNull CarbonPlayer recipient,
|
||||
final @NonNull Component message);
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user