Skip to content

Commit

Permalink
Do not store the dimension registry for each connected server
Browse files Browse the repository at this point in the history
This was unused and did little more than add unnecessary memory usage. The only time we need the dimension registry is during server switching - once that is done, we no longer need the registry.
  • Loading branch information
astei committed Sep 15, 2024
1 parent 78f6cfc commit 4eb02c8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import net.kyori.adventure.nbt.CompoundBinaryTag;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.NotNull;

Expand All @@ -72,7 +70,6 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
private boolean gracefulDisconnect = false;
private BackendConnectionPhase connectionPhase = BackendConnectionPhases.UNKNOWN;
private final Map<Long, Long> pendingPings = new HashMap<>();
private @MonotonicNonNull CompoundBinaryTag activeDimensionRegistry;

/**
* Initializes a new server connection.
Expand Down Expand Up @@ -366,12 +363,4 @@ public void setConnectionPhase(BackendConnectionPhase connectionPhase) {
public boolean hasCompletedJoin() {
return hasCompletedJoin;
}

public CompoundBinaryTag getActiveDimensionRegistry() {
return activeDimensionRegistry;
}

public void setActiveDimensionRegistry(CompoundBinaryTag activeDimensionRegistry) {
this.activeDimensionRegistry = activeDimensionRegistry;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,6 @@ public void handleBackendJoinGame(JoinGamePacket joinGame, VelocityServerConnect
}
}

destination.setActiveDimensionRegistry(joinGame.getRegistry()); // 1.16

// Remove previous boss bars. These don't get cleared when sending JoinGame, thus the need to
// track them.
for (UUID serverBossBar : serverBossBars) {
Expand Down

0 comments on commit 4eb02c8

Please sign in to comment.