mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
Implement velocity module (#151)
Co-authored-by: jmp <[email protected]>
This commit is contained in:
1 parent
eb7ec4353f
commit
e402ef2e70
26 files changed
+702
-28
No files matched your search
@@ -17,19 +17,17 @@ import static net.kyori.adventure.text.Component.text;
|
||||
public abstract class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Single {
|
||||
|
||||
protected final String username;
|
||||
protected Component displayName;
|
||||
protected @Nullable Component displayName;
|
||||
protected final UUID uuid;
|
||||
protected final Identity identity;
|
||||
protected @Nullable ChatChannel selectedChannel;
|
||||
|
||||
protected CarbonPlayerCommon(
|
||||
final String username,
|
||||
final Component displayName,
|
||||
final UUID uuid,
|
||||
final Identity identity
|
||||
) {
|
||||
this.username = username;
|
||||
this.displayName = displayName;
|
||||
this.uuid = uuid;
|
||||
this.identity = identity;
|
||||
this.selectedChannel = null;
|
||||
@@ -42,7 +40,7 @@ public abstract class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudi
|
||||
|
||||
@Override
|
||||
public Component displayName() {
|
||||
return this.displayName;
|
||||
return requireNonNullElseGet(this.displayName, () -> text(this.username));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user