Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-16 21:10:30 +01:00
Fix "pointers" for players never being used lol & Type pointers (#674)
* Fix "pointers" for players never being used lol * Added Platform Facet API to add Type pointers * Remove duplicate
Dieser Commit ist enthalten in:
Ursprung
05d1938476
Commit
9f77431f36
@ -68,6 +68,7 @@ dependencies {
|
||||
|
||||
implementation(platform("net.kyori:adventure-bom:${adventureVersion}"))
|
||||
implementation("net.kyori:adventure-nbt")
|
||||
implementation("net.kyori:adventure-platform-facet:4.0.0")
|
||||
|
||||
implementation 'org.asynchttpclient:async-http-client:2.12.3'
|
||||
|
||||
|
@ -88,6 +88,8 @@ import net.kyori.adventure.audience.MessageType;
|
||||
import net.kyori.adventure.bossbar.BossBar;
|
||||
import net.kyori.adventure.identity.Identity;
|
||||
import net.kyori.adventure.permission.PermissionChecker;
|
||||
import net.kyori.adventure.platform.facet.FacetPointers;
|
||||
import net.kyori.adventure.platform.facet.FacetPointers.Type;
|
||||
import net.kyori.adventure.pointer.Pointers;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.TranslatableComponent;
|
||||
@ -145,6 +147,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
||||
.withDynamic(Identity.UUID, this::getUniqueId)
|
||||
.withDynamic(Identity.NAME, this::getUsername)
|
||||
.withStatic(PermissionChecker.POINTER, getPermissionChecker())
|
||||
.withStatic(FacetPointers.TYPE, Type.PLAYER)
|
||||
.build();
|
||||
private @Nullable String clientBrand;
|
||||
private @Nullable Locale effectiveLocale;
|
||||
@ -256,6 +259,11 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
||||
server.getEventManager().fireAndForget(new PlayerModInfoEvent(this, modInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull Pointers pointers() {
|
||||
return this.pointers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
return (InetSocketAddress) connection.getRemoteAddress();
|
||||
|
@ -29,6 +29,8 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import net.kyori.adventure.identity.Identity;
|
||||
import net.kyori.adventure.permission.PermissionChecker;
|
||||
import net.kyori.adventure.platform.facet.FacetPointers;
|
||||
import net.kyori.adventure.platform.facet.FacetPointers.Type;
|
||||
import net.kyori.adventure.pointer.Pointers;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
@ -52,7 +54,9 @@ public final class VelocityConsole extends SimpleTerminalConsole implements Cons
|
||||
private final VelocityServer server;
|
||||
private PermissionFunction permissionFunction = ALWAYS_TRUE;
|
||||
private final @NotNull Pointers pointers = ConsoleCommandSource.super.pointers().toBuilder()
|
||||
.withDynamic(PermissionChecker.POINTER, this::getPermissionChecker).build();
|
||||
.withDynamic(PermissionChecker.POINTER, this::getPermissionChecker)
|
||||
.withStatic(FacetPointers.TYPE, Type.CONSOLE)
|
||||
.build();
|
||||
|
||||
public VelocityConsole(VelocityServer server) {
|
||||
this.server = server;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren