3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-28 17:10:13 +01:00

Use normal uuid type in gameprofile packet

Dieser Commit ist enthalten in:
Nassim Jahnke 2022-04-27 21:49:37 +02:00
Ursprung 0e66228a96
Commit 5b9f775743
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
4 geänderte Dateien mit 50 neuen und 55 gelöschten Zeilen

Datei anzeigen

@ -26,6 +26,6 @@ public class BaseProtocol1_16 extends BaseProtocol1_7 {
@Override @Override
protected UUID passthroughLoginUUID(final PacketWrapper wrapper) throws Exception { protected UUID passthroughLoginUUID(final PacketWrapper wrapper) throws Exception {
return wrapper.passthrough(Type.UUID_INT_ARRAY); return wrapper.passthrough(Type.UUID);
} }
} }

Datei anzeigen

@ -84,9 +84,9 @@ public class Protocol1_16To1_15_2 extends AbstractProtocol<ClientboundPackets1_1
@Override @Override
public void registerMap() { public void registerMap() {
handler(wrapper -> { handler(wrapper -> {
// Transform string to int array // Transform string to a uuid
UUID uuid = UUID.fromString(wrapper.read(Type.STRING)); UUID uuid = UUID.fromString(wrapper.read(Type.STRING));
wrapper.write(Type.UUID_INT_ARRAY, uuid); wrapper.write(Type.UUID, uuid);
}); });
} }
}); });

Datei anzeigen

