Skip to content

Commit

Permalink
Don't add base protocols in bulk
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Dec 10, 2024
1 parent 8db4b2a commit f736910
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ group = "com.viaversion.viabungee"
version = "0.1.3"

dependencies {
compileOnly("com.viaversion:viaversion-common:5.1.0")
compileOnly("com.viaversion:viabackwards-common:5.1.0")
compileOnly("com.viaversion:viarewind-common:4.0.2")
compileOnly("net.raphimc:viaaprilfools-common:3.0.1")
compileOnly("com.viaversion:viaversion-common:5.2.0")
compileOnly("com.viaversion:viabackwards-common:5.2.0")
compileOnly("com.viaversion:viarewind-common:4.0.4")
compileOnly("net.raphimc:viaaprilfools-common:3.0.4")
compileOnly("net.md-5:bungeecord-api:1.20-R0.3-SNAPSHOT")
implementation("net.lenni0451:Reflect:1.4.0")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.data.entity.ClientEntityIdChangeListener;
import com.viaversion.viaversion.api.data.entity.EntityTracker;
import com.viaversion.viaversion.api.protocol.Protocol;
import com.viaversion.viaversion.api.protocol.ProtocolPathEntry;
import com.viaversion.viaversion.api.protocol.ProtocolPipeline;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
Expand Down Expand Up @@ -264,8 +265,11 @@ public void checkServerChange(ServerConnectedEvent event, UserConnection user) t
info.setServerProtocolVersion(serverProtocolVersion);
}

// Add version-specific base Protocol
pipeline.add(Via.getManager().getProtocolManager().getBaseProtocols(info.protocolVersion(), serverProtocolVersion));
// Add version-specific base Protocols
final List<Protocol> baseProtocols = Via.getManager().getProtocolManager().getBaseProtocols(info.protocolVersion(), serverProtocolVersion);
for (final Protocol<?, ?, ?, ?> protocol : baseProtocols) {
pipeline.add(protocol);
}

// Workaround 1.13 server change
boolean toNewId = previousServerProtocol.olderThan(ProtocolVersion.v1_13) && serverProtocolVersion.newerThanOrEqualTo(ProtocolVersion.v1_13);
Expand Down

0 comments on commit f736910

Please sign in to comment.