Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-25 15:50:19 +01:00
Implement missing Pointers (#694)
- Implement Player's LOCALE and DISPLAY_NAME pointers - Implement VelocityConsole's LOCALE pointer
Dieser Commit ist enthalten in:
Ursprung
d59d4505cb
Commit
3cb10f6ad4
@ -152,6 +152,8 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
private final @NotNull Pointers pointers = Player.super.pointers().toBuilder()
|
private final @NotNull Pointers pointers = Player.super.pointers().toBuilder()
|
||||||
.withDynamic(Identity.UUID, this::getUniqueId)
|
.withDynamic(Identity.UUID, this::getUniqueId)
|
||||||
.withDynamic(Identity.NAME, this::getUsername)
|
.withDynamic(Identity.NAME, this::getUsername)
|
||||||
|
.withDynamic(Identity.DISPLAY_NAME, () -> Component.text(this.getUsername()))
|
||||||
|
.withDynamic(Identity.LOCALE, this::getEffectiveLocale)
|
||||||
.withStatic(PermissionChecker.POINTER, getPermissionChecker())
|
.withStatic(PermissionChecker.POINTER, getPermissionChecker())
|
||||||
.withStatic(FacetPointers.TYPE, Type.PLAYER)
|
.withStatic(FacetPointers.TYPE, Type.PLAYER)
|
||||||
.build();
|
.build();
|
||||||
|
@ -55,6 +55,8 @@ public final class VelocityConsole extends SimpleTerminalConsole implements Cons
|
|||||||
private PermissionFunction permissionFunction = ALWAYS_TRUE;
|
private PermissionFunction permissionFunction = ALWAYS_TRUE;
|
||||||
private final @NotNull Pointers pointers = ConsoleCommandSource.super.pointers().toBuilder()
|
private final @NotNull Pointers pointers = ConsoleCommandSource.super.pointers().toBuilder()
|
||||||
.withDynamic(PermissionChecker.POINTER, this::getPermissionChecker)
|
.withDynamic(PermissionChecker.POINTER, this::getPermissionChecker)
|
||||||
|
.withDynamic(Identity.LOCALE, () -> ClosestLocaleMatcher.INSTANCE
|
||||||
|
.lookupClosest(Locale.getDefault()))
|
||||||
.withStatic(FacetPointers.TYPE, Type.CONSOLE)
|
.withStatic(FacetPointers.TYPE, Type.CONSOLE)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren