From 75c3bb5ee622f1d799631f7cbeac3f5468ccdddd Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Sat, 29 Sep 2018 03:32:44 -0400 Subject: [PATCH] Clean up vestigal stuff --- .../proxy/connection/client/ConnectedPlayer.java | 6 +++--- .../proxy/protocol/ProtocolUtils.java | 16 ---------------- .../protocol/packet/TabCompleteRequest.java | 1 - .../proxy/protocol/packet/TitlePacket.java | 1 - .../proxy/util/VelocityChannelRegistrar.java | 1 - 5 files changed, 3 insertions(+), 22 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java index 40ad1b896..3c8351df4 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java @@ -49,7 +49,7 @@ import java.util.concurrent.CompletableFuture; public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { private static final PlainComponentSerializer PASS_THRU_TRANSLATE = new PlainComponentSerializer((c) -> "", TranslatableComponent::key); - public static final PermissionProvider DEFAULT_PERMISSIONS = s -> PermissionFunction.ALWAYS_UNDEFINED; + static final PermissionProvider DEFAULT_PERMISSIONS = s -> PermissionFunction.ALWAYS_UNDEFINED; private static final Logger logger = LogManager.getLogger(ConnectedPlayer.class); @@ -107,7 +107,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { return settings == null ? ClientSettingsWrapper.DEFAULT : this.settings; } - public void setPlayerSettings(ClientSettings settings) { + void setPlayerSettings(ClientSettings settings) { this.settings = new ClientSettingsWrapper(settings); server.getEventManager().fireAndForget(new PlayerSettingsChangedEvent(this, this.settings)); } @@ -122,7 +122,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { return Optional.ofNullable(virtualHost); } - public void setPermissionFunction(PermissionFunction permissionFunction) { + void setPermissionFunction(PermissionFunction permissionFunction) { this.permissionFunction = permissionFunction; } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/ProtocolUtils.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/ProtocolUtils.java index 73567e9cc..33a3a0ac5 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/ProtocolUtils.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/ProtocolUtils.java @@ -3,9 +3,6 @@ package com.velocitypowered.proxy.protocol; import com.google.common.base.Preconditions; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufUtil; -import net.kyori.text.Component; -import net.kyori.text.serializer.ComponentSerializer; -import net.kyori.text.serializer.ComponentSerializers; import java.nio.charset.StandardCharsets; import java.util.UUID; @@ -82,17 +79,4 @@ public enum ProtocolUtils { ; buf.writeLong(uuid.getMostSignificantBits()); buf.writeLong(uuid.getLeastSignificantBits()); } - - public static Component readScoreboardTextComponent(ByteBuf buf, int protocolVersion) { - String toDeserialize = readString(buf); - ComponentSerializer serializer = - protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ? ComponentSerializers.JSON : ComponentSerializers.LEGACY; - return serializer.deserialize(toDeserialize); - } - - public static void writeScoreboardTextComponent(ByteBuf buf, int protocolVersion, Component component) { - ComponentSerializer serializer = - protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ? ComponentSerializers.JSON : ComponentSerializers.LEGACY; - writeString(buf, serializer.serialize(component)); - } } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TabCompleteRequest.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TabCompleteRequest.java index 9448a898d..d4bfb183b 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TabCompleteRequest.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TabCompleteRequest.java @@ -6,7 +6,6 @@ import com.velocitypowered.proxy.protocol.ProtocolConstants; import com.velocitypowered.proxy.protocol.ProtocolUtils; import io.netty.buffer.ByteBuf; -import static com.velocitypowered.proxy.protocol.ProtocolConstants.MINECRAFT_1_13; import static com.velocitypowered.proxy.protocol.ProtocolConstants.MINECRAFT_1_9; public class TabCompleteRequest implements MinecraftPacket { diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TitlePacket.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TitlePacket.java index 2be5443e7..52a9a5c49 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TitlePacket.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/TitlePacket.java @@ -1,6 +1,5 @@ package com.velocitypowered.proxy.protocol.packet; -import com.google.common.base.Preconditions; import com.velocitypowered.proxy.connection.MinecraftSessionHandler; import com.velocitypowered.proxy.protocol.MinecraftPacket; import com.velocitypowered.proxy.protocol.ProtocolConstants; diff --git a/proxy/src/main/java/com/velocitypowered/proxy/util/VelocityChannelRegistrar.java b/proxy/src/main/java/com/velocitypowered/proxy/util/VelocityChannelRegistrar.java index 3595c528c..8d60d8224 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/util/VelocityChannelRegistrar.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/util/VelocityChannelRegistrar.java @@ -11,7 +11,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import java.util.stream.Collectors; public class VelocityChannelRegistrar implements ChannelRegistrar { private final Map identifierMap = new ConcurrentHashMap<>();