13
0
geforkt von Mirrors/Velocity

Rebase #310 on Velocity 1.1.0

Totally untested, proceed with caution.
Dieser Commit ist enthalten in:
Andrew Steinborn 2020-06-20 23:26:24 -04:00
Ursprung ada35ff286
Commit 09f71dede9
3 geänderte Dateien mit 6 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -31,6 +31,7 @@ import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.function.UnaryOperator;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
public class VelocityServerConnection implements MinecraftConnectionAssociation, ServerConnection {

Datei anzeigen

@ -302,7 +302,7 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
player.getConnection().delayedWrite(joinGame);
destination.setActiveDimensionRegistry(joinGame.getDimensionRegistry()); // 1.16
player.getMinecraftConnection().delayedWrite(joinGame);
player.getConnection().delayedWrite(joinGame);
// Required for Legacy Forge
player.getPhase().onFirstJoin(player);
} else {
@ -317,18 +317,18 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
// Most notably, by having the client accept the join game packet, we can work around the need
// to perform entity ID rewrites, eliminating potential issues from rewriting packets and
// improving compatibility with mods.
player.getMinecraftConnection().delayedWrite(joinGame);
player.getConnection().delayedWrite(joinGame);
// Since 1.16 this dynamic changed:
// We don't need to send two dimension swiches anymore!
if (player.getProtocolVersion().compareTo(ProtocolVersion.MINECRAFT_1_16) < 0) {
int tempDim = joinGame.getDimension() == 0 ? -1 : 0;
player.getMinecraftConnection().delayedWrite(
player.getConnection().delayedWrite(
new Respawn(tempDim, joinGame.getPartialHashedSeed(), joinGame.getDifficulty(),
joinGame.getGamemode(), joinGame.getLevelType(),
false, joinGame.getDimensionInfo(), joinGame.getPreviousGamemode()));
}
player.getMinecraftConnection().delayedWrite(
player.getConnection().delayedWrite(
new Respawn(joinGame.getDimension(), joinGame.getPartialHashedSeed(),
joinGame.getDifficulty(), joinGame.getGamemode(), joinGame.getLevelType(),
false, joinGame.getDimensionInfo(), joinGame.getPreviousGamemode()));

Datei anzeigen

@ -7,6 +7,7 @@ import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_13;
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_14;
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_15;
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_16;
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_7_2;
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_8;
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_9;
import static com.velocitypowered.api.network.ProtocolVersion.MINECRAFT_1_9_4;