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