From d30b3b1006ab7a5d3678aa0b260ee10fcf724b30 Mon Sep 17 00:00:00 2001 From: Andrew Brower Date: Tue, 5 Nov 2024 03:06:59 -0500 Subject: [PATCH] fix(net): send 1.21 registries on connect --- assets/registries.json | 2489 +++++++++++++++++ src/net/player.rs | 18 +- src/protocol/packets/login/registry/banner.rs | 2 +- src/protocol/packets/login/registry/biome.rs | 20 +- src/protocol/packets/login/registry/chat.rs | 4 +- src/protocol/packets/login/registry/damage.rs | 2 +- .../packets/login/registry/dimension.rs | 53 +- src/protocol/packets/login/registry/mod.rs | 78 +- .../packets/login/registry/painting.rs | 2 +- src/protocol/packets/login/registry/trim.rs | 11 +- src/protocol/packets/login/registry/wolf.rs | 2 +- 11 files changed, 2629 insertions(+), 52 deletions(-) create mode 100644 assets/registries.json diff --git a/assets/registries.json b/assets/registries.json new file mode 100644 index 0000000..db2ad39 --- /dev/null +++ b/assets/registries.json @@ -0,0 +1,2489 @@ +{ + "minecraft:banner_pattern": { + "minecraft:base": { + "asset_id": "minecraft:base", + "translation_key": "block.minecraft.banner.base" + }, + "minecraft:border": { + "asset_id": "minecraft:border", + "translation_key": "block.minecraft.banner.border" + }, + "minecraft:bricks": { + "asset_id": "minecraft:bricks", + "translation_key": "block.minecraft.banner.bricks" + }, + "minecraft:circle": { + "asset_id": "minecraft:circle", + "translation_key": "block.minecraft.banner.circle" + }, + "minecraft:creeper": { + "asset_id": "minecraft:creeper", + "translation_key": "block.minecraft.banner.creeper" + }, + "minecraft:cross": { + "asset_id": "minecraft:cross", + "translation_key": "block.minecraft.banner.cross" + }, + "minecraft:curly_border": { + "asset_id": "minecraft:curly_border", + "translation_key": "block.minecraft.banner.curly_border" + }, + "minecraft:diagonal_left": { + "asset_id": "minecraft:diagonal_left", + "translation_key": "block.minecraft.banner.diagonal_left" + }, + "minecraft:diagonal_right": { + "asset_id": "minecraft:diagonal_right", + "translation_key": "block.minecraft.banner.diagonal_right" + }, + "minecraft:diagonal_up_left": { + "asset_id": "minecraft:diagonal_up_left", + "translation_key": "block.minecraft.banner.diagonal_up_left" + }, + "minecraft:diagonal_up_right": { + "asset_id": "minecraft:diagonal_up_right", + "translation_key": "block.minecraft.banner.diagonal_up_right" + }, + "minecraft:flow": { + "asset_id": "minecraft:flow", + "translation_key": "block.minecraft.banner.flow" + }, + "minecraft:flower": { + "asset_id": "minecraft:flower", + "translation_key": "block.minecraft.banner.flower" + }, + "minecraft:globe": { + "asset_id": "minecraft:globe", + "translation_key": "block.minecraft.banner.globe" + }, + "minecraft:gradient": { + "asset_id": "minecraft:gradient", + "translation_key": "block.minecraft.banner.gradient" + }, + "minecraft:gradient_up": { + "asset_id": "minecraft:gradient_up", + "translation_key": "block.minecraft.banner.gradient_up" + }, + "minecraft:guster": { + "asset_id": "minecraft:guster", + "translation_key": "block.minecraft.banner.guster" + }, + "minecraft:half_horizontal": { + "asset_id": "minecraft:half_horizontal", + "translation_key": "block.minecraft.banner.half_horizontal" + }, + "minecraft:half_horizontal_bottom": { + "asset_id": "minecraft:half_horizontal_bottom", + "translation_key": "block.minecraft.banner.half_horizontal_bottom" + }, + "minecraft:half_vertical": { + "asset_id": "minecraft:half_vertical", + "translation_key": "block.minecraft.banner.half_vertical" + }, + "minecraft:half_vertical_right": { + "asset_id": "minecraft:half_vertical_right", + "translation_key": "block.minecraft.banner.half_vertical_right" + }, + "minecraft:mojang": { + "asset_id": "minecraft:mojang", + "translation_key": "block.minecraft.banner.mojang" + }, + "minecraft:piglin": { + "asset_id": "minecraft:piglin", + "translation_key": "block.minecraft.banner.piglin" + }, + "minecraft:rhombus": { + "asset_id": "minecraft:rhombus", + "translation_key": "block.minecraft.banner.rhombus" + }, + "minecraft:skull": { + "asset_id": "minecraft:skull", + "translation_key": "block.minecraft.banner.skull" + }, + "minecraft:small_stripes": { + "asset_id": "minecraft:small_stripes", + "translation_key": "block.minecraft.banner.small_stripes" + }, + "minecraft:square_bottom_left": { + "asset_id": "minecraft:square_bottom_left", + "translation_key": "block.minecraft.banner.square_bottom_left" + }, + "minecraft:square_bottom_right": { + "asset_id": "minecraft:square_bottom_right", + "translation_key": "block.minecraft.banner.square_bottom_right" + }, + "minecraft:square_top_left": { + "asset_id": "minecraft:square_top_left", + "translation_key": "block.minecraft.banner.square_top_left" + }, + "minecraft:square_top_right": { + "asset_id": "minecraft:square_top_right", + "translation_key": "block.minecraft.banner.square_top_right" + }, + "minecraft:straight_cross": { + "asset_id": "minecraft:straight_cross", + "translation_key": "block.minecraft.banner.straight_cross" + }, + "minecraft:stripe_bottom": { + "asset_id": "minecraft:stripe_bottom", + "translation_key": "block.minecraft.banner.stripe_bottom" + }, + "minecraft:stripe_center": { + "asset_id": "minecraft:stripe_center", + "translation_key": "block.minecraft.banner.stripe_center" + }, + "minecraft:stripe_downleft": { + "asset_id": "minecraft:stripe_downleft", + "translation_key": "block.minecraft.banner.stripe_downleft" + }, + "minecraft:stripe_downright": { + "asset_id": "minecraft:stripe_downright", + "translation_key": "block.minecraft.banner.stripe_downright" + }, + "minecraft:stripe_left": { + "asset_id": "minecraft:stripe_left", + "translation_key": "block.minecraft.banner.stripe_left" + }, + "minecraft:stripe_middle": { + "asset_id": "minecraft:stripe_middle", + "translation_key": "block.minecraft.banner.stripe_middle" + }, + "minecraft:stripe_right": { + "asset_id": "minecraft:stripe_right", + "translation_key": "block.minecraft.banner.stripe_right" + }, + "minecraft:stripe_top": { + "asset_id": "minecraft:stripe_top", + "translation_key": "block.minecraft.banner.stripe_top" + }, + "minecraft:triangle_bottom": { + "asset_id": "minecraft:triangle_bottom", + "translation_key": "block.minecraft.banner.triangle_bottom" + }, + "minecraft:triangle_top": { + "asset_id": "minecraft:triangle_top", + "translation_key": "block.minecraft.banner.triangle_top" + }, + "minecraft:triangles_bottom": { + "asset_id": "minecraft:triangles_bottom", + "translation_key": "block.minecraft.banner.triangles_bottom" + }, + "minecraft:triangles_top": { + "asset_id": "minecraft:triangles_top", + "translation_key": "block.minecraft.banner.triangles_top" + } + }, + "minecraft:chat_type": { + "minecraft:chat": { + "chat": { + "parameters": [ + "sender", + "content" + ], + "translation_key": "chat.type.text" + }, + "narration": { + "parameters": [ + "sender", + "content" + ], + "translation_key": "chat.type.text.narrate" + } + }, + "minecraft:emote_command": { + "chat": { + "parameters": [ + "sender", + "content" + ], + "translation_key": "chat.type.emote" + }, + "narration": { + "parameters": [ + "sender", + "content" + ], + "translation_key": "chat.type.emote" + } + }, + "minecraft:msg_command_incoming": { + "chat": { + "parameters": [ + "sender", + "content" + ], + "translation_key": "commands.message.display.incoming" + }, + "narration": { + "parameters": [ + "sender", + "content" + ], + "translation_key": "chat.type.text.narrate" + } + }, + "minecraft:msg_command_outgoing": { + "chat": { + "parameters": [ + "target", + "content" + ], + "translation_key": "commands.message.display.outgoing" + }, + "narration": { + "parameters": [ + "sender", + "content" + ], + "translation_key": "chat.type.text.narrate" + } + }, + "minecraft:say_command": { + "chat": { + "parameters": [ + "sender", + "content" + ], + "translation_key": "chat.type.announcement" + }, + "narration": { + "parameters": [ + "sender", + "content" + ], + "translation_key": "chat.type.text.narrate" + } + }, + "minecraft:team_msg_command_incoming": { + "chat": { + "parameters": [ + "target", + "sender", + "content" + ], + "translation_key": "chat.type.team.text" + }, + "narration": { + "parameters": [ + "sender", + "content" + ], + "translation_key": "chat.type.text.narrate" + } + }, + "minecraft:team_msg_command_outgoing": { + "chat": { + "parameters": [ + "target", + "sender", + "content" + ], + "translation_key": "chat.type.team.sent" + }, + "narration": { + "parameters": [ + "sender", + "content" + ], + "translation_key": "chat.type.text.narrate" + } + } + }, + "minecraft:damage_type": { + "minecraft:arrow": { + "exhaustion": 0.10000000149011612, + "message_id": "arrow", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:bad_respawn_point": { + "exhaustion": 0.10000000149011612, + "message_id": "badRespawnPoint", + "scaling": "always" + }, + "minecraft:cactus": { + "exhaustion": 0.10000000149011612, + "message_id": "cactus", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:campfire": { + "exhaustion": 0.10000000149011612, + "message_id": "inFire", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:cramming": { + "exhaustion": 0.0, + "message_id": "cramming", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:dragon_breath": { + "exhaustion": 0.0, + "message_id": "dragonBreath", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:drown": { + "exhaustion": 0.0, + "message_id": "drown", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:dry_out": { + "exhaustion": 0.10000000149011612, + "message_id": "dryout", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:explosion": { + "exhaustion": 0.10000000149011612, + "message_id": "explosion", + "scaling": "always" + }, + "minecraft:fall": { + "exhaustion": 0.0, + "message_id": "fall", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:falling_anvil": { + "exhaustion": 0.10000000149011612, + "message_id": "anvil", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:falling_block": { + "exhaustion": 0.10000000149011612, + "message_id": "fallingBlock", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:falling_stalactite": { + "exhaustion": 0.10000000149011612, + "message_id": "fallingStalactite", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:fireball": { + "exhaustion": 0.10000000149011612, + "message_id": "fireball", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:fireworks": { + "exhaustion": 0.10000000149011612, + "message_id": "fireworks", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:fly_into_wall": { + "exhaustion": 0.0, + "message_id": "flyIntoWall", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:freeze": { + "exhaustion": 0.0, + "message_id": "freeze", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:generic": { + "exhaustion": 0.0, + "message_id": "generic", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:generic_kill": { + "exhaustion": 0.0, + "message_id": "genericKill", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:hot_floor": { + "exhaustion": 0.10000000149011612, + "message_id": "hotFloor", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:in_fire": { + "exhaustion": 0.10000000149011612, + "message_id": "inFire", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:in_wall": { + "exhaustion": 0.0, + "message_id": "inWall", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:indirect_magic": { + "exhaustion": 0.0, + "message_id": "indirectMagic", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:lava": { + "exhaustion": 0.10000000149011612, + "message_id": "lava", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:lightning_bolt": { + "exhaustion": 0.10000000149011612, + "message_id": "lightningBolt", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:magic": { + "exhaustion": 0.0, + "message_id": "magic", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:mob_attack": { + "exhaustion": 0.10000000149011612, + "message_id": "mob", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:mob_attack_no_aggro": { + "exhaustion": 0.10000000149011612, + "message_id": "mob", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:mob_projectile": { + "exhaustion": 0.10000000149011612, + "message_id": "mob", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:on_fire": { + "exhaustion": 0.0, + "message_id": "onFire", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:out_of_world": { + "exhaustion": 0.0, + "message_id": "outOfWorld", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:outside_border": { + "exhaustion": 0.0, + "message_id": "outsideBorder", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:player_attack": { + "exhaustion": 0.10000000149011612, + "message_id": "player", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:player_explosion": { + "exhaustion": 0.10000000149011612, + "message_id": "explosion.player", + "scaling": "always" + }, + "minecraft:sonic_boom": { + "exhaustion": 0.0, + "message_id": "sonic_boom", + "scaling": "always" + }, + "minecraft:spit": { + "exhaustion": 0.10000000149011612, + "message_id": "mob", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:stalagmite": { + "exhaustion": 0.0, + "message_id": "stalagmite", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:starve": { + "exhaustion": 0.0, + "message_id": "starve", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:sting": { + "exhaustion": 0.10000000149011612, + "message_id": "sting", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:sweet_berry_bush": { + "exhaustion": 0.10000000149011612, + "message_id": "sweetBerryBush", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:thorns": { + "exhaustion": 0.10000000149011612, + "message_id": "thorns", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:thrown": { + "exhaustion": 0.10000000149011612, + "message_id": "thrown", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:trident": { + "exhaustion": 0.10000000149011612, + "message_id": "trident", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:unattributed_fireball": { + "exhaustion": 0.10000000149011612, + "message_id": "onFire", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:wind_charge": { + "exhaustion": 0.10000000149011612, + "message_id": "mob", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:wither": { + "exhaustion": 0.0, + "message_id": "wither", + "scaling": "when_caused_by_living_non_player" + }, + "minecraft:wither_skull": { + "exhaustion": 0.10000000149011612, + "message_id": "witherSkull", + "scaling": "when_caused_by_living_non_player" + } + }, + "minecraft:dimension_type": { + "minecraft:overworld": { + "ambient_light": 0.0, + "bed_works": 1, + "coordinate_scale": 1.0, + "effects": "minecraft:overworld", + "has_ceiling": 0, + "has_raids": 1, + "has_skylight": 1, + "height": 384, + "infiniburn": "#minecraft:infiniburn_overworld", + "logical_height": 384, + "min_y": -64, + "monster_spawn_block_light_limit": 0, + "monster_spawn_light_level": { + "max_inclusive": 7, + "min_inclusive": 0, + "type": "minecraft:uniform" + }, + "natural": 1, + "piglin_safe": 0, + "respawn_anchor_works": 0, + "ultrawarm": 0 + }, + "minecraft:overworld_caves": { + "ambient_light": 0.0, + "bed_works": 1, + "coordinate_scale": 1.0, + "effects": "minecraft:overworld", + "has_ceiling": 1, + "has_raids": 1, + "has_skylight": 1, + "height": 384, + "infiniburn": "#minecraft:infiniburn_overworld", + "logical_height": 384, + "min_y": -64, + "monster_spawn_block_light_limit": 0, + "monster_spawn_light_level": { + "max_inclusive": 7, + "min_inclusive": 0, + "type": "minecraft:uniform" + }, + "natural": 1, + "piglin_safe": 0, + "respawn_anchor_works": 0, + "ultrawarm": 0 + }, + "minecraft:the_end": { + "ambient_light": 0.0, + "bed_works": 0, + "coordinate_scale": 1.0, + "effects": "minecraft:the_end", + "has_ceiling": 0, + "has_raids": 1, + "has_skylight": 0, + "height": 256, + "infiniburn": "#minecraft:infiniburn_end", + "logical_height": 256, + "min_y": 0, + "monster_spawn_block_light_limit": 0, + "monster_spawn_light_level": { + "max_inclusive": 7, + "min_inclusive": 0, + "type": "minecraft:uniform" + }, + "natural": 0, + "piglin_safe": 0, + "respawn_anchor_works": 0, + "ultrawarm": 0 + }, + "minecraft:the_nether": { + "ambient_light": 0.10000000149011612, + "bed_works": 0, + "coordinate_scale": 8.0, + "effects": "minecraft:the_nether", + "has_ceiling": 1, + "has_raids": 0, + "has_skylight": 0, + "height": 256, + "infiniburn": "#minecraft:infiniburn_nether", + "logical_height": 128, + "min_y": 0, + "monster_spawn_block_light_limit": 15, + "monster_spawn_light_level": { + "max_inclusive": 7, + "min_inclusive": 7, + "type": "minecraft:uniform" + }, + "natural": 0, + "piglin_safe": 1, + "respawn_anchor_works": 1, + "ultrawarm": 1 + } + }, + "minecraft:painting_variant": { + "minecraft:alban": { + "asset_id": "minecraft:alban", + "height": 1, + "width": 1 + }, + "minecraft:aztec": { + "asset_id": "minecraft:aztec", + "height": 1, + "width": 1 + }, + "minecraft:aztec2": { + "asset_id": "minecraft:aztec2", + "height": 1, + "width": 1 + }, + "minecraft:backyard": { + "asset_id": "minecraft:backyard", + "height": 4, + "width": 3 + }, + "minecraft:baroque": { + "asset_id": "minecraft:baroque", + "height": 2, + "width": 2 + }, + "minecraft:bomb": { + "asset_id": "minecraft:bomb", + "height": 1, + "width": 1 + }, + "minecraft:bouquet": { + "asset_id": "minecraft:bouquet", + "height": 3, + "width": 3 + }, + "minecraft:burning_skull": { + "asset_id": "minecraft:burning_skull", + "height": 4, + "width": 4 + }, + "minecraft:bust": { + "asset_id": "minecraft:bust", + "height": 2, + "width": 2 + }, + "minecraft:cavebird": { + "asset_id": "minecraft:cavebird", + "height": 3, + "width": 3 + }, + "minecraft:changing": { + "asset_id": "minecraft:changing", + "height": 2, + "width": 4 + }, + "minecraft:cotan": { + "asset_id": "minecraft:cotan", + "height": 3, + "width": 3 + }, + "minecraft:courbet": { + "asset_id": "minecraft:courbet", + "height": 1, + "width": 2 + }, + "minecraft:creebet": { + "asset_id": "minecraft:creebet", + "height": 1, + "width": 2 + }, + "minecraft:donkey_kong": { + "asset_id": "minecraft:donkey_kong", + "height": 3, + "width": 4 + }, + "minecraft:earth": { + "asset_id": "minecraft:earth", + "height": 2, + "width": 2 + }, + "minecraft:endboss": { + "asset_id": "minecraft:endboss", + "height": 3, + "width": 3 + }, + "minecraft:fern": { + "asset_id": "minecraft:fern", + "height": 3, + "width": 3 + }, + "minecraft:fighters": { + "asset_id": "minecraft:fighters", + "height": 2, + "width": 4 + }, + "minecraft:finding": { + "asset_id": "minecraft:finding", + "height": 2, + "width": 4 + }, + "minecraft:fire": { + "asset_id": "minecraft:fire", + "height": 2, + "width": 2 + }, + "minecraft:graham": { + "asset_id": "minecraft:graham", + "height": 2, + "width": 1 + }, + "minecraft:humble": { + "asset_id": "minecraft:humble", + "height": 2, + "width": 2 + }, + "minecraft:kebab": { + "asset_id": "minecraft:kebab", + "height": 1, + "width": 1 + }, + "minecraft:lowmist": { + "asset_id": "minecraft:lowmist", + "height": 2, + "width": 4 + }, + "minecraft:match": { + "asset_id": "minecraft:match", + "height": 2, + "width": 2 + }, + "minecraft:meditative": { + "asset_id": "minecraft:meditative", + "height": 1, + "width": 1 + }, + "minecraft:orb": { + "asset_id": "minecraft:orb", + "height": 4, + "width": 4 + }, + "minecraft:owlemons": { + "asset_id": "minecraft:owlemons", + "height": 3, + "width": 3 + }, + "minecraft:passage": { + "asset_id": "minecraft:passage", + "height": 2, + "width": 4 + }, + "minecraft:pigscene": { + "asset_id": "minecraft:pigscene", + "height": 4, + "width": 4 + }, + "minecraft:plant": { + "asset_id": "minecraft:plant", + "height": 1, + "width": 1 + }, + "minecraft:pointer": { + "asset_id": "minecraft:pointer", + "height": 4, + "width": 4 + }, + "minecraft:pond": { + "asset_id": "minecraft:pond", + "height": 4, + "width": 3 + }, + "minecraft:pool": { + "asset_id": "minecraft:pool", + "height": 1, + "width": 2 + }, + "minecraft:prairie_ride": { + "asset_id": "minecraft:prairie_ride", + "height": 2, + "width": 1 + }, + "minecraft:sea": { + "asset_id": "minecraft:sea", + "height": 1, + "width": 2 + }, + "minecraft:skeleton": { + "asset_id": "minecraft:skeleton", + "height": 3, + "width": 4 + }, + "minecraft:skull_and_roses": { + "asset_id": "minecraft:skull_and_roses", + "height": 2, + "width": 2 + }, + "minecraft:stage": { + "asset_id": "minecraft:stage", + "height": 2, + "width": 2 + }, + "minecraft:sunflowers": { + "asset_id": "minecraft:sunflowers", + "height": 3, + "width": 3 + }, + "minecraft:sunset": { + "asset_id": "minecraft:sunset", + "height": 1, + "width": 2 + }, + "minecraft:tides": { + "asset_id": "minecraft:tides", + "height": 3, + "width": 3 + }, + "minecraft:unpacked": { + "asset_id": "minecraft:unpacked", + "height": 4, + "width": 4 + }, + "minecraft:void": { + "asset_id": "minecraft:void", + "height": 2, + "width": 2 + }, + "minecraft:wanderer": { + "asset_id": "minecraft:wanderer", + "height": 2, + "width": 1 + }, + "minecraft:wasteland": { + "asset_id": "minecraft:wasteland", + "height": 1, + "width": 1 + }, + "minecraft:water": { + "asset_id": "minecraft:water", + "height": 2, + "width": 2 + }, + "minecraft:wind": { + "asset_id": "minecraft:wind", + "height": 2, + "width": 2 + }, + "minecraft:wither": { + "asset_id": "minecraft:wither", + "height": 2, + "width": 2 + } + }, + "minecraft:trim_material": { + "minecraft:amethyst": { + "asset_name": "amethyst", + "description": { + "color": "#9A5CC6", + "translate": "trim_material.minecraft.amethyst" + }, + "ingredient": "minecraft:amethyst_shard", + "item_model_index": 1.0 + }, + "minecraft:copper": { + "asset_name": "copper", + "description": { + "color": "#B4684D", + "translate": "trim_material.minecraft.copper" + }, + "ingredient": "minecraft:copper_ingot", + "item_model_index": 0.5 + }, + "minecraft:diamond": { + "asset_name": "diamond", + "description": { + "color": "#6EECD2", + "translate": "trim_material.minecraft.diamond" + }, + "ingredient": "minecraft:diamond", + "item_model_index": 0.800000011920929 + }, + "minecraft:emerald": { + "asset_name": "emerald", + "description": { + "color": "#11A036", + "translate": "trim_material.minecraft.emerald" + }, + "ingredient": "minecraft:emerald", + "item_model_index": 0.699999988079071 + }, + "minecraft:gold": { + "asset_name": "gold", + "description": { + "color": "#DEB12D", + "translate": "trim_material.minecraft.gold" + }, + "ingredient": "minecraft:gold_ingot", + "item_model_index": 0.6000000238418579 + }, + "minecraft:iron": { + "asset_name": "iron", + "description": { + "color": "#ECECEC", + "translate": "trim_material.minecraft.iron" + }, + "ingredient": "minecraft:iron_ingot", + "item_model_index": 0.20000000298023224 + }, + "minecraft:lapis": { + "asset_name": "lapis", + "description": { + "color": "#416E97", + "translate": "trim_material.minecraft.lapis" + }, + "ingredient": "minecraft:lapis_lazuli", + "item_model_index": 0.8999999761581421 + }, + "minecraft:netherite": { + "asset_name": "netherite", + "description": { + "color": "#625859", + "translate": "trim_material.minecraft.netherite" + }, + "ingredient": "minecraft:netherite_ingot", + "item_model_index": 0.30000001192092896 + }, + "minecraft:quartz": { + "asset_name": "quartz", + "description": { + "color": "#E3D4C4", + "translate": "trim_material.minecraft.quartz" + }, + "ingredient": "minecraft:quartz", + "item_model_index": 0.10000000149011612 + }, + "minecraft:redstone": { + "asset_name": "redstone", + "description": { + "color": "#971607", + "translate": "trim_material.minecraft.redstone" + }, + "ingredient": "minecraft:redstone", + "item_model_index": 0.4000000059604645 + } + }, + "minecraft:trim_pattern": { + "minecraft:bolt": { + "asset_id": "minecraft:bolt", + "description": { + "translate": "trim_pattern.minecraft.bolt" + }, + "template_item": "minecraft:bolt_armor_trim_smithing_template" + }, + "minecraft:coast": { + "asset_id": "minecraft:coast", + "description": { + "translate": "trim_pattern.minecraft.coast" + }, + "template_item": "minecraft:coast_armor_trim_smithing_template" + }, + "minecraft:dune": { + "asset_id": "minecraft:dune", + "description": { + "translate": "trim_pattern.minecraft.dune" + }, + "template_item": "minecraft:dune_armor_trim_smithing_template" + }, + "minecraft:eye": { + "asset_id": "minecraft:eye", + "description": { + "translate": "trim_pattern.minecraft.eye" + }, + "template_item": "minecraft:eye_armor_trim_smithing_template" + }, + "minecraft:flow": { + "asset_id": "minecraft:flow", + "description": { + "translate": "trim_pattern.minecraft.flow" + }, + "template_item": "minecraft:flow_armor_trim_smithing_template" + }, + "minecraft:host": { + "asset_id": "minecraft:host", + "description": { + "translate": "trim_pattern.minecraft.host" + }, + "template_item": "minecraft:host_armor_trim_smithing_template" + }, + "minecraft:raiser": { + "asset_id": "minecraft:raiser", + "description": { + "translate": "trim_pattern.minecraft.raiser" + }, + "template_item": "minecraft:raiser_armor_trim_smithing_template" + }, + "minecraft:rib": { + "asset_id": "minecraft:rib", + "description": { + "translate": "trim_pattern.minecraft.rib" + }, + "template_item": "minecraft:rib_armor_trim_smithing_template" + }, + "minecraft:sentry": { + "asset_id": "minecraft:sentry", + "description": { + "translate": "trim_pattern.minecraft.sentry" + }, + "template_item": "minecraft:sentry_armor_trim_smithing_template" + }, + "minecraft:shaper": { + "asset_id": "minecraft:shaper", + "description": { + "translate": "trim_pattern.minecraft.shaper" + }, + "template_item": "minecraft:shaper_armor_trim_smithing_template" + }, + "minecraft:silence": { + "asset_id": "minecraft:silence", + "description": { + "translate": "trim_pattern.minecraft.silence" + }, + "template_item": "minecraft:silence_armor_trim_smithing_template" + }, + "minecraft:snout": { + "asset_id": "minecraft:snout", + "description": { + "translate": "trim_pattern.minecraft.snout" + }, + "template_item": "minecraft:snout_armor_trim_smithing_template" + }, + "minecraft:spire": { + "asset_id": "minecraft:spire", + "description": { + "translate": "trim_pattern.minecraft.spire" + }, + "template_item": "minecraft:spire_armor_trim_smithing_template" + }, + "minecraft:tide": { + "asset_id": "minecraft:tide", + "description": { + "translate": "trim_pattern.minecraft.tide" + }, + "template_item": "minecraft:tide_armor_trim_smithing_template" + }, + "minecraft:vex": { + "asset_id": "minecraft:vex", + "description": { + "translate": "trim_pattern.minecraft.vex" + }, + "template_item": "minecraft:vex_armor_trim_smithing_template" + }, + "minecraft:ward": { + "asset_id": "minecraft:ward", + "description": { + "translate": "trim_pattern.minecraft.ward" + }, + "template_item": "minecraft:ward_armor_trim_smithing_template" + }, + "minecraft:wayfinder": { + "asset_id": "minecraft:wayfinder", + "description": { + "translate": "trim_pattern.minecraft.wayfinder" + }, + "template_item": "minecraft:wayfinder_armor_trim_smithing_template" + }, + "minecraft:wild": { + "asset_id": "minecraft:wild", + "description": { + "translate": "trim_pattern.minecraft.wild" + }, + "template_item": "minecraft:wild_armor_trim_smithing_template" + } + }, + "minecraft:wolf_variant": { + "minecraft:ashen": { + "angry_texture": "minecraft:entity/wolf/wolf_ashen_angry", + "biomes": "minecraft:snowy_taiga", + "tame_texture": "minecraft:entity/wolf/wolf_ashen_tame", + "wild_texture": "minecraft:entity/wolf/wolf_ashen" + }, + "minecraft:black": { + "angry_texture": "minecraft:entity/wolf/wolf_black_angry", + "biomes": "minecraft:old_growth_pine_taiga", + "tame_texture": "minecraft:entity/wolf/wolf_black_tame", + "wild_texture": "minecraft:entity/wolf/wolf_black" + }, + "minecraft:chestnut": { + "angry_texture": "minecraft:entity/wolf/wolf_chestnut_angry", + "biomes": "minecraft:old_growth_spruce_taiga", + "tame_texture": "minecraft:entity/wolf/wolf_chestnut_tame", + "wild_texture": "minecraft:entity/wolf/wolf_chestnut" + }, + "minecraft:pale": { + "angry_texture": "minecraft:entity/wolf/wolf_angry", + "biomes": "minecraft:taiga", + "tame_texture": "minecraft:entity/wolf/wolf_tame", + "wild_texture": "minecraft:entity/wolf/wolf" + }, + "minecraft:rusty": { + "angry_texture": "minecraft:entity/wolf/wolf_rusty_angry", + "biomes": "#minecraft:is_jungle", + "tame_texture": "minecraft:entity/wolf/wolf_rusty_tame", + "wild_texture": "minecraft:entity/wolf/wolf_rusty" + }, + "minecraft:snowy": { + "angry_texture": "minecraft:entity/wolf/wolf_snowy_angry", + "biomes": "minecraft:grove", + "tame_texture": "minecraft:entity/wolf/wolf_snowy_tame", + "wild_texture": "minecraft:entity/wolf/wolf_snowy" + }, + "minecraft:spotted": { + "angry_texture": "minecraft:entity/wolf/wolf_spotted_angry", + "biomes": "#minecraft:is_savanna", + "tame_texture": "minecraft:entity/wolf/wolf_spotted_tame", + "wild_texture": "minecraft:entity/wolf/wolf_spotted" + }, + "minecraft:striped": { + "angry_texture": "minecraft:entity/wolf/wolf_striped_angry", + "biomes": "#minecraft:is_badlands", + "tame_texture": "minecraft:entity/wolf/wolf_striped_tame", + "wild_texture": "minecraft:entity/wolf/wolf_striped" + }, + "minecraft:woods": { + "angry_texture": "minecraft:entity/wolf/wolf_woods_angry", + "biomes": "minecraft:forest", + "tame_texture": "minecraft:entity/wolf/wolf_woods_tame", + "wild_texture": "minecraft:entity/wolf/wolf_woods" + } + }, + "minecraft:worldgen/biome": { + "minecraft:badlands": { + "downfall": 0.0, + "effects": { + "fog_color": 12638463, + "foliage_color": 10387789, + "grass_color": 9470285, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.badlands" + }, + "sky_color": 7254527, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 2.0 + }, + "minecraft:bamboo_jungle": { + "downfall": 0.8999999761581421, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.bamboo_jungle" + }, + "sky_color": 7842047, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.949999988079071 + }, + "minecraft:basalt_deltas": { + "downfall": 0.0, + "effects": { + "additions_sound": { + "sound": "minecraft:ambient.basalt_deltas.additions", + "tick_chance": 0.0111 + }, + "ambient_sound": "minecraft:ambient.basalt_deltas.loop", + "fog_color": 6840176, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.basalt_deltas.mood", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.nether.basalt_deltas" + }, + "particle": { + "options": { + "type": "minecraft:white_ash" + }, + "probability": 0.118093334 + }, + "sky_color": 7254527, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 2.0 + }, + "minecraft:beach": { + "downfall": 0.4000000059604645, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 7907327, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.800000011920929 + }, + "minecraft:birch_forest": { + "downfall": 0.6000000238418579, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.forest" + }, + "sky_color": 8037887, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.6000000238418579 + }, + "minecraft:cherry_grove": { + "downfall": 0.800000011920929, + "effects": { + "fog_color": 12638463, + "foliage_color": 11983713, + "grass_color": 11983713, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.cherry_grove" + }, + "sky_color": 8103167, + "water_color": 6141935, + "water_fog_color": 6141935 + }, + "has_precipitation": true, + "temperature": 0.5 + }, + "minecraft:cold_ocean": { + "downfall": 0.5, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8103167, + "water_color": 4020182, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.5 + }, + "minecraft:crimson_forest": { + "downfall": 0.0, + "effects": { + "additions_sound": { + "sound": "minecraft:ambient.crimson_forest.additions", + "tick_chance": 0.0111 + }, + "ambient_sound": "minecraft:ambient.crimson_forest.loop", + "fog_color": 3343107, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.crimson_forest.mood", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.nether.crimson_forest" + }, + "particle": { + "options": { + "type": "minecraft:crimson_spore" + }, + "probability": 0.025 + }, + "sky_color": 7254527, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 2.0 + }, + "minecraft:dark_forest": { + "downfall": 0.800000011920929, + "effects": { + "fog_color": 12638463, + "grass_color_modifier": "dark_forest", + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.forest" + }, + "sky_color": 7972607, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.699999988079071 + }, + "minecraft:deep_cold_ocean": { + "downfall": 0.5, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8103167, + "water_color": 4020182, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.5 + }, + "minecraft:deep_dark": { + "downfall": 0.4000000059604645, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.deep_dark" + }, + "sky_color": 7907327, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.800000011920929 + }, + "minecraft:deep_frozen_ocean": { + "downfall": 0.5, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8103167, + "water_color": 3750089, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.5 + }, + "minecraft:deep_lukewarm_ocean": { + "downfall": 0.5, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8103167, + "water_color": 4566514, + "water_fog_color": 267827 + }, + "has_precipitation": true, + "temperature": 0.5 + }, + "minecraft:deep_ocean": { + "downfall": 0.5, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8103167, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.5 + }, + "minecraft:desert": { + "downfall": 0.0, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.desert" + }, + "sky_color": 7254527, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 2.0 + }, + "minecraft:dripstone_caves": { + "downfall": 0.4000000059604645, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.dripstone_caves" + }, + "sky_color": 7907327, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.800000011920929 + }, + "minecraft:end_barrens": { + "downfall": 0.5, + "effects": { + "fog_color": 10518688, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 0, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 0.5 + }, + "minecraft:end_highlands": { + "downfall": 0.5, + "effects": { + "fog_color": 10518688, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 0, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 0.5 + }, + "minecraft:end_midlands": { + "downfall": 0.5, + "effects": { + "fog_color": 10518688, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 0, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 0.5 + }, + "minecraft:eroded_badlands": { + "downfall": 0.0, + "effects": { + "fog_color": 12638463, + "foliage_color": 10387789, + "grass_color": 9470285, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.badlands" + }, + "sky_color": 7254527, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 2.0 + }, + "minecraft:flower_forest": { + "downfall": 0.800000011920929, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.flower_forest" + }, + "sky_color": 7972607, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.699999988079071 + }, + "minecraft:forest": { + "downfall": 0.800000011920929, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.forest" + }, + "sky_color": 7972607, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.699999988079071 + }, + "minecraft:frozen_ocean": { + "downfall": 0.5, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8364543, + "water_color": 3750089, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.0 + }, + "minecraft:frozen_peaks": { + "downfall": 0.8999999761581421, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.frozen_peaks" + }, + "sky_color": 8756735, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": -0.699999988079071 + }, + "minecraft:frozen_river": { + "downfall": 0.5, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8364543, + "water_color": 3750089, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.0 + }, + "minecraft:grove": { + "downfall": 0.800000011920929, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.grove" + }, + "sky_color": 8495359, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": -0.20000000298023224 + }, + "minecraft:ice_spikes": { + "downfall": 0.5, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8364543, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.0 + }, + "minecraft:jagged_peaks": { + "downfall": 0.8999999761581421, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.jagged_peaks" + }, + "sky_color": 8756735, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": -0.699999988079071 + }, + "minecraft:jungle": { + "downfall": 0.8999999761581421, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.jungle" + }, + "sky_color": 7842047, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.949999988079071 + }, + "minecraft:lukewarm_ocean": { + "downfall": 0.5, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8103167, + "water_color": 4566514, + "water_fog_color": 267827 + }, + "has_precipitation": true, + "temperature": 0.5 + }, + "minecraft:lush_caves": { + "downfall": 0.5, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.lush_caves" + }, + "sky_color": 8103167, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.5 + }, + "minecraft:mangrove_swamp": { + "downfall": 0.8999999761581421, + "effects": { + "fog_color": 12638463, + "foliage_color": 9285927, + "grass_color_modifier": "swamp", + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.swamp" + }, + "sky_color": 7907327, + "water_color": 3832426, + "water_fog_color": 5077600 + }, + "has_precipitation": true, + "temperature": 0.800000011920929 + }, + "minecraft:meadow": { + "downfall": 0.800000011920929, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.meadow" + }, + "sky_color": 8103167, + "water_color": 937679, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.5 + }, + "minecraft:mushroom_fields": { + "downfall": 1.0, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 7842047, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.8999999761581421 + }, + "minecraft:nether_wastes": { + "downfall": 0.0, + "effects": { + "additions_sound": { + "sound": "minecraft:ambient.nether_wastes.additions", + "tick_chance": 0.0111 + }, + "ambient_sound": "minecraft:ambient.nether_wastes.loop", + "fog_color": 3344392, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.nether_wastes.mood", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.nether.nether_wastes" + }, + "sky_color": 7254527, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 2.0 + }, + "minecraft:ocean": { + "downfall": 0.5, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8103167, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.5 + }, + "minecraft:old_growth_birch_forest": { + "downfall": 0.6000000238418579, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.forest" + }, + "sky_color": 8037887, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.6000000238418579 + }, + "minecraft:old_growth_pine_taiga": { + "downfall": 0.800000011920929, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.old_growth_taiga" + }, + "sky_color": 8168447, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.30000001192092896 + }, + "minecraft:old_growth_spruce_taiga": { + "downfall": 0.800000011920929, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.old_growth_taiga" + }, + "sky_color": 8233983, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.25 + }, + "minecraft:plains": { + "downfall": 0.4000000059604645, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 7907327, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.800000011920929 + }, + "minecraft:river": { + "downfall": 0.5, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8103167, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.5 + }, + "minecraft:savanna": { + "downfall": 0.0, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 7254527, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 2.0 + }, + "minecraft:savanna_plateau": { + "downfall": 0.0, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 7254527, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 2.0 + }, + "minecraft:small_end_islands": { + "downfall": 0.5, + "effects": { + "fog_color": 10518688, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 0, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 0.5 + }, + "minecraft:snowy_beach": { + "downfall": 0.30000001192092896, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8364543, + "water_color": 4020182, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.05000000074505806 + }, + "minecraft:snowy_plains": { + "downfall": 0.5, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8364543, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.0 + }, + "minecraft:snowy_slopes": { + "downfall": 0.8999999761581421, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.snowy_slopes" + }, + "sky_color": 8560639, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": -0.30000001192092896 + }, + "minecraft:snowy_taiga": { + "downfall": 0.4000000059604645, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8625919, + "water_color": 4020182, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": -0.5 + }, + "minecraft:soul_sand_valley": { + "downfall": 0.0, + "effects": { + "additions_sound": { + "sound": "minecraft:ambient.soul_sand_valley.additions", + "tick_chance": 0.0111 + }, + "ambient_sound": "minecraft:ambient.soul_sand_valley.loop", + "fog_color": 1787717, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.soul_sand_valley.mood", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.nether.soul_sand_valley" + }, + "particle": { + "options": { + "type": "minecraft:ash" + }, + "probability": 0.00625 + }, + "sky_color": 7254527, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 2.0 + }, + "minecraft:sparse_jungle": { + "downfall": 0.800000011920929, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.sparse_jungle" + }, + "sky_color": 7842047, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.949999988079071 + }, + "minecraft:stony_peaks": { + "downfall": 0.30000001192092896, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.stony_peaks" + }, + "sky_color": 7776511, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 1.0 + }, + "minecraft:stony_shore": { + "downfall": 0.30000001192092896, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8233727, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.20000000298023224 + }, + "minecraft:sunflower_plains": { + "downfall": 0.4000000059604645, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 7907327, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.800000011920929 + }, + "minecraft:swamp": { + "downfall": 0.8999999761581421, + "effects": { + "fog_color": 12638463, + "foliage_color": 6975545, + "grass_color_modifier": "swamp", + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.swamp" + }, + "sky_color": 7907327, + "water_color": 6388580, + "water_fog_color": 2302743 + }, + "has_precipitation": true, + "temperature": 0.800000011920929 + }, + "minecraft:taiga": { + "downfall": 0.800000011920929, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8233983, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.25 + }, + "minecraft:the_end": { + "downfall": 0.5, + "effects": { + "fog_color": 10518688, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 0, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 0.5 + }, + "minecraft:the_void": { + "downfall": 0.5, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8103167, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 0.5 + }, + "minecraft:warm_ocean": { + "downfall": 0.5, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8103167, + "water_color": 4445678, + "water_fog_color": 270131 + }, + "has_precipitation": true, + "temperature": 0.5 + }, + "minecraft:warped_forest": { + "downfall": 0.0, + "effects": { + "additions_sound": { + "sound": "minecraft:ambient.warped_forest.additions", + "tick_chance": 0.0111 + }, + "ambient_sound": "minecraft:ambient.warped_forest.loop", + "fog_color": 1705242, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.warped_forest.mood", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.nether.warped_forest" + }, + "particle": { + "options": { + "type": "minecraft:warped_spore" + }, + "probability": 0.01428 + }, + "sky_color": 7254527, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 2.0 + }, + "minecraft:windswept_forest": { + "downfall": 0.30000001192092896, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8233727, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.20000000298023224 + }, + "minecraft:windswept_gravelly_hills": { + "downfall": 0.30000001192092896, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8233727, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.20000000298023224 + }, + "minecraft:windswept_hills": { + "downfall": 0.30000001192092896, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 8233727, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": true, + "temperature": 0.20000000298023224 + }, + "minecraft:windswept_savanna": { + "downfall": 0.0, + "effects": { + "fog_color": 12638463, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "sky_color": 7254527, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 2.0 + }, + "minecraft:wooded_badlands": { + "downfall": 0.0, + "effects": { + "fog_color": 12638463, + "foliage_color": 10387789, + "grass_color": 9470285, + "mood_sound": { + "block_search_extent": 8, + "offset": 2.0, + "sound": "minecraft:ambient.cave", + "tick_delay": 6000 + }, + "music": { + "max_delay": 24000, + "min_delay": 12000, + "replace_current_music": false, + "sound": "minecraft:music.overworld.badlands" + }, + "sky_color": 7254527, + "water_color": 4159204, + "water_fog_color": 329011 + }, + "has_precipitation": false, + "temperature": 2.0 + } + } +} diff --git a/src/net/player.rs b/src/net/player.rs index 46cce1c..4314654 100644 --- a/src/net/player.rs +++ b/src/net/player.rs @@ -20,6 +20,7 @@ use std::{sync::Arc, time::Duration}; use color_eyre::eyre::Result; +use registry::Registry; // use registry::Registry; use serde_json::json; use tokio::{ @@ -205,7 +206,22 @@ impl SharedPlayer { // TODO: maybe(?) actually handle this io.rx::().await?; - // let registry = Registry::DEFAULT; + let registry = &*registry::ALL_REGISTRIES; + io.tx(&Registry::from(registry.trim_material.clone())) + .await?; + io.tx(&Registry::from(registry.trim_pattern.clone())) + .await?; + io.tx(&Registry::from(registry.banner_pattern.clone())) + .await?; + io.tx(&Registry::from(registry.biome.clone())).await?; + io.tx(&Registry::from(registry.chat_type.clone())).await?; + io.tx(&Registry::from(registry.damage_type.clone())).await?; + io.tx(&Registry::from(registry.dimension_type.clone())) + .await?; + io.tx(&Registry::from(registry.wolf_variant.clone())) + .await?; + io.tx(&Registry::from(registry.painting_variant.clone())) + .await?; io.tx(&FinishConfigurationC).await?; io.rx::().await?; diff --git a/src/protocol/packets/login/registry/banner.rs b/src/protocol/packets/login/registry/banner.rs index eb761cc..e567b52 100644 --- a/src/protocol/packets/login/registry/banner.rs +++ b/src/protocol/packets/login/registry/banner.rs @@ -21,7 +21,7 @@ use serde::{Deserialize, Serialize}; use super::RegistryItem; -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct BannerPattern { asset_id: String, translation_key: String, diff --git a/src/protocol/packets/login/registry/biome.rs b/src/protocol/packets/login/registry/biome.rs index 9604de5..40d74ee 100644 --- a/src/protocol/packets/login/registry/biome.rs +++ b/src/protocol/packets/login/registry/biome.rs @@ -19,10 +19,11 @@ use serde::{Deserialize, Serialize}; -use super::{RegistryItem, StringOrCompound}; +use super::{deserialize_bool, RegistryItem, StringOrCompound}; -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct Biome { + #[serde(deserialize_with = "deserialize_bool")] has_precipitation: i8, temperature: f32, temperature_modifier: Option, @@ -30,7 +31,7 @@ pub struct Biome { effects: Effects, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] struct Effects { fog_color: i32, water_color: i32, @@ -46,25 +47,25 @@ struct Effects { music: Option, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] struct Particle { options: ParticleOptions, probability: f32, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] struct ParticleOptions { #[serde(rename = "type")] kind: String, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] struct AmbientSound { sound_id: String, range: Option, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] struct MoodSound { sound: String, tick_delay: i32, @@ -72,17 +73,18 @@ struct MoodSound { offset: f64, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] struct AdditionsSound { sound: String, tick_chance: f64, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] struct Music { sound: String, min_delay: i32, max_delay: i32, + #[serde(deserialize_with = "deserialize_bool")] replace_current_music: i8, } diff --git a/src/protocol/packets/login/registry/chat.rs b/src/protocol/packets/login/registry/chat.rs index e0e3163..2b84a42 100644 --- a/src/protocol/packets/login/registry/chat.rs +++ b/src/protocol/packets/login/registry/chat.rs @@ -21,13 +21,13 @@ use serde::{Deserialize, Serialize}; use super::RegistryItem; -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct ChatType { chat: Decoration, narration: Decoration, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] struct Decoration { translation_key: String, parameters: Vec, diff --git a/src/protocol/packets/login/registry/damage.rs b/src/protocol/packets/login/registry/damage.rs index c8a7828..1f97358 100644 --- a/src/protocol/packets/login/registry/damage.rs +++ b/src/protocol/packets/login/registry/damage.rs @@ -21,7 +21,7 @@ use serde::{Deserialize, Serialize}; use super::RegistryItem; -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct DamageType { message_id: String, scaling: String, diff --git a/src/protocol/packets/login/registry/dimension.rs b/src/protocol/packets/login/registry/dimension.rs index 71aaa7a..b91d2f0 100644 --- a/src/protocol/packets/login/registry/dimension.rs +++ b/src/protocol/packets/login/registry/dimension.rs @@ -19,11 +19,11 @@ use serde::{Deserialize, Serialize}; -use super::RegistryItem; +use super::{deserialize_bool, RegistryItem}; -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct DimensionType { - fixed_time: i64, + fixed_time: Option, has_skylight: i8, has_ceiling: i8, ultrawarm: i8, @@ -39,10 +39,55 @@ pub struct DimensionType { ambient_light: f32, piglin_safe: i8, has_raids: i8, - monster_spawn_light_level: i32, + monster_spawn_light_level: IntOrLightLevel, monster_spawn_block_light_limit: i32, } +#[derive(Clone, Debug, Serialize, Deserialize)] +#[serde(untagged)] +enum IntOrLightLevel { + Int(i32), + LL(IntProvider), +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +#[serde(tag = "type")] +enum IntProvider { + #[serde(rename = "minecraft:constant")] + Constant { value: i32 }, + #[serde(rename = "minecraft:uniform")] + Uniform { + min_inclusive: i32, + max_inclusive: i32, + }, + #[serde(rename = "minecraft:biased_to_bottom")] + BiasedToBottom { + min_inclusive: i32, + max_inclusive: i32, + }, + #[serde(rename = "minecraft:clamped")] + Clamped { + min_inclusive: i32, + max_inclusive: i32, + source: Box, + }, + #[serde(rename = "minecraft:clamped_normal")] + ClampedNormal { + mean: f32, + deviation: f32, + min_inclusive: i32, + max_inclusive: i32, + }, + #[serde(rename = "minecraft:weighted_list")] + WeightedList { distribution: Vec }, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +struct WeightedProvider { + data: IntProvider, + weight: i32, +} + impl RegistryItem for DimensionType { const ID: &str = "minecraft:dimension_type"; } diff --git a/src/protocol/packets/login/registry/mod.rs b/src/protocol/packets/login/registry/mod.rs index 2d7deed..13337b8 100644 --- a/src/protocol/packets/login/registry/mod.rs +++ b/src/protocol/packets/login/registry/mod.rs @@ -17,8 +17,10 @@ * . */ +use std::{collections::HashMap, sync::LazyLock}; + use fastnbt::SerOpts; -use serde::{Deserialize, Serialize}; +use serde::{de, Deserialize, Serialize}; use crate::protocol::{datatypes::VarInt, Encode, Packet}; @@ -40,7 +42,7 @@ pub use painting::*; pub use trim::*; pub use wolf::*; -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct Registry { registry_id: String, entries: Vec>, @@ -53,24 +55,12 @@ where const ID: i32 = 0x07; } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct RegistryEntry { id: String, entry: Option, } -impl Registry -where - T: RegistryItem, -{ - pub fn new(id: &str, entries: Vec>) -> Self { - Self { - registry_id: id.to_owned(), - entries, - } - } -} - impl Encode for Registry where T: RegistryItem, @@ -95,7 +85,7 @@ where } // TODO: maybe fill these in? for now we're only using dimensiontype so we can spawn in the end lol -pub trait RegistryItem: Serialize + Sized { +pub trait RegistryItem: Serialize + Sized + Clone { const ID: &str; fn encode(&self, w: impl std::io::Write) -> color_eyre::eyre::Result<()> { @@ -103,31 +93,65 @@ pub trait RegistryItem: Serialize + Sized { } } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct AllRegistries { #[serde(rename = "minecraft:trim_material")] - trim_material: Registry, + pub trim_material: HashMap, #[serde(rename = "minecraft:trim_pattern")] - trim_pattern: Registry, + pub trim_pattern: HashMap, #[serde(rename = "minecraft:banner_pattern")] - banner_pattern: Registry, + pub banner_pattern: HashMap, #[serde(rename = "minecraft:worldgen/biome")] - biome: Registry, + pub biome: HashMap, #[serde(rename = "minecraft:chat_type")] - chat_type: Registry, + pub chat_type: HashMap, #[serde(rename = "minecraft:damage_type")] - damage_type: Registry, + pub damage_type: HashMap, #[serde(rename = "minecraft:dimension_type")] - dimension_type: Registry, + pub dimension_type: HashMap, #[serde(rename = "minecraft:wolf_variant")] - wolf_variant: Registry, + pub wolf_variant: HashMap, #[serde(rename = "minecraft:painting_variant")] - painting_variant: Registry, + pub painting_variant: HashMap, +} + +impl From> for Registry { + fn from(value: HashMap) -> Self { + let entries = value + .into_iter() + .map(|(k, v)| RegistryEntry { + id: k, + entry: Some(v), + }) + .collect(); + + Self { + registry_id: T::ID.to_owned(), + entries, + } + } } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] #[serde(untagged)] enum StringOrCompound { String(String), Compound(T), } + +pub static ALL_REGISTRIES: LazyLock = LazyLock::new(|| { + serde_json::from_str(include_str!("../../../../../assets/registries.json")) + .expect("registries.json should be parseable") +}); + +fn deserialize_bool<'de, D>(deserializer: D) -> Result +where + D: de::Deserializer<'de>, +{ + let b: bool = de::Deserialize::deserialize(deserializer)?; + + match b { + true => Ok(1), + false => Ok(0), + } +} diff --git a/src/protocol/packets/login/registry/painting.rs b/src/protocol/packets/login/registry/painting.rs index 98a5105..9932fca 100644 --- a/src/protocol/packets/login/registry/painting.rs +++ b/src/protocol/packets/login/registry/painting.rs @@ -21,7 +21,7 @@ use serde::{Deserialize, Serialize}; use super::RegistryItem; -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct PaintingVariant { asset_id: String, height: i32, diff --git a/src/protocol/packets/login/registry/trim.rs b/src/protocol/packets/login/registry/trim.rs index 41be2c7..e5c7df4 100644 --- a/src/protocol/packets/login/registry/trim.rs +++ b/src/protocol/packets/login/registry/trim.rs @@ -21,7 +21,7 @@ use serde::{Deserialize, Serialize}; use super::{RegistryItem, StringOrCompound}; -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct TrimMaterial { asset_name: String, ingredient: String, @@ -29,9 +29,11 @@ pub struct TrimMaterial { description: StringOrCompound, } -#[derive(Debug, Serialize, Deserialize)] +// FIXME: bare minimum. should probably properly implement +// https://wiki.vg/Text_formatting soon +#[derive(Clone, Debug, Serialize, Deserialize)] struct TrimDescription { - color: String, + color: Option, translate: String, } @@ -39,12 +41,11 @@ impl RegistryItem for TrimMaterial { const ID: &str = "minecraft:trim_material"; } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct TrimPattern { asset_id: String, template_item: String, description: TrimDescription, - decal: i8, } impl RegistryItem for TrimPattern { diff --git a/src/protocol/packets/login/registry/wolf.rs b/src/protocol/packets/login/registry/wolf.rs index 4d524ca..80a662d 100644 --- a/src/protocol/packets/login/registry/wolf.rs +++ b/src/protocol/packets/login/registry/wolf.rs @@ -21,7 +21,7 @@ use serde::{Deserialize, Serialize}; use super::RegistryItem; -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct WolfVariant { wild_texture: String, tame_texture: String, -- 2.51.2