3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-03 14:50:30 +01:00

Actually make every message a system message (#2903)

Dieser Commit ist enthalten in:
Gero 2022-05-25 21:24:26 +02:00 committet von GitHub
Ursprung b7005f2400
Commit b82b067745
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 26 neuen und 58 gelöschten Zeilen

Datei anzeigen

@ -167,7 +167,10 @@ public final class Protocol1_19To1_18_2 extends AbstractProtocol<ClientboundPack
@Override
public void registerMap() {
map(Type.COMPONENT); // Message
map(Type.BYTE, Type.VAR_INT); // Type
handler(wrapper -> {
int type = wrapper.read(Type.BYTE);
wrapper.write(Type.VAR_INT, type == 2 ? 1 : 0);
});
read(Type.UUID); // Sender
}
});

Datei anzeigen

@ -49,63 +49,28 @@ public final class EntityPackets extends EntityRewriter<Protocol1_19To1_18_2> {
//TODO move to compressed nbt file
private static final String CHAT_REGISTRY_SNBT = "{\n" +
" \"minecraft:chat_type\":{\n" +
" \"type\":\"minecraft:chat_type\",\n" +
" \"value\":[\n" +
" {\n" +
" \"name\":\"minecraft:chat\",\n" +
" \"id\":0,\n" +
" \"element\":{\n" +
" \"chat\":{\n" +
" \"decoration\":{\n" +
" \"translation_key\":\"chat.type.text\",\n" +
" \"style\":{\n" +
" \n" +
" },\n" +
" \"parameters\":[\n" +
" \"sender\",\n" +
" \"content\"\n" +
" ]\n" +
" }\n" +
" },\n" +
" \"narration\":{\n" +
" \"priority\":\"chat\",\n" +
" \"decoration\":{\n" +
" \"translation_key\":\"chat.type.text.narrate\",\n" +
" \"style\":{\n" +
" \n" +
" },\n" +
" \"parameters\":[\n" +
" \"sender\",\n" +
" \"content\"\n" +
" ]\n" +
" }\n" +
" }\n" +
" }\n" +
" },\n" +
" {\n" +
" \"name\":\"minecraft:system\",\n" +
" \"id\":1,\n" +
" \"element\":{\n" +
" \"chat\":{\n" +
" \n" +
" },\n" +
" \"narration\":{\n" +
" \"priority\":\"system\"\n" +
" }\n" +
" }\n" +
" },\n" +
" {\n" +
" \"name\":\"minecraft:game_info\",\n" +
" \"id\":2,\n" +
" \"element\":{\n" +
" \"overlay\":{\n" +
" \n" +
" }\n" +
" }\n" +
" },\n" +
" ]\n" +
" },\n" +
" \"minecraft:chat_type\": {\n" +
" \"type\": \"minecraft:chat_type\",\n" +
" \"value\": [\n" +
" {\n" +
" \"name\": \"minecraft:system\",\n" +
" \"id\": 0,\n" +
" \"element\": {\n" +
" \"chat\": {},\n" +
" \"narration\": {\n" +
" \"priority\": \"system\"\n" +
" }\n" +
" }\n" +
" },\n" +
" {\n" +
" \"name\": \"minecraft:game_info\",\n" +
" \"id\": 1,\n" +
" \"element\": {\n" +
" \"overlay\": {}\n" +
" }\n" +
" }\n" +
" ]\n" +
" }\n" +
"}";
private static final CompoundTag CHAT_REGISTRY;