@ -33,42 +33,42 @@ public enum ClientboundPackets1_19 implements ClientboundPacketType {
BLOCK_CHANGE, // 0x09 BLOCK_CHANGE, // 0x09
BOSSBAR, // 0x0A BOSSBAR, // 0x0A
SERVER_DIFFICULTY, // 0x0B SERVER_DIFFICULTY, // 0x0B
CLEAR_TITLES, // 0x0D CLEAR_TITLES, // 0x0C
TAB_COMPLETE, // 0x0E TAB_COMPLETE, // 0x0D
DECLARE_COMMANDS, // 0x0F DECLARE_COMMANDS, // 0x0E
CLOSE_WINDOW, // 0x10 CLOSE_WINDOW, // 0x0F
WINDOW_ITEMS, // 0x11 WINDOW_ITEMS, // 0x10
WINDOW_PROPERTY, // 0x12 WINDOW_PROPERTY, // 0x11
SET_SLOT, // 0x13 SET_SLOT, // 0x12
COOLDOWN, // 0x14 COOLDOWN, // 0x13
PLUGIN_MESSAGE, // 0x15 PLUGIN_MESSAGE, // 0x14
NAMED_SOUND, // 0x16 NAMED_SOUND, // 0x15
DISCONNECT, // 0x17 DISCONNECT, // 0x16
ENTITY_STATUS, // 0x18 ENTITY_STATUS, // 0x17
EXPLOSION, // 0x19 EXPLOSION, // 0x18
UNLOAD_CHUNK, // 0x1A UNLOAD_CHUNK, // 0x19
GAME_EVENT, // 0x1B GAME_EVENT, // 0x1A
OPEN_HORSE_WINDOW, // 0x1C OPEN_HORSE_WINDOW, // 0x1B
WORLD_BORDER_INIT, // 0x1D WORLD_BORDER_INIT, // 0x1C
KEEP_ALIVE, // 0x1E KEEP_ALIVE, // 0x1D
CHUNK_DATA, // 0x1F CHUNK_DATA, // 0x1E
EFFECT, // 0x20 EFFECT, // 0x1F
SPAWN_PARTICLE, // 0x21 SPAWN_PARTICLE, // 0x20
UPDATE_LIGHT, // 0x22 UPDATE_LIGHT, // 0x21
JOIN_GAME, // 0x23 JOIN_GAME, // 0x22
MAP_DATA, // 0x24 MAP_DATA, // 0x23
TRADE_LIST, // 0x25 TRADE_LIST, // 0x24
ENTITY_POSITION, // 0x26 ENTITY_POSITION, // 0x25
ENTITY_POSITION_AND_ROTATION, // 0x27 ENTITY_POSITION_AND_ROTATION, // 0x26
ENTITY_ROTATION, // 0x28 ENTITY_ROTATION, // 0x27
VEHICLE_MOVE, // 0x29 VEHICLE_MOVE, // 0x28
OPEN_BOOK, // 0x2A OPEN_BOOK, // 0x29
OPEN_WINDOW, // 0x2B OPEN_WINDOW, // 0x2A
OPEN_SIGN_EDITOR, // 0x2C OPEN_SIGN_EDITOR, // 0x2B
PING, // 0x2D PING, // 0x2C
CRAFT_RECIPE_RESPONSE, // 0x2E CRAFT_RECIPE_RESPONSE, // 0x2D
PLAYER_ABILITIES, // 0x2F PLAYER_ABILITIES, // 0x2E
PLAYER_CHAT, PLAYER_CHAT, // 0x2F
COMBAT_END, // 0x30 COMBAT_END, // 0x30
COMBAT_ENTER, // 0x31 COMBAT_ENTER, // 0x31
COMBAT_KILL, // 0x32 COMBAT_KILL, // 0x32
@ -113,16 +113,16 @@ public enum ClientboundPackets1_19 implements ClientboundPacketType {
ENTITY_SOUND, // 0x59 ENTITY_SOUND, // 0x59
SOUND, // 0x5A SOUND, // 0x5A
STOP_SOUND, // 0x5B STOP_SOUND, // 0x5B
SYSTEM_CHAT, SYSTEM_CHAT, // 0x5C
TAB_LIST, // 0x5C TAB_LIST, // 0x5D
NBT_QUERY, // 0x5D NBT_QUERY, // 0x5E
COLLECT_ITEM, // 0x5E COLLECT_ITEM, // 0x5F
ENTITY_TELEPORT, // 0x5F ENTITY_TELEPORT, // 0x60
ADVANCEMENTS, // 0x60 ADVANCEMENTS, // 0x61
ENTITY_PROPERTIES, // 0x61 ENTITY_PROPERTIES, // 0x62
ENTITY_EFFECT, // 0x62 ENTITY_EFFECT, // 0x63
DECLARE_RECIPES, // 0x63 DECLARE_RECIPES, // 0x64
TAGS; // 0x64 TAGS; // 0x65
@Override @Override
public int getId() { public int getId() {

Datei anzeigen

@ -17,7 +17,6 @@
*/ */
package com.viaversion.viaversion.protocols.protocol1_19to1_18_2; package com.viaversion.viaversion.protocols.protocol1_19to1_18_2;
import com.google.gson.JsonObject;
import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.data.MappingData; import com.viaversion.viaversion.api.data.MappingData;
@ -55,20 +54,16 @@ import java.security.spec.X509EncodedKeySpec;
public final class Protocol1_19To1_18_2 extends AbstractProtocol<ClientboundPackets1_18, ClientboundPackets1_19, ServerboundPackets1_17, ServerboundPackets1_17> { public final class Protocol1_19To1_18_2 extends AbstractProtocol<ClientboundPackets1_18, ClientboundPackets1_19, ServerboundPackets1_17, ServerboundPackets1_17> {
public static final MappingData MAPPINGS = new MappingDataBase("1.18", "1.19", true); public static final MappingData MAPPINGS = new MappingDataBase("1.18", "1.19", true);
private static final JsonObject EMPTY_COMPONENT = new JsonObject();
private static final KeyFactory RSA_FACTORY; private static final KeyFactory RSA_FACTORY;
static { static {
try { try {
RSA_FACTORY = KeyFactory.getInstance("RSA"); RSA_FACTORY = KeyFactory.getInstance("RSA");
} catch (final NoSuchAlgorithmException e) { } catch (final NoSuchAlgorithmException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
EMPTY_COMPONENT.addProperty("text", "");
} }
private static final byte[] EMPTY_BYTES = new byte[0];
private final EntityPackets entityRewriter = new EntityPackets(this); private final EntityPackets entityRewriter = new EntityPackets(this);
private final InventoryPackets itemRewriter = new InventoryPackets(this); private final InventoryPackets itemRewriter = new InventoryPackets(this);
@ -191,7 +186,7 @@ public final class Protocol1_19To1_18_2 extends AbstractProtocol<ClientboundPack
registerClientbound(State.LOGIN, ClientboundLoginPackets.GAME_PROFILE.getId(), ClientboundLoginPackets.GAME_PROFILE.getId(), new PacketRemapper() { registerClientbound(State.LOGIN, ClientboundLoginPackets.GAME_PROFILE.getId(), ClientboundLoginPackets.GAME_PROFILE.getId(), new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
map(Type.UUID_INT_ARRAY, Type.UUID); // UUID map(Type.UUID); // UUID
map(Type.STRING); // Name map(Type.STRING); // Name
handler(wrapper -> { handler(wrapper -> {
// No properties // No properties