From 73647ee4fb1601297cbe720f11a189d931972c4c Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 26 Apr 2023 19:06:30 +0200 Subject: [PATCH] 23w17a --- build.gradle.kts | 2 +- .../Protocol1_19_4To1_20.java | 12 +++ .../packets/BlockItemPackets1_20.java | 31 +++++++- .../data/mappings-1.20to1.19.4.nbt | Bin 2855 -> 3192 bytes .../data/translation-mappings.json | 69 ++++++++++++++++++ gradle/libs.versions.toml | 2 +- 6 files changed, 112 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e897d7db..cca4c612 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { allprojects { group = "com.viaversion" - version = "4.7.0-23w16a-SNAPSHOT" + version = "4.7.0-23w17a-SNAPSHOT" description = "Allow older clients to join newer server versions." } diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/Protocol1_19_4To1_20.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/Protocol1_19_4To1_20.java index abf1568f..bc7edb75 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/Protocol1_19_4To1_20.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/Protocol1_19_4To1_20.java @@ -56,6 +56,18 @@ public final class Protocol1_19_4To1_20 extends BackwardsProtocol(this).register(ClientboundPackets1_19_4.STATISTICS); + + //TODO open window + translatableRewriter.registerComponentPacket(ClientboundPackets1_19_4.ACTIONBAR); + translatableRewriter.registerComponentPacket(ClientboundPackets1_19_4.TITLE_TEXT); + translatableRewriter.registerComponentPacket(ClientboundPackets1_19_4.TITLE_SUBTITLE); + translatableRewriter.registerBossBar(ClientboundPackets1_19_4.BOSSBAR); + translatableRewriter.registerDisconnect(ClientboundPackets1_19_4.DISCONNECT); + translatableRewriter.registerTabList(ClientboundPackets1_19_4.TAB_LIST); + translatableRewriter.registerCombatKill(ClientboundPackets1_19_4.COMBAT_KILL); + translatableRewriter.registerComponentPacket(ClientboundPackets1_19_4.SYSTEM_CHAT); + translatableRewriter.registerComponentPacket(ClientboundPackets1_19_4.DISGUISED_CHAT); + translatableRewriter.registerPing(); } @Override diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/packets/BlockItemPackets1_20.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/packets/BlockItemPackets1_20.java index 78731a0c..e6e2e02f 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/packets/BlockItemPackets1_20.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/packets/BlockItemPackets1_20.java @@ -19,8 +19,10 @@ package com.viaversion.viabackwards.protocol.protocol1_19_4to1_20.packets; import com.viaversion.viabackwards.protocol.protocol1_19_4to1_20.Protocol1_19_4To1_20; import com.viaversion.viabackwards.protocol.protocol1_19_4to1_20.storage.BackSignEditStorage; +import com.viaversion.viaversion.api.minecraft.BlockChangeRecord; import com.viaversion.viaversion.api.minecraft.Position; import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity; +import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag; import com.viaversion.viaversion.libs.opennbt.tag.builtin.ListTag; @@ -43,11 +45,36 @@ public final class BlockItemPackets1_20 extends ItemRewriter blockRewriter = new BlockRewriter<>(protocol, Type.POSITION1_14); blockRewriter.registerBlockAction(ClientboundPackets1_19_4.BLOCK_ACTION); blockRewriter.registerBlockChange(ClientboundPackets1_19_4.BLOCK_CHANGE); - blockRewriter.registerVarLongMultiBlockChange(ClientboundPackets1_19_4.MULTI_BLOCK_CHANGE); blockRewriter.registerEffect(ClientboundPackets1_19_4.EFFECT, 1010, 2001); - blockRewriter.registerChunkData1_19(ClientboundPackets1_19_4.CHUNK_DATA, Chunk1_18Type::new, this::handleBlockEntity); blockRewriter.registerBlockEntityData(ClientboundPackets1_19_4.BLOCK_ENTITY_DATA, this::handleBlockEntity); + protocol.registerClientbound(ClientboundPackets1_19_4.CHUNK_DATA, new PacketHandlers() { + @Override + protected void register() { + handler(blockRewriter.chunkDataHandler1_19(Chunk1_18Type::new, BlockItemPackets1_20.this::handleBlockEntity)); + create(Type.BOOLEAN, true); // Trust edges + } + }); + + protocol.registerClientbound(ClientboundPackets1_19_4.UPDATE_LIGHT, wrapper -> { + wrapper.passthrough(Type.VAR_INT); // X + wrapper.passthrough(Type.VAR_INT); // Y + wrapper.write(Type.BOOLEAN, true); // Trust edges + }); + + protocol.registerClientbound(ClientboundPackets1_19_4.MULTI_BLOCK_CHANGE, new PacketHandlers() { + @Override + public void register() { + map(Type.LONG); // Chunk position + create(Type.BOOLEAN, false); // Suppress light updates + handler(wrapper -> { + for (final BlockChangeRecord record : wrapper.passthrough(Type.VAR_LONG_BLOCK_CHANGE_RECORD_ARRAY)) { + record.setBlockId(protocol.getMappingData().getNewBlockStateId(record.getBlockId())); + } + }); + } + }); + registerOpenWindow(ClientboundPackets1_19_4.OPEN_WINDOW); registerSetCooldown(ClientboundPackets1_19_4.COOLDOWN); registerWindowItems1_17_1(ClientboundPackets1_19_4.WINDOW_ITEMS); diff --git a/common/src/main/resources/assets/viabackwards/data/mappings-1.20to1.19.4.nbt b/common/src/main/resources/assets/viabackwards/data/mappings-1.20to1.19.4.nbt index 73fbd490d0bdeddde9225280b2f036d0a013bfc5..678a8f69a10f6d58b7ad16f93e7f3659c8eb9865 100644 GIT binary patch delta 640 zcmaKpziU%b6vxkf@xA+u1szIA3-!IEmWab`ezdk}V^LSZ3gYAtUh-~B+LylczN8ro z4lZ_)GdMX&hpv?lZi0f~U!ZlAT6J?39Q13T3O0D)!#$ky{eI7I_cGtJ`z+F5&XE;# ziD;6aih>;zo$2r!u{{0}-4XZ%j=^ULyI4bb#VXkA7_ISb>rwjkNrJ~m*21k+jwqD} z3QU7}Pz4KM5!Apnu!Mwn;5|45ABgNtU``HsTuaq1Lz(@F!aMc*9ah+>gKp}%uqs6^ z*cDOY`*u;3dB-k^3co}@!{2NrX8EF%6Ic1VlRH00<0Vxt`Zr8F@$Yr`v6JD4jyF=J zvBCVN(S3d;Gor|E9S@OTVJ&l7P9jpt93t;XACa4K3XxBwC+7GCCi8qK^Pq|Y_? zEMIcR;9hclxa)3yq(a%jfxGLyh@Z((Yj);f*L`4ZyL6%5OIpo(*h-qp=&02saw#(y zs(4GAer%#pt;9wr_%oL#POYN2uTA~0;*>emi8cds_8)Vk8bKHZ8(}i^>RNAOHPS<` UCY`_}y8a(UBWO3`_>Y3<7aFs>KmY&$ delta 321 zcmXwzJ4gdj5JhKRvhT%2QmsL;$nHXnRoG9ASt}cB0~XdP1kqrEq|j19Nhfl}&Q@&% zA&p>VB?{uFvlD-XV5Nm!90D0Q!-IG4Vg5!>a_8XmXNFY0O++q^xX5?7;rZMvQSwcA z7d|A=ZuSGADx$7B>B~XK#*dmQChsNoAUq0BMAnM1I;hz_8L4}?O4v9^INg`T8LKeH zo)r!IG#Qja-&t6$w-D$82l%xD4l$v9jtF?QtJ$Fb}H*C|hK`jU6l%?xcTMf49Ifl+e+ diff --git a/common/src/main/resources/assets/viabackwards/data/translation-mappings.json b/common/src/main/resources/assets/viabackwards/data/translation-mappings.json index 155dc071..1de5b183 100644 --- a/common/src/main/resources/assets/viabackwards/data/translation-mappings.json +++ b/common/src/main/resources/assets/viabackwards/data/translation-mappings.json @@ -1,4 +1,73 @@ { + "1.20": { + "advancements.adventure.craft_decorated_pot_using_only_sherds.description": "Make a Decorated Pot out of 4 Pottery Sherds", + "advancements.adventure.craft_decorated_pot_using_only_sherds.title": "Careful restoration", + "advancements.adventure.trim_with_any_armor_pattern.description": "Craft a trimmed armor at a Smithing Table", + "advancements.adventure.trim_with_any_armor_pattern.title": "Crafting a new look", + "advancements.adventure.salvage_sherd.description": "Brush a Suspicious block to obtain a Pottery Sherd", + "advancements.adventure.salvage_sherd.title": "Respecting the remnants", + "advancements.adventure.trim_with_all_exclusive_armor_patterns.description": "Apply these smithing templates at least once: Spire, Snout, Rib, Ward, Silence, Vex, Tide, Wayfinder", + "advancements.adventure.trim_with_all_exclusive_armor_patterns.title": "Smithing with style", + "advancements.husbandry.feed_snifflet.description": "Feed a Snifflet", + "advancements.husbandry.feed_snifflet.title": "Little sniffs", + "advancements.husbandry.obtain_sniffer_egg.description": "Obtain a Sniffer Egg", + "advancements.husbandry.obtain_sniffer_egg.title": "Smells interesting", + "advancements.husbandry.plant_any_sniffer_seed.description": "Plant any Sniffer seed", + "advancements.husbandry.plant_any_sniffer_seed.title": "Planting the past", + "block.minecraft.calibrated_sculk_sensor": "Calibrated Sculk Sensor", + "block.minecraft.sniffer_egg": "Sniffer Egg", + "block.minecraft.suspicious_gravel": "Suspicious Gravel", + "block.minecraft.pitcher_plant": "Pitcher Plant", + "block.minecraft.pitcher_crop": "Pitcher Crop", + "commands.function.success.multiple.result": "Executed %s functions", + "commands.function.success.single.result": "Function '%2$s' returned %1$s", + "gui.toRealms": "Back to Realms List", + "gui.toWorld": "Back to World List", + "item.minecraft.music_disc_relic": "Music Disc", + "item.minecraft.music_disc_relic.desc": "Aaron Cherof - Relic", + "item.minecraft.angler_pottery_sherd": "Angler Pottery Sherd", + "item.minecraft.archer_pottery_sherd": "Archer Pottery Sherd", + "item.minecraft.arms_up_pottery_sherd": "Arms Up Pottery Sherd", + "item.minecraft.blade_pottery_sherd": "Blade Pottery Sherd", + "item.minecraft.brewer_pottery_sherd": "Brewer Pottery Sherd", + "item.minecraft.burn_pottery_sherd": "Burn Pottery Sherd", + "item.minecraft.danger_pottery_sherd": "Danger Pottery Sherd", + "item.minecraft.explorer_pottery_sherd": "Explorer Pottery Sherd", + "item.minecraft.friend_pottery_sherd": "Friend Pottery Sherd", + "item.minecraft.heart_pottery_sherd": "Heart Pottery Sherd", + "item.minecraft.heartbreak_pottery_sherd": "Heartbreak Pottery Sherd", + "item.minecraft.howl_pottery_sherd": "Howl Pottery Sherd", + "item.minecraft.miner_pottery_sherd": "Miner Pottery Sherd", + "item.minecraft.mourner_pottery_sherd": "Mourner Pottery Sherd", + "item.minecraft.plenty_pottery_sherd": "Plenty Pottery Sherd", + "item.minecraft.prize_pottery_sherd": "Prize Pottery Sherd", + "item.minecraft.sheaf_pottery_sherd": "Sheaf Pottery Sherd", + "item.minecraft.shelter_pottery_sherd": "Shelter Pottery Sherd", + "item.minecraft.skull_pottery_sherd": "Skull Pottery Sherd", + "item.minecraft.snort_pottery_sherd": "Snort Pottery Sherd", + "item.minecraft.pitcher_plant": "Pitcher Plant", + "item.minecraft.pitcher_pod": "Pitcher Pod", + "multiplayer.disconnect.invalid_public_key_signature.new": "Invalid signature for profile public key.\nTry restarting your game.", + "quickplay.error.title": "Failed to Quick Play", + "quickplay.error.invalid_identifier": "Could not find world with the provided identifier", + "quickplay.error.realm_connect": "Could not connect to Realm", + "quickplay.error.realm_permission": "Lacking permission to connect to this Realm", + "subtitles.block.amethyst_block.resonate": "Amethyst resonates", + "subtitles.block.sign.waxed_interact_fail": "Sign wobbles", + "subtitles.block.sniffer_egg.plop": "Sniffer plops", + "subtitles.block.sniffer_egg.crack": "Sniffer Egg cracks", + "subtitles.block.sniffer_egg.hatch": "Sniffer Egg hatches", + "subtitles.item.brush.brushing.generic": "Brushing", + "subtitles.item.brush.brushing.sand": "Brushing Sand", + "subtitles.item.brush.brushing.gravel": "Brushing Gravel", + "subtitles.item.brush.brushing.sand.complete": "Brushing Sand completed", + "subtitles.item.brush.brushing.gravel.complete": "Brushing Gravel completed", + "trim_pattern.minecraft.host": "Host Armor Trim", + "trim_pattern.minecraft.raiser": "Raiser Armor Trim", + "trim_pattern.minecraft.shaper": "Shaper Armor Trim", + "trim_pattern.minecraft.silence": "Silence Armor Trim", + "trim_pattern.minecraft.wayfinder": "Wayfinder Armor Trim" + }, "1.19.4": { "accessibility.onboarding.screen.narrator": "Press enter to enable the narrator", "accessibility.onboarding.screen.title": "Welcome to Minecraft!\n\nWould you like to enable the Narrator or visit the Accessibility Settings?", diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 82ca5eac..1db1b8ba 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ metadata.format.version = "1.1" [versions] # ViaVersion -viaver = "4.7.0-23w12a-SNAPSHOT" +viaver = "4.7.0-23w17a-SNAPSHOT" # Common provided netty = "4.0.20.Final"