Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-10-03 08:41:05 +02:00
Ursprung
23ba848a69
Commit
3b9ac89d73
@ -151,6 +151,8 @@ public final class Protocol1_20_2To1_20 extends AbstractProtocol<ClientboundPack
|
|||||||
configurationState.setClientInformation(clientInformation);
|
configurationState.setClientInformation(clientInformation);
|
||||||
wrapper.cancel();
|
wrapper.cancel();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// If these are not queued, they may be received before the server switched its listener state to play
|
||||||
registerServerbound(State.CONFIGURATION, ServerboundConfigurationPackets1_20_2.CUSTOM_PAYLOAD.getId(), -1, queueServerboundPacket(ServerboundPackets1_20_2.PLUGIN_MESSAGE));
|
registerServerbound(State.CONFIGURATION, ServerboundConfigurationPackets1_20_2.CUSTOM_PAYLOAD.getId(), -1, queueServerboundPacket(ServerboundPackets1_20_2.PLUGIN_MESSAGE));
|
||||||
registerServerbound(State.CONFIGURATION, ServerboundConfigurationPackets1_20_2.KEEP_ALIVE.getId(), -1, queueServerboundPacket(ServerboundPackets1_20_2.KEEP_ALIVE));
|
registerServerbound(State.CONFIGURATION, ServerboundConfigurationPackets1_20_2.KEEP_ALIVE.getId(), -1, queueServerboundPacket(ServerboundPackets1_20_2.KEEP_ALIVE));
|
||||||
registerServerbound(State.CONFIGURATION, ServerboundConfigurationPackets1_20_2.PONG.getId(), -1, queueServerboundPacket(ServerboundPackets1_20_2.PONG));
|
registerServerbound(State.CONFIGURATION, ServerboundConfigurationPackets1_20_2.PONG.getId(), -1, queueServerboundPacket(ServerboundPackets1_20_2.PONG));
|
||||||
|
@ -66,6 +66,7 @@ import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.rewriter.Entit
|
|||||||
import com.viaversion.viaversion.rewriter.SoundRewriter;
|
import com.viaversion.viaversion.rewriter.SoundRewriter;
|
||||||
import com.viaversion.viaversion.rewriter.StatisticsRewriter;
|
import com.viaversion.viaversion.rewriter.StatisticsRewriter;
|
||||||
import com.viaversion.viaversion.rewriter.TagRewriter;
|
import com.viaversion.viaversion.rewriter.TagRewriter;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.BitSet;
|
import java.util.BitSet;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -352,16 +353,19 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol<ClientboundPa
|
|||||||
|
|
||||||
private PacketHandler resourcePackHandler(final ClientboundPacketType popType) {
|
private PacketHandler resourcePackHandler(final ClientboundPacketType popType) {
|
||||||
return wrapper -> {
|
return wrapper -> {
|
||||||
wrapper.write(Type.UUID, UUID.randomUUID());
|
|
||||||
wrapper.passthrough(Type.STRING); // Url
|
|
||||||
wrapper.passthrough(Type.STRING); // Hash
|
|
||||||
wrapper.passthrough(Type.BOOLEAN); // Required
|
|
||||||
convertOptionalComponent(wrapper);
|
|
||||||
|
|
||||||
// Drop old resource packs first
|
// Drop old resource packs first
|
||||||
final PacketWrapper dropPacksPacket = wrapper.create(popType);
|
final PacketWrapper dropPacksPacket = wrapper.create(popType);
|
||||||
dropPacksPacket.write(Type.OPTIONAL_UUID, null);
|
dropPacksPacket.write(Type.OPTIONAL_UUID, null);
|
||||||
dropPacksPacket.send(Protocol1_20_3To1_20_2.class);
|
dropPacksPacket.send(Protocol1_20_3To1_20_2.class);
|
||||||
|
|
||||||
|
// Use the hash to write a pack uuid
|
||||||
|
final String url = wrapper.read(Type.STRING);
|
||||||
|
final String hash = wrapper.read(Type.STRING);
|
||||||
|
wrapper.write(Type.UUID, UUID.nameUUIDFromBytes(hash.getBytes(StandardCharsets.UTF_8)));
|
||||||
|
wrapper.write(Type.STRING, url);
|
||||||
|
wrapper.write(Type.STRING, hash);
|
||||||
|
wrapper.passthrough(Type.BOOLEAN); // Required
|
||||||
|
convertOptionalComponent(wrapper);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren