mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
misc cleanup
This commit is contained in:
1 parent
e9ca2290f6
commit
5b72fce0f0
3 files changed
+17
-9
No files matched your search
+4
-4
@@ -124,8 +124,8 @@ public class NicknameCommand {
|
||||
// Checking other player's nickname
|
||||
final CarbonPlayer target = handler.flags().get("player");
|
||||
|
||||
if (target.temporaryDisplayName() != null) {
|
||||
messageService.temporaryNicknameShowOthers(sender, target.username(),target.displayName(),
|
||||
if (target.hasActiveTemporaryDisplayName()) {
|
||||
messageService.temporaryNicknameShowOthers(sender, target.username(), target.temporaryDisplayName(),
|
||||
this.formatMillisDuration(target.temporaryDisplayNameExpiration()));
|
||||
} else if (target.displayName() != null) {
|
||||
messageService.nicknameShowOthers(sender, target.username(), target.displayName());
|
||||
@@ -134,8 +134,8 @@ public class NicknameCommand {
|
||||
}
|
||||
} else {
|
||||
// Checking own nickname
|
||||
if (sender.temporaryDisplayName() != null) {
|
||||
messageService.temporaryNicknameShow(sender, sender.username(),CarbonPlayer.renderName(sender),
|
||||
if (sender.hasActiveTemporaryDisplayName()) {
|
||||
messageService.temporaryNicknameShow(sender, sender.username(), sender.temporaryDisplayName(),
|
||||
this.formatMillisDuration(sender.temporaryDisplayNameExpiration()));
|
||||
} else if (sender.displayName() != null){
|
||||
messageService.nicknameShow(sender, sender.username(), sender.displayName());
|
||||
|
||||
@@ -68,13 +68,9 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
||||
|
||||
@Override
|
||||
public @Nullable Component displayName() {
|
||||
if (this.temporaryDisplayName != null && System.currentTimeMillis() < this.temporaryDisplayNameExpiration) {
|
||||
return this.temporaryDisplayName;
|
||||
}
|
||||
|
||||
if (this.displayName != null) {
|
||||
return this.displayName;
|
||||
} else
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -101,6 +97,13 @@ public class CarbonPlayerCommon implements CarbonPlayer, ForwardingAudience.Sing
|
||||
return this.temporaryDisplayNameExpiration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasActiveTemporaryDisplayName() {
|
||||
return this.temporaryDisplayName != null
|
||||
&& (this.temporaryDisplayNameExpiration == -1
|
||||
|| this.temporaryDisplayNameExpiration > System.currentTimeMillis());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(final String permission) {
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user