3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-20 06:50:08 +01:00
Dieser Commit ist enthalten in:
Nassim Jahnke 2022-07-08 16:20:54 +02:00
Ursprung 1afff77a0f
Commit b33bd2ac2b
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
4 geänderte Dateien mit 103 neuen und 106 gelöschten Zeilen

Datei anzeigen

@ -81,7 +81,7 @@ public class ProtocolVersion {
public static final ProtocolVersion v1_18 = register(757, "1.18/1.18.1", new VersionRange("1.18", 0, 1)); public static final ProtocolVersion v1_18 = register(757, "1.18/1.18.1", new VersionRange("1.18", 0, 1));
public static final ProtocolVersion v1_18_2 = register(758, "1.18.2"); public static final ProtocolVersion v1_18_2 = register(758, "1.18.2");
public static final ProtocolVersion v1_19 = register(759, "1.19"); public static final ProtocolVersion v1_19 = register(759, "1.19");
public static final ProtocolVersion v1_19_1 = register(760, 96, "1.19.1"); public static final ProtocolVersion v1_19_1 = register(760, 97, "1.19.1");
public static final ProtocolVersion unknown = register(-1, "UNKNOWN"); public static final ProtocolVersion unknown = register(-1, "UNKNOWN");
public static ProtocolVersion register(int version, String name) { public static ProtocolVersion register(int version, String name) {

Datei anzeigen

@ -42,91 +42,93 @@ public enum ClientboundPackets1_19_1 implements ClientboundPacketType {
WINDOW_PROPERTY, // 0x12 WINDOW_PROPERTY, // 0x12
SET_SLOT, // 0x13 SET_SLOT, // 0x13
COOLDOWN, // 0x14 COOLDOWN, // 0x14
CUSTOM_CHAT_COMPLETIONS, CUSTOM_CHAT_COMPLETIONS, // 0x15
PLUGIN_MESSAGE, // 0x15 PLUGIN_MESSAGE, // 0x16
NAMED_SOUND, // 0x16 NAMED_SOUND, // 0x17
DISCONNECT, // 0x17 DELETE_CHAT_MESSAGE, // 0x18
ENTITY_STATUS, // 0x18 DISCONNECT, // 0x19
EXPLOSION, // 0x19 ENTITY_STATUS, // 0x1A
UNLOAD_CHUNK, // 0x1A EXPLOSION, // 0x1B
GAME_EVENT, // 0x1B UNLOAD_CHUNK, // 0x1C
OPEN_HORSE_WINDOW, // 0x1C GAME_EVENT, // 0x1D
WORLD_BORDER_INIT, // 0x1D OPEN_HORSE_WINDOW, // 0x1E
KEEP_ALIVE, // 0x1E WORLD_BORDER_INIT, // 0x1F
CHUNK_DATA, // 0x1F KEEP_ALIVE, // 0x20
EFFECT, // 0x20 CHUNK_DATA, // 0x21
SPAWN_PARTICLE, // 0x21 EFFECT, // 0x22
UPDATE_LIGHT, // 0x22 SPAWN_PARTICLE, // 0x23
JOIN_GAME, // 0x23 UPDATE_LIGHT, // 0x24
MAP_DATA, // 0x24 JOIN_GAME, // 0x25
TRADE_LIST, // 0x25 MAP_DATA, // 0x26
ENTITY_POSITION, // 0x26 TRADE_LIST, // 0x27
ENTITY_POSITION_AND_ROTATION, // 0x27 ENTITY_POSITION, // 0x28
ENTITY_ROTATION, // 0x28 ENTITY_POSITION_AND_ROTATION, // 0x29
VEHICLE_MOVE, // 0x29 ENTITY_ROTATION, // 0x2A
OPEN_BOOK, // 0x2A VEHICLE_MOVE, // 0x2B
OPEN_WINDOW, // 0x2B OPEN_BOOK, // 0x2C
OPEN_SIGN_EDITOR, // 0x2C OPEN_WINDOW, // 0x2D
PING, // 0x2D OPEN_SIGN_EDITOR, // 0x2E
CRAFT_RECIPE_RESPONSE, // 0x2E PING, // 0x2F
PLAYER_ABILITIES, // 0x2F CRAFT_RECIPE_RESPONSE, // 0x30
PLAYER_CHAT, // 0x30 PLAYER_ABILITIES, // 0x31
COMBAT_END, // 0x31 PLAYER_CHAT_HEADER, // 0x32
COMBAT_ENTER, // 0x32 PLAYER_CHAT, // 0x33
COMBAT_KILL, // 0x33 COMBAT_END, // 0x34
PLAYER_INFO, // 0x34 COMBAT_ENTER, // 0x35
FACE_PLAYER, // 0x35 COMBAT_KILL, // 0x36
PLAYER_POSITION, // 0x36 PLAYER_INFO, // 0x37
UNLOCK_RECIPES, // 0x37 FACE_PLAYER, // 0x38
REMOVE_ENTITIES, // 0x38 PLAYER_POSITION, // 0x39
REMOVE_ENTITY_EFFECT, // 0x39 UNLOCK_RECIPES, // 0x3A
RESOURCE_PACK, // 0x3A REMOVE_ENTITIES, // 0x3B
RESPAWN, // 0x3B REMOVE_ENTITY_EFFECT, // 0x3C
ENTITY_HEAD_LOOK, // 0x3C RESOURCE_PACK, // 0x3D
MULTI_BLOCK_CHANGE, // 0x3D RESPAWN, // 0x3E
SELECT_ADVANCEMENTS_TAB, // 0x3E ENTITY_HEAD_LOOK, // 0x3F
SERVER_DATA, // 0x3F MULTI_BLOCK_CHANGE, // 0x40
ACTIONBAR, // 0x40 SELECT_ADVANCEMENTS_TAB, // 0x41
WORLD_BORDER_CENTER, // 0x41 SERVER_DATA, // 0x42
WORLD_BORDER_LERP_SIZE, // 0x42 ACTIONBAR, // 0x43
WORLD_BORDER_SIZE, // 0x43 WORLD_BORDER_CENTER, // 0x44
WORLD_BORDER_WARNING_DELAY, // 0x44 WORLD_BORDER_LERP_SIZE, // 0x45
WORLD_BORDER_WARNING_DISTANCE, // 0x45 WORLD_BORDER_SIZE, // 0x46
CAMERA, // 0x46 WORLD_BORDER_WARNING_DELAY, // 0x47
HELD_ITEM_CHANGE, // 0x47 WORLD_BORDER_WARNING_DISTANCE, // 0x48
UPDATE_VIEW_POSITION, // 0x48 CAMERA, // 0x49
UPDATE_VIEW_DISTANCE, // 0x49 HELD_ITEM_CHANGE, // 0x4A
SPAWN_POSITION, // 0x4A UPDATE_VIEW_POSITION, // 0x4B
SET_DISPLAY_CHAT_PREVIEW, // 0x4B UPDATE_VIEW_DISTANCE, // 0x4C
DISPLAY_SCOREBOARD, // 0x4C SPAWN_POSITION, // 0x4D
ENTITY_METADATA, // 0x4D SET_DISPLAY_CHAT_PREVIEW, // 0x4E
ATTACH_ENTITY, // 0x4E DISPLAY_SCOREBOARD, // 0x4F
ENTITY_VELOCITY, // 0x4F ENTITY_METADATA, // 0x50
ENTITY_EQUIPMENT, // 0x50 ATTACH_ENTITY, // 0x51
SET_EXPERIENCE, // 0x51 ENTITY_VELOCITY, // 0x52
UPDATE_HEALTH, // 0x52 ENTITY_EQUIPMENT, // 0x53
SCOREBOARD_OBJECTIVE, // 0x53 SET_EXPERIENCE, // 0x54
SET_PASSENGERS, // 0x54 UPDATE_HEALTH, // 0x55
TEAMS, // 0x55 SCOREBOARD_OBJECTIVE, // 0x56
UPDATE_SCORE, // 0x56 SET_PASSENGERS, // 0x57
SET_SIMULATION_DISTANCE, // 0x57 TEAMS, // 0x58
TITLE_SUBTITLE, // 0x58 UPDATE_SCORE, // 0x59
TIME_UPDATE, // 0x59 SET_SIMULATION_DISTANCE, // 0x5A
TITLE_TEXT, // 0x5A TITLE_SUBTITLE, // 0x5B
TITLE_TIMES, // 0x5B TIME_UPDATE, // 0x5C
ENTITY_SOUND, // 0x5C TITLE_TEXT, // 0x5D
SOUND, // 0x5D TITLE_TIMES, // 0x5E
STOP_SOUND, // 0x5E ENTITY_SOUND, // 0x5F
SYSTEM_CHAT, // 0x5F SOUND, // 0x60
TAB_LIST, // 0x60 STOP_SOUND, // 0x61
NBT_QUERY, // 0x61 SYSTEM_CHAT, // 0x62
COLLECT_ITEM, // 0x62 TAB_LIST, // 0x63
ENTITY_TELEPORT, // 0x63 NBT_QUERY, // 0x64
ADVANCEMENTS, // 0x64 COLLECT_ITEM, // 0x65
ENTITY_PROPERTIES, // 0x65 ENTITY_TELEPORT, // 0x66
ENTITY_EFFECT, // 0x66 ADVANCEMENTS, // 0x67
DECLARE_RECIPES, // 0x67 ENTITY_PROPERTIES, // 0x68
TAGS; // 0x68 ENTITY_EFFECT, // 0x69
DECLARE_RECIPES, // 0x6A
TAGS; // 0x6B
@Override @Override
public int getId() { public int getId() {

Datei anzeigen

@ -21,7 +21,6 @@ import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.viaversion.viaversion.api.minecraft.nbt.BinaryTagIO; import com.viaversion.viaversion.api.minecraft.nbt.BinaryTagIO;
import com.viaversion.viaversion.api.protocol.AbstractProtocol; import com.viaversion.viaversion.api.protocol.AbstractProtocol;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.protocol.packet.State; import com.viaversion.viaversion.api.protocol.packet.State;
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper; import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.Type;
@ -88,30 +87,26 @@ public final class Protocol1_19_1To1_19 extends AbstractProtocol<ClientboundPack
}); });
} }
}); });
registerClientbound(ClientboundPackets1_19.PLAYER_CHAT, new PacketRemapper() {
// Back to system caht
registerClientbound(ClientboundPackets1_19.PLAYER_CHAT, ClientboundPackets1_19_1.SYSTEM_CHAT, new PacketRemapper() {
@Override @Override
public void registerMap() { public void registerMap() {
map(Type.COMPONENT); // Signed content
map(Type.OPTIONAL_COMPONENT); // Unsigned content
handler(wrapper -> { handler(wrapper -> {
final JsonElement signedContnet = wrapper.read(Type.COMPONENT);
final JsonElement unsignedContent = wrapper.read(Type.OPTIONAL_COMPONENT);
wrapper.write(Type.COMPONENT, unsignedContent != null ? unsignedContent : signedContnet);
// Can only be 1 (chat) or 2 (game info) as per 1.18.2->1.19.0 transformer // Can only be 1 (chat) or 2 (game info) as per 1.18.2->1.19.0 transformer
final int type = wrapper.read(Type.VAR_INT); final int type = wrapper.read(Type.VAR_INT);
if (type == 1) { wrapper.write(Type.BOOLEAN, type == 1); // Overlay
return;
}
// Send as system message to allow overlay
wrapper.cancel();
final PacketWrapper systemChatPacket = wrapper.create(ClientboundPackets1_19.SYSTEM_CHAT);
JsonElement content = wrapper.get(Type.OPTIONAL_COMPONENT, 0);
if (content == null) {
content = wrapper.get(Type.COMPONENT, 0);
}
systemChatPacket.write(Type.COMPONENT, content);
systemChatPacket.write(Type.BOOLEAN, true); // Overlay
systemChatPacket.send(Protocol1_19_1To1_19.class);
}); });
read(Type.UUID); // Sender uuid
read(Type.COMPONENT); // Sender display name
read(Type.OPTIONAL_COMPONENT); // Team display name
read(Type.LONG); // Timestamp
read(Type.LONG); // Salt
read(Type.BYTE_ARRAY_PRIMITIVE); // Signature
} }
}); });

Datei anzeigen

@ -1,5 +1,5 @@
# Project properties - we put these here so they can be modified without causing a recompile of the build scripts # Project properties - we put these here so they can be modified without causing a recompile of the build scripts
projectVersion=4.4.0-1.19.1-pre3-SNAPSHOT projectVersion=4.4.0-1.19.1-pre4-SNAPSHOT
# Gradle properties # Gradle properties
org.gradle.daemon=true org.gradle.daemon=true