From 3c749bd9397c98baebbb3d1558c5021449e88a23 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 18 Feb 2023 10:32:09 +0100 Subject: [PATCH] Handle translation additions --- .../Protocol1_19_1To1_19_3.java | 4 +- .../Protocol1_19_3To1_19_4.java | 15 +- .../packets/EntityPackets1_19_4.java | 8 +- .../data/translation-mappings.json | 223 ++++++++++++++++++ 4 files changed, 243 insertions(+), 7 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_1to1_19_3/Protocol1_19_1To1_19_3.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_1to1_19_3/Protocol1_19_1To1_19_3.java index d1293200..7c09032f 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_1to1_19_3/Protocol1_19_1To1_19_3.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_1to1_19_3/Protocol1_19_1To1_19_3.java @@ -57,8 +57,8 @@ import java.util.BitSet; public final class Protocol1_19_1To1_19_3 extends BackwardsProtocol { public static final BackwardsMappings MAPPINGS = new BackwardsMappings(); - private static final ByteArrayType.OptionalByteArrayType OPTIONAL_SIGNATURE_BYTES_TYPE = new ByteArrayType.OptionalByteArrayType(256); - private static final ByteArrayType SIGNATURE_BYTES_TYPE = new ByteArrayType(256); + public static final ByteArrayType.OptionalByteArrayType OPTIONAL_SIGNATURE_BYTES_TYPE = new ByteArrayType.OptionalByteArrayType(256); + public static final ByteArrayType SIGNATURE_BYTES_TYPE = new ByteArrayType(256); private final EntityPackets1_19_3 entityRewriter = new EntityPackets1_19_3(this); private final BlockItemPackets1_19_3 itemRewriter = new BlockItemPackets1_19_3(this); private final TranslatableRewriter translatableRewriter = new TranslatableRewriter<>(this); diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/Protocol1_19_3To1_19_4.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/Protocol1_19_3To1_19_4.java index 7e827dca..9330cd08 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/Protocol1_19_3To1_19_4.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/Protocol1_19_3To1_19_4.java @@ -20,6 +20,7 @@ package com.viaversion.viabackwards.protocol.protocol1_19_3to1_19_4; import com.viaversion.viabackwards.api.BackwardsProtocol; import com.viaversion.viabackwards.api.data.BackwardsMappings; import com.viaversion.viabackwards.api.rewriters.SoundRewriter; +import com.viaversion.viabackwards.api.rewriters.TranslatableRewriter; import com.viaversion.viabackwards.protocol.protocol1_19_3to1_19_4.packets.BlockItemPackets1_19_4; import com.viaversion.viabackwards.protocol.protocol1_19_3to1_19_4.packets.EntityPackets1_19_4; import com.viaversion.viaversion.api.connection.UserConnection; @@ -43,6 +44,7 @@ public final class Protocol1_19_3To1_19_4 extends BackwardsProtocol translatableRewriter = new TranslatableRewriter<>(this); public Protocol1_19_3To1_19_4() { super(ClientboundPackets1_19_4.class, ClientboundPackets1_19_3.class, ServerboundPackets1_19_4.class, ServerboundPackets1_19_3.class); @@ -51,7 +53,6 @@ public final class Protocol1_19_3To1_19_4 extends BackwardsProtocol { MAPPINGS.load(); entityRewriter.onMappingDataLoaded(); @@ -65,6 +66,18 @@ public final class Protocol1_19_3To1_19_4 extends BackwardsProtocol(this) { @Override public void handleArgument(final PacketWrapper wrapper, final String argumentType) throws Exception { diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/packets/EntityPackets1_19_4.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/packets/EntityPackets1_19_4.java index 03fb78ae..326f4d1e 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/packets/EntityPackets1_19_4.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/packets/EntityPackets1_19_4.java @@ -134,7 +134,7 @@ public final class EntityPackets1_19_4 extends EntityRewriter { // TODO Maybe spawn an extra entity to ride the armor stand for blocks and items @@ -159,9 +159,9 @@ public final class EntityPackets1_19_4 extends EntityRewriter { - storage.add(new Metadata(0, Types1_19_4.META_TYPES.byteType, (byte) 0x20)); // Invisible - storage.add(new Metadata(5, Types1_19_4.META_TYPES.booleanType, true)); // No gravity - storage.add(new Metadata(15, Types1_19_4.META_TYPES.byteType, (byte) (0x01 | 0x10))); // Small marker + storage.add(new Metadata(0, Types1_19_3.META_TYPES.byteType, (byte) 0x20)); // Invisible + storage.add(new Metadata(5, Types1_19_3.META_TYPES.booleanType, true)); // No gravity + storage.add(new Metadata(15, Types1_19_3.META_TYPES.byteType, (byte) (0x01 | 0x10))); // Small marker }; mapEntityTypeWithData(Entity1_19_4Types.TEXT_DISPLAY, Entity1_19_4Types.ARMOR_STAND).spawnMetadata(displayMetaCreator); mapEntityTypeWithData(Entity1_19_4Types.ITEM_DISPLAY, Entity1_19_4Types.ARMOR_STAND).spawnMetadata(displayMetaCreator); 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 2c8d1f71..fcb6155c 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,227 @@ { + "1.19.4": { + "argument.time.tick_count_too_low": "Tick count must not be less than %s, found %s", + "biome.minecraft.cherry_grove": "Cherry Grove", + "block.minecraft.cherry_button": "Cherry Button", + "block.minecraft.cherry_door": "Cherry Door", + "block.minecraft.cherry_fence": "Cherry Fence", + "block.minecraft.cherry_fence_gate": "Cherry Fence Gate", + "block.minecraft.cherry_hanging_sign": "Cherry Hanging Sign", + "block.minecraft.cherry_leaves": "Cherry Leaves", + "block.minecraft.cherry_log": "Cherry Log", + "block.minecraft.cherry_planks": "Cherry Planks", + "block.minecraft.cherry_pressure_plate": "Cherry Pressure Plate", + "block.minecraft.cherry_sapling": "Cherry Sapling", + "block.minecraft.cherry_sign": "Cherry Sign", + "block.minecraft.cherry_slab": "Cherry Slab", + "block.minecraft.cherry_stairs": "Cherry Stairs", + "block.minecraft.cherry_trapdoor": "Cherry Trapdoor", + "block.minecraft.cherry_wall_hanging_sign": "Cherry Wall Hanging Sign", + "block.minecraft.cherry_wall_sign": "Cherry Wall Sign", + "block.minecraft.cherry_wood": "Cherry Wood", + "block.minecraft.decorated_pot": "Decorated Pot", + "block.minecraft.pink_petals": "Pink Petals", + "block.minecraft.potted_cherry_sapling": "Potted Cherry Sapling", + "block.minecraft.potted_torchflower": "Potted Torchflower", + "block.minecraft.stripped_cherry_log": "Stripped Cherry Log", + "block.minecraft.stripped_cherry_wood": "Stripped Cherry Wood", + "block.minecraft.suspicious_sand": "Suspicious Sand", + "block.minecraft.torchflower": "Torchflower", + "block.minecraft.torchflower_crop": "Torchflower Crop", + "commands.damage.invulnerable": "Target is invulnerable to the given damage type", + "commands.damage.success": "Applied %s damage to %s", + "commands.data.modify.expected_value": "Expected value, got: %s", + "commands.ride.already_riding": "%s is already riding %s", + "commands.ride.dismount.success": "%s stopped riding %s", + "commands.ride.mount.failure.cant_ride_players": "Players can't be ridden", + "commands.ride.mount.failure.generic": "%s couldn't start riding %s", + "commands.ride.mount.failure.loop": "Can't mount entity on itself or any of its passengers", + "commands.ride.mount.failure.wrong_dimension": "Can't mount entity in different dimension", + "commands.ride.mount.success": "%s started riding %s", + "commands.ride.not_riding": "%s is not riding any vehicle", + "container.upgrade.error_tooltip": "Your item cannot be upgraded in this way", + "container.upgrade.missing_template_tooltip": "Put a Smithing Template here", + "controls.keybinds.duplicateKeybinds": "This key is also used for:\n%s", + "createWorld.tab.game.title": "Game", + "createWorld.tab.more.title": "More...", + "createWorld.tab.world.title": "World", + "dataPack.bundle.name": "Bundles", + "dataPack.update_1_20.name": "Update 1.20", + "effect.duration.infinite": "?", + "entity.minecraft.block_display": "Block Display", + "entity.minecraft.falling_block_type": "Falling %s", + "entity.minecraft.interaction": "Interaction", + "entity.minecraft.item_display": "Item Display", + "entity.minecraft.sniffer": "Sniffer", + "entity.minecraft.text_display": "Text Display", + "gamerule.commandModificationBlockLimit": "Command Modification Block Limit", + "gamerule.commandModificationBlockLimit.description": "Number of blocks that can be changed at once by one command, such as fill or clone.", + "gamerule.doVinesSpread": "Vines spread", + "gamerule.doVinesSpread.description": "Controls whether or not the Vines block spreads randomly to adjacent blocks. Does not affect other type of vine blocks such as Weeping Vines, Twisting Vines, etc.", + "gui.banned.reason.defamation_impersonation_false_information": "Impersonation or sharing information to exploit or mislead others", + "gui.banned.reason.drugs": "References to illegal drugs", + "gui.banned.reason.extreme_violence_or_gore": "Depictions of real-life excessive violence or gore", + "gui.banned.reason.false_reporting": "Excessive false or inaccurate reports", + "gui.banned.reason.fraud": "Fraudulent acquisition or use of content", + "gui.banned.reason.generic_violation": "Violating Community Standards", + "gui.banned.reason.harassment_or_bullying": "Abusive language used in a directed, harmful manner", + "gui.banned.reason.hate_speech": "Hate speech or discrimination", + "gui.banned.reason.hate_terrorism_notorious_figure": "References to hate groups, terrorist organizations, or notorious figures", + "gui.banned.reason.imminent_harm_to_person_or_property": "Intent to cause real-life harm to persons or property", + "gui.banned.reason.nudity_or_pornography": "Displaying lewd or pornographic material", + "gui.banned.reason.sexually_inappropriate": "Topics or content of a sexual nature", + "gui.banned.reason.spam_or_advertising": "Spam or advertising", + "gui.continue": "Continue", + "gui.narrate.tab": "%s tab", + "item.minecraft.brush": "Brush", + "item.minecraft.cherry_boat": "Cherry Boat", + "item.minecraft.cherry_chest_boat": "Cherry Boat with Chest", + "item.minecraft.pottery_shard_archer": "Archer Pottery Shard", + "item.minecraft.pottery_shard_arms_up": "Arms Up Pottery Shard", + "item.minecraft.pottery_shard_prize": "Prize Pottery Shard", + "item.minecraft.pottery_shard_skull": "Skull Pottery Shard", + "item.minecraft.smithing_template": "Smithing Template", + "item.minecraft.smithing_template.applies_to": "Applies to:", + "item.minecraft.smithing_template.armor_trim.additions_slot_description": "Put an ingot or crystal here", + "item.minecraft.smithing_template.armor_trim.applies_to": "Armor", + "item.minecraft.smithing_template.armor_trim.base_slot_description": "Put a piece of armor here", + "item.minecraft.smithing_template.armor_trim.ingredients": "Ingots & Crystals", + "item.minecraft.smithing_template.ingredients": "Ingredients:", + "item.minecraft.smithing_template.netherite_upgrade.additions_slot_description": "Put a Netherite Ingot here", + "item.minecraft.smithing_template.netherite_upgrade.applies_to": "Diamond Equipment", + "item.minecraft.smithing_template.netherite_upgrade.base_slot_description": "Put a piece of Diamond armor, weapon or tool here", + "item.minecraft.smithing_template.netherite_upgrade.ingredients": "Netherite Ingot", + "item.minecraft.smithing_template.upgrade": "Upgrade: ", + "item.minecraft.sniffer_spawn_egg": "Sniffer Spawn Egg", + "item.minecraft.torchflower_seeds": "Torchflower Seeds", + "multiplayer.lan.server_found": "New server found: %s", + "multiplayer.player.list.narration": "Online players: %s", + "multiplayer.status.motd.narration": "Message of the day: %s", + "multiplayer.status.online": "Online", + "multiplayer.status.ping.narration": "Ping %s milliseconds", + "multiplayer.status.player_count.narration": "%s out of %s players online", + "multiplayer.status.version.narration": "Server version: %s", + "narrator.ready_to_play": "Ready to play", + "options.damageTiltStrength": "Damage Tilt", + "options.damageTiltStrength.tooltip": "The amount of camera shake caused by being hurt.", + "options.difficulty.easy.info": "Hostile mobs spawn but deal less damage. Hunger bar depletes and drains health down to 5 hearts.", + "options.difficulty.hard.info": "Hostile mobs spawn and deal more damage. Hunger bar depletes and drains all health.", + "options.difficulty.normal.info": "Hostile mobs spawn and deal standard damage. Hunger bar depletes and drains health down to half a heart.", + "options.difficulty.peaceful.info": "No hostile mobs and only some neutral mobs spawn. Hunger bar doesn't deplete and health replenishes over time.", + "options.glintSpeed": "Glint Speed", + "options.glintSpeed.tooltip": "Controls how fast the visual glint shimmers across enchanted items.", + "options.glintStrength": "Glint Strength", + "options.glintStrength.tooltip": "Controls how transparent the visual glint is on enchanted items.", + "options.multiplier": "%sx", + "options.notifications.display_time": "Notification Time", + "options.notifications.display_time.tooltip": "Affects the length of time that all notifications stay visible on the screen.", + "painting.dimensions": "%sx%s", + "painting.minecraft.alban.author": "Kristoffer Zetterstrand", + "painting.minecraft.alban.title": "Albanian", + "painting.minecraft.aztec.author": "Kristoffer Zetterstrand", + "painting.minecraft.aztec.title": "de_aztec", + "painting.minecraft.aztec2.author": "Kristoffer Zetterstrand", + "painting.minecraft.aztec2.title": "de_aztec", + "painting.minecraft.bomb.author": "Kristoffer Zetterstrand", + "painting.minecraft.bomb.title": "Target Successfully Bombed", + "painting.minecraft.burning_skull.author": "Kristoffer Zetterstrand", + "painting.minecraft.burning_skull.title": "Skull On Fire", + "painting.minecraft.bust.author": "Kristoffer Zetterstrand", + "painting.minecraft.bust.title": "Bust", + "painting.minecraft.courbet.author": "Kristoffer Zetterstrand", + "painting.minecraft.courbet.title": "Bonjour Monsieur Courbet", + "painting.minecraft.creebet.author": "Kristoffer Zetterstrand", + "painting.minecraft.creebet.title": "Creebet", + "painting.minecraft.donkey_kong.author": "Kristoffer Zetterstrand", + "painting.minecraft.donkey_kong.title": "Kong", + "painting.minecraft.earth.author": "Mojang", + "painting.minecraft.earth.title": "Earth", + "painting.minecraft.fighters.author": "Kristoffer Zetterstrand", + "painting.minecraft.fighters.title": "Fighters", + "painting.minecraft.fire.author": "Mojang", + "painting.minecraft.fire.title": "Fire", + "painting.minecraft.graham.author": "Kristoffer Zetterstrand", + "painting.minecraft.graham.title": "Graham", + "painting.minecraft.kebab.author": "Kristoffer Zetterstrand", + "painting.minecraft.kebab.title": "Kebab med tre pepperoni", + "painting.minecraft.match.author": "Kristoffer Zetterstrand", + "painting.minecraft.match.title": "Match", + "painting.minecraft.pigscene.author": "Kristoffer Zetterstrand", + "painting.minecraft.pigscene.title": "Pigscene", + "painting.minecraft.plant.author": "Kristoffer Zetterstrand", + "painting.minecraft.plant.title": "Paradistr�d", + "painting.minecraft.pointer.author": "Kristoffer Zetterstrand", + "painting.minecraft.pointer.title": "Pointer", + "painting.minecraft.pool.author": "Kristoffer Zetterstrand", + "painting.minecraft.pool.title": "The Pool", + "painting.minecraft.sea.author": "Kristoffer Zetterstrand", + "painting.minecraft.sea.title": "Seaside", + "painting.minecraft.skeleton.author": "Kristoffer Zetterstrand", + "painting.minecraft.skeleton.title": "Mortal Coil", + "painting.minecraft.skull_and_roses.author": "Kristoffer Zetterstrand", + "painting.minecraft.skull_and_roses.title": "Skull and Roses", + "painting.minecraft.stage.author": "Kristoffer Zetterstrand", + "painting.minecraft.stage.title": "The Stage Is Set", + "painting.minecraft.sunset.author": "Kristoffer Zetterstrand", + "painting.minecraft.sunset.title": "sunset_dense", + "painting.minecraft.void.author": "Kristoffer Zetterstrand", + "painting.minecraft.void.title": "The void", + "painting.minecraft.wanderer.author": "Kristoffer Zetterstrand", + "painting.minecraft.wanderer.title": "Wanderer", + "painting.minecraft.wasteland.author": "Kristoffer Zetterstrand", + "painting.minecraft.wasteland.title": "Wasteland", + "painting.minecraft.water.author": "Mojang", + "painting.minecraft.water.title": "Water", + "painting.minecraft.wind.author": "Mojang", + "painting.minecraft.wind.title": "Wind", + "painting.minecraft.wither.author": "Mojang", + "painting.minecraft.wither.title": "Wither", + "painting.random": "Random variant", + "selectWorld.experiments": "Experiments", + "selectWorld.experiments.info": "Experiments are potential new features. Be careful as things might break. Experiments can't be turned off after world creation.", + "selectWorld.gameMode.adventure.info": "Same as Survival Mode, but blocks can't be added or removed", + "selectWorld.gameMode.creative.info": "Create, build, and explore without limits. You can fly, have endless materials, and can't be hurt by monsters.", + "selectWorld.gameMode.hardcore.info": "Survival mode locked to 'Hard' difficulty. You can't respawn if you die.", + "selectWorld.gameMode.spectator.info": "You can look but don't touch", + "selectWorld.gameMode.survival.info": "Explore a mysterious world where you build, collect, craft, and fight monsters.", + "subtitles.block.decorated_pot.shatter": "Pot shatters", + "subtitles.entity.sniffer.death": "Sniffer dies", + "subtitles.entity.sniffer.digging": "Sniffer digs", + "subtitles.entity.sniffer.digging_stop": "Sniffer stands up", + "subtitles.entity.sniffer.drop_seed": "Sniffer drops seed", + "subtitles.entity.sniffer.eat": "Sniffer eats", + "subtitles.entity.sniffer.happy": "Sniffer delights", + "subtitles.entity.sniffer.hurt": "Sniffer hurts", + "subtitles.entity.sniffer.idle": "Sniffer grunts", + "subtitles.entity.sniffer.scenting": "Sniffer scents", + "subtitles.entity.sniffer.searching": "Sniffer searches", + "subtitles.entity.sniffer.sniffing": "Sniffer sniffs", + "subtitles.entity.sniffer.step": "Sniffer steps", + "subtitles.item.brush.brush_sand_completed": "Brushing sand completed", + "subtitles.item.brush.brushing": "Brushing", + "trim_material.minecraft.amethyst": "Amethyst Material", + "trim_material.minecraft.copper": "Copper Material", + "trim_material.minecraft.diamond": "Diamond Material", + "trim_material.minecraft.emerald": "Emerald Material", + "trim_material.minecraft.gold": "Gold Material", + "trim_material.minecraft.iron": "Iron Material", + "trim_material.minecraft.lapis": "Lapis Material", + "trim_material.minecraft.netherite": "Netherite Material", + "trim_material.minecraft.quartz": "Quartz Material", + "trim_material.minecraft.redstone": "Redstone Material", + "trim_pattern.minecraft.coast": "Coast Armor Trim", + "trim_pattern.minecraft.dune": "Dune Armor Trim", + "trim_pattern.minecraft.eye": "Eye Armor Trim", + "trim_pattern.minecraft.rib": "Rib Armor Trim", + "trim_pattern.minecraft.sentry": "Sentry Armor Trim", + "trim_pattern.minecraft.snout": "Snout Armor Trim", + "trim_pattern.minecraft.spire": "Spire Armor Trim", + "trim_pattern.minecraft.tide": "Tide Armor Trim", + "trim_pattern.minecraft.vex": "Vex Armor Trim", + "trim_pattern.minecraft.ward": "Ward Armor Trim", + "trim_pattern.minecraft.wild": "Wild Armor Trim", + "upgrade.minecraft.netherite_upgrade": "Netherite Upgrade" + }, "1.19.3": { "gui.chatReport.discard.draft": "Save as Draft", "gui.chatReport.draft.title": "Edit draft chat report?",