From ec2093cf5db7c74a55e0cc444d04f186232ed96c Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 26 Oct 2023 10:20:18 +1000 Subject: [PATCH] 23w43a --- .../api/protocol/version/ProtocolVersion.java | 2 +- .../Protocol1_20_3To1_20_2.java | 16 +- .../packet/ClientboundPackets1_20_3.java | 149 ++++++++++++++++++ .../rewriter/EntityPacketRewriter1_20_3.java | 3 +- .../data/mappings-1.20.2to1.20.3.nbt | Bin 492 -> 612 bytes gradle.properties | 2 +- 6 files changed, 167 insertions(+), 5 deletions(-) create mode 100644 common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/packet/ClientboundPackets1_20_3.java diff --git a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java index 848b40520..0ad5c9363 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java +++ b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java @@ -85,7 +85,7 @@ public class ProtocolVersion { public static final ProtocolVersion v1_19_4 = register(762, "1.19.4"); public static final ProtocolVersion v1_20 = register(763, "1.20/1.20.1", new VersionRange("1.20", 0, 1)); public static final ProtocolVersion v1_20_2 = register(764, "1.20.2"); - public static final ProtocolVersion v1_20_3 = register(765, 157, "1.20.3"); + public static final ProtocolVersion v1_20_3 = register(765, 159, "1.20.3"); public static final ProtocolVersion unknown = register(-1, "UNKNOWN"); public static ProtocolVersion register(int version, String name) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/Protocol1_20_3To1_20_2.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/Protocol1_20_3To1_20_2.java index fb3434163..d852bfe62 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/Protocol1_20_3To1_20_2.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/Protocol1_20_3To1_20_2.java @@ -56,6 +56,7 @@ import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.Clientbou import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundPackets1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ServerboundConfigurationPackets1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ServerboundPackets1_20_2; +import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundPackets1_20_3; import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ServerboundPackets1_20_3; import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.rewriter.BlockItemPacketRewriter1_20_3; import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.rewriter.EntityPacketRewriter1_20_3; @@ -70,7 +71,7 @@ import java.util.Set; import java.util.UUID; import org.checkerframework.checker.nullness.qual.Nullable; -public final class Protocol1_20_3To1_20_2 extends AbstractProtocol { +public final class Protocol1_20_3To1_20_2 extends AbstractProtocol { public static final MappingData MAPPINGS = new MappingDataBase("1.20.2", "1.20.3"); private static final Set BOOLEAN_TYPES = new HashSet<>(Arrays.asList( @@ -85,7 +86,7 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol(this).register(ClientboundPackets1_20_2.STATISTICS); + registerServerbound(ServerboundPackets1_20_3.UPDATE_JIGSAW_BLOCK, wrapper -> { + wrapper.passthrough(Type.POSITION1_14); // Position + wrapper.passthrough(Type.STRING); // Name + wrapper.passthrough(Type.STRING); // Target + wrapper.passthrough(Type.STRING); // Pool + wrapper.passthrough(Type.STRING); // Final state + wrapper.passthrough(Type.STRING); // Joint type + wrapper.read(Type.VAR_INT); // Selection priority + wrapper.read(Type.VAR_INT); // Placement priority + }); + // Components are now (mostly) written as nbt instead of json strings registerClientbound(ClientboundPackets1_20_2.ADVANCEMENTS, wrapper -> { wrapper.passthrough(Type.BOOLEAN); // Reset/clear diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/packet/ClientboundPackets1_20_3.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/packet/ClientboundPackets1_20_3.java new file mode 100644 index 000000000..f1c15f4f2 --- /dev/null +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/packet/ClientboundPackets1_20_3.java @@ -0,0 +1,149 @@ +/* + * This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion + * Copyright (C) 2016-2023 ViaVersion and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet; + +import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; + +public enum ClientboundPackets1_20_3 implements ClientboundPacketType { + + BUNDLE, // 0x00 + SPAWN_ENTITY, // 0x01 + SPAWN_EXPERIENCE_ORB, // 0x02 + ENTITY_ANIMATION, // 0x03 + STATISTICS, // 0x04 + BLOCK_CHANGED_ACK, // 0x05 + BLOCK_BREAK_ANIMATION, // 0x06 + BLOCK_ENTITY_DATA, // 0x07 + BLOCK_ACTION, // 0x08 + BLOCK_CHANGE, // 0x09 + BOSSBAR, // 0x0A + SERVER_DIFFICULTY, // 0x0B + CHUNK_BATCH_FINISHED, // 0x0C + CHUNK_BATCH_START, // 0x0D + CHUNK_BIOMES, // 0x0E + CLEAR_TITLES, // 0x0F + TAB_COMPLETE, // 0x10 + DECLARE_COMMANDS, // 0x11 + CLOSE_WINDOW, // 0x12 + WINDOW_ITEMS, // 0x13 + WINDOW_PROPERTY, // 0x14 + SET_SLOT, // 0x15 + COOLDOWN, // 0x16 + CUSTOM_CHAT_COMPLETIONS, // 0x17 + PLUGIN_MESSAGE, // 0x18 + DAMAGE_EVENT, // 0x19 + DELETE_CHAT_MESSAGE, // 0x1A + DISCONNECT, // 0x1B + DISGUISED_CHAT, // 0x1C + ENTITY_STATUS, // 0x1D + EXPLOSION, // 0x1E + UNLOAD_CHUNK, // 0x1F + GAME_EVENT, // 0x20 + OPEN_HORSE_WINDOW, // 0x21 + HIT_ANIMATION, // 0x22 + WORLD_BORDER_INIT, // 0x23 + KEEP_ALIVE, // 0x24 + CHUNK_DATA, // 0x25 + EFFECT, // 0x26 + SPAWN_PARTICLE, // 0x27 + UPDATE_LIGHT, // 0x28 + JOIN_GAME, // 0x29 + MAP_DATA, // 0x2A + TRADE_LIST, // 0x2B + ENTITY_POSITION, // 0x2C + ENTITY_POSITION_AND_ROTATION, // 0x2D + ENTITY_ROTATION, // 0x2E + VEHICLE_MOVE, // 0x2F + OPEN_BOOK, // 0x30 + OPEN_WINDOW, // 0x31 + OPEN_SIGN_EDITOR, // 0x32 + PING, // 0x33 + PONG_RESPONSE, // 0x34 + CRAFT_RECIPE_RESPONSE, // 0x35 + PLAYER_ABILITIES, // 0x36 + PLAYER_CHAT, // 0x37 + COMBAT_END, // 0x38 + COMBAT_ENTER, // 0x39 + COMBAT_KILL, // 0x3A + PLAYER_INFO_REMOVE, // 0x3B + PLAYER_INFO_UPDATE, // 0x3C + FACE_PLAYER, // 0x3D + PLAYER_POSITION, // 0x3E + UNLOCK_RECIPES, // 0x3F + REMOVE_ENTITIES, // 0x40 + REMOVE_ENTITY_EFFECT, // 0x41 + RESOURCE_PACK, // 0x42 + RESPAWN, // 0x43 + ENTITY_HEAD_LOOK, // 0x44 + MULTI_BLOCK_CHANGE, // 0x45 + SELECT_ADVANCEMENTS_TAB, // 0x46 + SERVER_DATA, // 0x47 + ACTIONBAR, // 0x48 + WORLD_BORDER_CENTER, // 0x49 + WORLD_BORDER_LERP_SIZE, // 0x4A + WORLD_BORDER_SIZE, // 0x4B + WORLD_BORDER_WARNING_DELAY, // 0x4C + WORLD_BORDER_WARNING_DISTANCE, // 0x4D + CAMERA, // 0x4E + HELD_ITEM_CHANGE, // 0x4F + UPDATE_VIEW_POSITION, // 0x50 + UPDATE_VIEW_DISTANCE, // 0x51 + SPAWN_POSITION, // 0x52 + DISPLAY_SCOREBOARD, // 0x53 + ENTITY_METADATA, // 0x54 + ATTACH_ENTITY, // 0x55 + ENTITY_VELOCITY, // 0x56 + ENTITY_EQUIPMENT, // 0x57 + SET_EXPERIENCE, // 0x58 + UPDATE_HEALTH, // 0x59 + SCOREBOARD_OBJECTIVE, // 0x5A + SET_PASSENGERS, // 0x5B + TEAMS, // 0x5C + UPDATE_SCORE, // 0x5D + SET_SIMULATION_DISTANCE, // 0x5E + TITLE_SUBTITLE, // 0x5F + TIME_UPDATE, // 0x60 + TITLE_TEXT, // 0x61 + TITLE_TIMES, // 0x62 + ENTITY_SOUND, // 0x63 + SOUND, // 0x64 + START_CONFIGURATION, // 0x65 + STOP_SOUND, // 0x66 + SYSTEM_CHAT, // 0x67 + TAB_LIST, // 0x68 + NBT_QUERY, // 0x69 + COLLECT_ITEM, // 0x6A + ENTITY_TELEPORT, // 0x6B + TICKING_STATE,// 0x6C + TICKING_STEP, // 0x6D + ADVANCEMENTS, // 0x6E + ENTITY_PROPERTIES, // 0x6F + ENTITY_EFFECT, // 0x70 + DECLARE_RECIPES, // 0x71 + TAGS; // 0x72 + + @Override + public int getId() { + return ordinal(); + } + + @Override + public String getName() { + return name(); + } +} diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/rewriter/EntityPacketRewriter1_20_3.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/rewriter/EntityPacketRewriter1_20_3.java index 0d4b3d0b8..0d5292224 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/rewriter/EntityPacketRewriter1_20_3.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_3to1_20_2/rewriter/EntityPacketRewriter1_20_3.java @@ -29,6 +29,7 @@ import com.viaversion.viaversion.api.type.types.version.Types1_20_3; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundConfigurationPackets1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundPackets1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.Protocol1_20_3To1_20_2; +import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundPackets1_20_3; import com.viaversion.viaversion.rewriter.EntityRewriter; public final class EntityPacketRewriter1_20_3 extends EntityRewriter { @@ -87,7 +88,7 @@ public final class EntityPacketRewriter1_20_3 extends EntityRewriterx)4Id9H$&WQ^caL%HB5oaj?%|)Zz%YxIQ^vkF);3j^aN8w(4 z9swt|20acn17`96;^@5r-7oo}4a|O!Pr$nYT8F^?E6~1RpvP24Jp(t$cX=G7*1auY{x HG6nnrIdW>t delta 210 zcmaFD@`ibW9#cHaL<31%W(Eean?QVvfkA2xHv>~iJ_7>-P*7?%L_%r~0~Z5ZQciwy zb}=&pS8ifKL262HW>qRs)tia)B$a?_8U8acFajw?3nT*=&7l$&6F*8YvAmef%_u1Z zRK>g&rU=AYH#v?`%H|Ry15;)SBQpa_G1z3*vp_Y8B@mY|+5k=VVPIe_hiL>_$!G_} N0YJf;$yXRB006(RC#L`a diff --git a/gradle.properties b/gradle.properties index e3590298a..ff3e2d506 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project properties - we put these here so they can be modified without causing a recompile of the build scripts -projectVersion=4.9.0-23w42a-SNAPSHOT +projectVersion=4.9.0-23w43a-SNAPSHOT # Smile emoji mcVersions=1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13, 1.12.2, 1.12.1, 1.12, 1.11.2, 1.11.1, 1.11, 1.10.2, 1.10.1, 1.10, 1.9.4, 1.9.3, 1.9.2, 1.9.1, 1.9, 1.8.9