1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00
This commit is contained in:
mat 2025-05-23 23:55:31 +03:00
parent 45719d4498
commit 177bde3264
26 changed files with 513 additions and 270 deletions

42
Cargo.lock generated
View file

@ -215,7 +215,7 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "azalea"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"anyhow",
"azalea-auth",
@ -255,7 +255,7 @@ dependencies = [
[[package]]
name = "azalea-auth"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"azalea-buf",
"azalea-crypto",
@ -275,7 +275,7 @@ dependencies = [
[[package]]
name = "azalea-block"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"azalea-block-macros",
"azalea-buf",
@ -284,7 +284,7 @@ dependencies = [
[[package]]
name = "azalea-block-macros"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"proc-macro2",
"quote",
@ -293,7 +293,7 @@ dependencies = [
[[package]]
name = "azalea-brigadier"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"azalea-buf",
"azalea-chat",
@ -304,7 +304,7 @@ dependencies = [
[[package]]
name = "azalea-buf"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"azalea-buf-macros",
"byteorder",
@ -317,7 +317,7 @@ dependencies = [
[[package]]
name = "azalea-buf-macros"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"proc-macro2",
"quote",
@ -326,7 +326,7 @@ dependencies = [
[[package]]
name = "azalea-chat"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"azalea-buf",
"azalea-language",
@ -339,7 +339,7 @@ dependencies = [
[[package]]
name = "azalea-client"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"anyhow",
"async-compat",
@ -376,7 +376,7 @@ dependencies = [
[[package]]
name = "azalea-core"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"azalea-buf",
"azalea-chat",
@ -392,7 +392,7 @@ dependencies = [
[[package]]
name = "azalea-crypto"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"aes",
"azalea-buf",
@ -409,7 +409,7 @@ dependencies = [
[[package]]
name = "azalea-entity"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"azalea-block",
"azalea-buf",
@ -432,7 +432,7 @@ dependencies = [
[[package]]
name = "azalea-inventory"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"azalea-buf",
"azalea-chat",
@ -447,7 +447,7 @@ dependencies = [
[[package]]
name = "azalea-inventory-macros"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"proc-macro2",
"quote",
@ -456,7 +456,7 @@ dependencies = [
[[package]]
name = "azalea-language"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"compact_str",
"serde",
@ -465,7 +465,7 @@ dependencies = [
[[package]]
name = "azalea-physics"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"azalea-block",
"azalea-core",
@ -483,7 +483,7 @@ dependencies = [
[[package]]
name = "azalea-protocol"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"anyhow",
"async-recursion",
@ -519,7 +519,7 @@ dependencies = [
[[package]]
name = "azalea-protocol-macros"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"proc-macro2",
"quote",
@ -528,7 +528,7 @@ dependencies = [
[[package]]
name = "azalea-registry"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"azalea-buf",
"azalea-registry-macros",
@ -538,7 +538,7 @@ dependencies = [
[[package]]
name = "azalea-registry-macros"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"quote",
"syn",
@ -546,7 +546,7 @@ dependencies = [
[[package]]
name = "azalea-world"
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
dependencies = [
"azalea-block",
"azalea-buf",

View file

@ -22,7 +22,7 @@ resolver = "2"
# --- Workspace Settings ---
[workspace.package]
version = "0.12.0+mc25w19a"
version = "0.12.0+mc25w21a"
edition = "2024"
license = "MIT"
repository = "https://github.com/azalea-rs/azalea"

View file

@ -10,7 +10,7 @@ A collection of Rust crates for making Minecraft bots, clients, and tools.
<!-- The line below is automatically read and updated by the migrate script, so don't change it manually. -->
_Currently supported Minecraft version: `25w19a`._
_Currently supported Minecraft version: `25w21a`._
> [!WARNING]
> Azalea is still unfinished, though most crates are in a useable state

View file

@ -54,6 +54,8 @@ pub fn process_packet(ecs: &mut World, player: Entity, packet: &ClientboundConfi
select_known_packs,
custom_report_details,
server_links,
clear_dialog,
show_dialog,
]
);
}
@ -218,4 +220,11 @@ impl ConfigPacketHandler<'_> {
pub fn custom_report_details(&mut self, p: &ClientboundCustomReportDetails) {
debug!("Got custom report details packet {p:?}");
}
pub fn clear_dialog(&mut self, p: &ClientboundClearDialog) {
debug!("Got clear dialog packet {p:?}");
}
pub fn show_dialog(&mut self, p: &ClientboundShowDialog) {
debug!("Got show dialog packet {p:?}");
}
}

View file

@ -177,6 +177,8 @@ pub fn process_packet(ecs: &mut World, player: Entity, packet: &ClientboundGameP
recipe_book_settings,
test_instance_block_status,
waypoint,
clear_dialog,
show_dialog,
]
);
}
@ -1615,4 +1617,11 @@ impl GamePacketHandler<'_> {
pub fn recipe_book_settings(&mut self, _p: &ClientboundRecipeBookSettings) {}
pub fn test_instance_block_status(&mut self, _p: &ClientboundTestInstanceBlockStatus) {}
pub fn waypoint(&mut self, _p: &ClientboundWaypoint) {}
pub fn clear_dialog(&mut self, p: &ClientboundClearDialog) {
debug!("Got clear dialog packet {p:?}");
}
pub fn show_dialog(&mut self, p: &ClientboundShowDialog) {
debug!("Got show dialog packet {p:?}");
}
}

View file

@ -4235,6 +4235,8 @@ impl Default for GiantMetadataBundle {
}
}
#[derive(Component, Deref, DerefMut, Clone)]
pub struct ItemFrameDirection(pub Direction);
#[derive(Component, Deref, DerefMut, Clone)]
pub struct ItemFrameItem(pub ItemStack);
#[derive(Component, Deref, DerefMut, Clone)]
@ -4247,7 +4249,7 @@ impl GlowItemFrame {
d: EntityDataItem,
) -> Result<(), UpdateMetadataError> {
match d.index {
0..=9 => ItemFrame::apply_metadata(entity, d)?,
0..=10 => ItemFrame::apply_metadata(entity, d)?,
_ => {}
}
Ok(())
@ -4282,6 +4284,7 @@ impl Default for GlowItemFrameMetadataBundle {
pose: Pose::default(),
ticks_frozen: TicksFrozen(Default::default()),
},
item_frame_direction: ItemFrameDirection(Default::default()),
item_frame_item: ItemFrameItem(Default::default()),
rotation: Rotation(0),
},
@ -5293,9 +5296,12 @@ impl ItemFrame {
match d.index {
0..=7 => AbstractEntity::apply_metadata(entity, d)?,
8 => {
entity.insert(ItemFrameItem(d.value.into_item_stack()?));
entity.insert(ItemFrameDirection(d.value.into_direction()?));
}
9 => {
entity.insert(ItemFrameItem(d.value.into_item_stack()?));
}
10 => {
entity.insert(Rotation(d.value.into_int()?));
}
_ => {}
@ -5308,6 +5314,7 @@ impl ItemFrame {
pub struct ItemFrameMetadataBundle {
_marker: ItemFrame,
parent: AbstractEntityMetadataBundle,
item_frame_direction: ItemFrameDirection,
item_frame_item: ItemFrameItem,
rotation: Rotation,
}
@ -5332,6 +5339,7 @@ impl Default for ItemFrameMetadataBundle {
pose: Pose::default(),
ticks_frozen: TicksFrozen(Default::default()),
},
item_frame_direction: ItemFrameDirection(Default::default()),
item_frame_item: ItemFrameItem(Default::default()),
rotation: Rotation(0),
}
@ -6429,6 +6437,8 @@ impl Default for OminousItemSpawnerMetadataBundle {
}
}
#[derive(Component, Deref, DerefMut, Clone)]
pub struct PaintingDirection(pub Direction);
#[derive(Component, Deref, DerefMut, Clone)]
pub struct PaintingVariant(pub azalea_registry::PaintingVariant);
#[derive(Component)]
@ -6441,6 +6451,9 @@ impl Painting {
match d.index {
0..=7 => AbstractEntity::apply_metadata(entity, d)?,
8 => {
entity.insert(PaintingDirection(d.value.into_direction()?));
}
9 => {
entity.insert(PaintingVariant(d.value.into_painting_variant()?));
}
_ => {}
@ -6453,6 +6466,7 @@ impl Painting {
pub struct PaintingMetadataBundle {
_marker: Painting,
parent: AbstractEntityMetadataBundle,
painting_direction: PaintingDirection,
painting_variant: PaintingVariant,
}
impl Default for PaintingMetadataBundle {
@ -6476,6 +6490,7 @@ impl Default for PaintingMetadataBundle {
pose: Pose::default(),
ticks_frozen: TicksFrozen(Default::default()),
},
painting_direction: PaintingDirection(Default::default()),
painting_variant: PaintingVariant(azalea_registry::PaintingVariant::new_raw(0)),
}
}

View file

@ -2580,6 +2580,10 @@
"commands.defaultgamemode.success": "The default game mode is now %s",
"commands.deop.failed": "Nothing changed. The player is not an operator",
"commands.deop.success": "Made %s no longer a server operator",
"commands.dialog.clear.multiple": "Cleared dialog for %s players",
"commands.dialog.clear.single": "Cleared dialog for %s",
"commands.dialog.show.multiple": "Displayed dialog to %s players",
"commands.dialog.show.single": "Displayed dialog to %s",
"commands.difficulty.failure": "The difficulty did not change; it is already set to %s",
"commands.difficulty.query": "The difficulty is %s",
"commands.difficulty.success": "The difficulty has been set to %s",
@ -4364,6 +4368,8 @@
"item.minecraft.music_disc_stal.desc": "C418 - stal",
"item.minecraft.music_disc_strad": "Music Disc",
"item.minecraft.music_disc_strad.desc": "C418 - strad",
"item.minecraft.music_disc_tears": "Music Disc",
"item.minecraft.music_disc_tears.desc": "Amos Roddy - Tears",
"item.minecraft.music_disc_wait": "Music Disc",
"item.minecraft.music_disc_wait.desc": "C418 - wait",
"item.minecraft.music_disc_ward": "Music Disc",
@ -4750,6 +4756,7 @@
"jukebox_song.minecraft.relic": "Aaron Cherof - Relic",
"jukebox_song.minecraft.stal": "C418 - stal",
"jukebox_song.minecraft.strad": "C418 - strad",
"jukebox_song.minecraft.tears": "Amos Roddy - Tears",
"jukebox_song.minecraft.wait": "C418 - wait",
"jukebox_song.minecraft.ward": "C418 - ward",
"key.advancements": "Advancements",
@ -5006,6 +5013,7 @@
"mco.configure.world.invites.remove.tooltip": "Remove",
"mco.configure.world.leave.question.line1": "If you leave this Realm you won't see it unless you are invited again",
"mco.configure.world.leave.question.line2": "Are you sure you want to continue?",
"mco.configure.world.loading": "Loading Realm",
"mco.configure.world.location": "Location",
"mco.configure.world.minigame": "Current: %s",
"mco.configure.world.name": "Realm Name",
@ -5068,6 +5076,7 @@
"mco.connect.authorizing": "Logging in...",
"mco.connect.connecting": "Connecting to the Realm...",
"mco.connect.failed": "Failed to connect to the Realm",
"mco.connect.region": "Server region: %s",
"mco.connect.success": "Done",
"mco.create.world": "Create",
"mco.create.world.error": "You must enter a name!",
@ -5143,6 +5152,7 @@
"mco.notification.visitUrl.buttonText.default": "Open Link",
"mco.notification.visitUrl.message.default": "Please visit the link below",
"mco.onlinePlayers": "Online Players",
"mco.play.button.realm.closed": "Realm is closed",
"mco.question": "Question",
"mco.reset.world.adventure": "Adventures",
"mco.reset.world.experience": "Experiences",
@ -5248,6 +5258,14 @@
"mco.version": "Version: %s",
"mco.warning": "Warning!",
"mco.worldSlot.minigame": "Minigame",
"menu.custom_options": "Custom Options...",
"menu.custom_options.title": "Custom Options",
"menu.custom_options.tooltip": "Note: Custom options are provided by third-party servers and/or content.\nHandle with care!",
"menu.custom_screen_info.button_narration": "This is a custom screen. Learn more.",
"menu.custom_screen_info.contents": "The contents of this screen are controlled by third-party servers and maps that are not owned, operated, or supervised by Mojang Studios or Microsoft.\n\nHandle with care! Always be careful when following links and never give away your personal information, including login details.\n\nIf this screen prevents you from playing, you can also disconnect from the current server by using the button below.",
"menu.custom_screen_info.disconnect": "Custom screen rejected",
"menu.custom_screen_info.title": "Note about custom screens",
"menu.custom_screen_info.tooltip": "This is a custom screen. Click here to learn more.",
"menu.disconnect": "Disconnect",
"menu.feedback": "Feedback...",
"menu.feedback.title": "Feedback",
@ -5286,6 +5304,9 @@
"mirror.none": "|",
"mount.onboard": "Press %1$s to Dismount",
"multiplayer.applyingPack": "Applying resource pack",
"multiplayer.confirm_command.parse_errors": "You are trying to execute an unrecognized or invalid command.\nAre you sure?\nCommand: %s",
"multiplayer.confirm_command.permissions_required": "You are trying to execute a command that requires elevated permissions.\nThis might negatively affect your game.\nAre you sure?\nCommand: %s",
"multiplayer.confirm_command.title": "Confirm Command Execution",
"multiplayer.disconnect.authservers_down": "Authentication servers are down. Please try again later, sorry!",
"multiplayer.disconnect.bad_chat_index": "Detected missed or reordered chat message from server",
"multiplayer.disconnect.banned": "You are banned from this server",
@ -5369,6 +5390,71 @@
"multiplayerWarning.check": "Do not show this screen again",
"multiplayerWarning.header": "Caution: Third-Party Online Play",
"multiplayerWarning.message": "Caution: Online play is offered by third-party servers that are not owned, operated, or supervised by Mojang Studios or Microsoft. During online play, you may be exposed to unmoderated chat messages or other types of user-generated content that may not be suitable for everyone.",
"music.game.a_familiar_room": "Aaron Cherof - A Familiar Room",
"music.game.an_ordinary_day": "Kumi Tanioka - An Ordinary Day",
"music.game.ancestry": "Lena Raine - Ancestry",
"music.game.below_and_above": "Amos Roddy - Below and Above",
"music.game.broken_clocks": "Amos Roddy - Broken Clocks",
"music.game.bromeliad": "Aaron Cherof - Bromeliad",
"music.game.clark": "C418 - Clark",
"music.game.comforting_memories": "Kumi Tanioka - Comforting Memories",
"music.game.creative.aria_math": "C418 - Aria Math",
"music.game.creative.biome_fest": "C418 - Biome Fest",
"music.game.creative.blind_spots": "C418 - Blind Spots",
"music.game.creative.dreiton": "C418 - Dreiton",
"music.game.creative.haunt_muskie": "C418 - Haunt Muskie",
"music.game.creative.taswell": "C418 - Taswell",
"music.game.crescent_dunes": "Aaron Cherof - Crescent Dunes",
"music.game.danny": "C418 - Danny",
"music.game.deeper": "Lena Raine - Deeper",
"music.game.dry_hands": "C418 - Dry Hands",
"music.game.echo_in_the_wind": "Aaron Cherof - Echo in the Wind",
"music.game.eld_unknown": "Lena Raine - Eld Unknown",
"music.game.end.alpha": "C418 - Alpha",
"music.game.end.boss": "C418 - Boss",
"music.game.end.the_end": "C418 - The End",
"music.game.endless": "Lena Raine - Endless",
"music.game.featherfall": "Aaron Cherof - Featherfall",
"music.game.fireflies": "Amos Roddy - Fireflies",
"music.game.floating_dream": "Kumi Tanioka - Floating Dream",
"music.game.haggstrom": "C418 - Haggstrom",
"music.game.infinite_amethyst": "Lena Raine - Infinite Amethyst",
"music.game.key": "C418 - Key",
"music.game.komorebi": "Kumi Tanioka - komorebi",
"music.game.left_to_bloom": "Lena Raine - Left to Bloom",
"music.game.lilypad": "Amos Roddy - Lilypad",
"music.game.living_mice": "C418 - Living Mice",
"music.game.mice_on_venus": "C418 - Mice on Venus",
"music.game.minecraft": "C418 - Minecraft",
"music.game.nether.ballad_of_the_cats": "C418 - Ballad of the Cats",
"music.game.nether.concrete_halls": "C418 - Concrete Halls",
"music.game.nether.crimson_forest.chrysopoeia": "Lena Raine - Chrysopoeia",
"music.game.nether.dead_voxel": "C418 - Dead Voxel",
"music.game.nether.nether_wastes.rubedo": "Lena Raine - Rubedo",
"music.game.nether.soulsand_valley.so_below": "Lena Raine - So Below",
"music.game.nether.warmth": "C418 - Warmth",
"music.game.one_more_day": "Lena Raine - One More Day",
"music.game.os_piano": "Amos Roddy - O's Piano",
"music.game.oxygene": "C418 - Oxyg\u00e8ne",
"music.game.pokopoko": "Kumi Tanioka - pokopoko",
"music.game.puzzlebox": "Aaron Cherof - Puzzlebox",
"music.game.stand_tall": "Lena Raine - Stand Tall",
"music.game.subwoofer_lullaby": "C418 - Subwoofer Lullaby",
"music.game.swamp.aerie": "Lena Raine - Aerie",
"music.game.swamp.firebugs": "Lena Raine - Firebugs",
"music.game.swamp.labyrinthine": "Lena Raine - Labyrinthine",
"music.game.sweden": "C418 - Sweden",
"music.game.watcher": "Aaron Cherof - Watcher",
"music.game.water.axolotl": "C418 - Axolotl",
"music.game.water.dragon_fish": "C418 - Dragon Fish",
"music.game.water.shuniji": "C418 - Shuniji",
"music.game.wending": "Lena Raine - Wending",
"music.game.wet_hands": "C418 - Wet Hands",
"music.game.yakusoku": "Kumi Tanioka - yakusoku",
"music.menu.beginning_2": "C418 - Beginning 2",
"music.menu.floating_trees": "C418 - Floating Trees",
"music.menu.moog_city_2": "C418 - Moog City 2",
"music.menu.mutation": "C418 - Mutation",
"narration.button": "Button: %s",
"narration.button.usage.focused": "Press Enter to activate",
"narration.button.usage.hovered": "Left click to activate",
@ -5379,6 +5465,7 @@
"narration.cycle_button.usage.focused": "Press Enter to switch to %s",
"narration.cycle_button.usage.hovered": "Left click to switch to %s",
"narration.edit_box": "Edit box: %s",
"narration.item": "Item: %s",
"narration.recipe": "Recipe for %s",
"narration.recipe.usage": "Left click to select",
"narration.recipe.usage.more": "Right click to show more recipes",
@ -5598,6 +5685,11 @@
"options.mouseWheelSensitivity": "Scroll Sensitivity",
"options.multiplayer.title": "Multiplayer Settings...",
"options.multiplier": "%sx",
"options.music_frequency": "Music Frequency",
"options.music_frequency.constant": "Constant",
"options.music_frequency.default": "Default",
"options.music_frequency.frequent": "Frequent",
"options.music_frequency.tooltip": "Changes how frequently music plays while in a game world.",
"options.narrator": "Narrator",
"options.narrator.all": "Narrates All",
"options.narrator.chat": "Narrates Chat",
@ -5644,6 +5736,8 @@
"options.sensitivity": "Sensitivity",
"options.sensitivity.max": "HYPERSPEED!!!",
"options.sensitivity.min": "*yawn*",
"options.showNowPlayingToast": "Show Music Toast",
"options.showNowPlayingToast.tooltip": "Displays a toast whenever a song starts playing. The same toast is constantly displayed in the in-game pause menu while a song is playing.",
"options.showSubtitles": "Show Subtitles",
"options.simulationDistance": "Simulation Distance",
"options.skinCustomisation": "Skin Customization...",
@ -7036,12 +7130,18 @@
"subtitles.item.hoe.till": "Hoe tills",
"subtitles.item.honey_bottle.drink": "Gulping",
"subtitles.item.honeycomb.wax_on": "Wax on",
"subtitles.item.horse_armor.unequip": "Horse Armor snips away",
"subtitles.item.ink_sac.use": "Ink Sac splotches",
"subtitles.item.lead.break": "Lead snaps",
"subtitles.item.lead.tied": "Lead tied",
"subtitles.item.lead.untied": "Lead untied",
"subtitles.item.llama_carpet.unequip": "Carpet snips away",
"subtitles.item.lodestone_compass.lock": "Lodestone Compass locks onto Lodestone",
"subtitles.item.mace.smash_air": "Mace smashes",
"subtitles.item.mace.smash_ground": "Mace smashes",
"subtitles.item.nether_wart.plant": "Crop planted",
"subtitles.item.ominous_bottle.dispose": "Bottle breaks",
"subtitles.item.saddle.unequip": "Saddle snips away",
"subtitles.item.shears.shear": "Shears click",
"subtitles.item.shears.snip": "Shears snip",
"subtitles.item.shield.block": "Shield blocks",

View file

@ -0,0 +1,5 @@
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundConfigPacket;
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundClearDialog {}

View file

@ -0,0 +1,9 @@
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundConfigPacket;
use azalea_registry::Holder;
use simdnbt::owned::Nbt;
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundShowDialog {
pub dialog: Holder<azalea_registry::Dialog, Nbt>,
}

View file

@ -5,32 +5,35 @@ use azalea_protocol_macros::declare_state_packets;
declare_state_packets!(ConfigPacket,
Clientbound => [
cookie_request, // 0x00
custom_payload, // 0x01
disconnect, // 0x02
finish_configuration, // 0x03
keep_alive, // 0x04
ping, // 0x05
reset_chat, // 0x06
registry_data, // 0x07
resource_pack_pop, // 0x08
resource_pack_push, // 0x09
store_cookie, // 0x0A
transfer, // 0x0B
update_enabled_features, // 0x0C
update_tags, // 0x0D
select_known_packs, // 0x0E
custom_report_details, // 0x0F
server_links, // 0x10
cookie_request,
custom_payload,
disconnect,
finish_configuration,
keep_alive,
ping,
reset_chat,
registry_data,
resource_pack_pop,
resource_pack_push,
store_cookie,
transfer,
update_enabled_features,
update_tags,
select_known_packs,
custom_report_details,
server_links,
clear_dialog,
show_dialog,
],
Serverbound => [
client_information, // 0x00
cookie_response, // 0x01
custom_payload, // 0x02
finish_configuration, // 0x03
keep_alive, // 0x04
pong, // 0x05
resource_pack, // 0x06
select_known_packs, // 0x07
client_information,
cookie_response,
custom_payload,
finish_configuration,
keep_alive,
pong,
resource_pack,
select_known_packs,
custom_click_action,
]
);

View file

@ -0,0 +1,9 @@
use azalea_buf::AzBuf;
use azalea_core::resource_location::ResourceLocation;
use azalea_protocol_macros::ServerboundConfigPacket;
#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)]
pub struct ServerboundCustomClickAction {
pub id: ResourceLocation,
pub payload: Option<String>,
}

View file

@ -0,0 +1,5 @@
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundClearDialog;

View file

@ -0,0 +1,9 @@
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
use azalea_registry::Holder;
use simdnbt::owned::Nbt;
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundShowDialog {
pub dialog: Holder<azalea_registry::Dialog, Nbt>,
}

View file

@ -5,203 +5,207 @@ use azalea_protocol_macros::declare_state_packets;
declare_state_packets!(GamePacket,
Clientbound => [
bundle_delimiter, // 0x00
add_entity, // 0x01
animate, // 0x02
award_stats, // 0x03
block_changed_ack, // 0x04
block_destruction, // 0x05
block_entity_data, // 0x06
block_event, // 0x07
block_update, // 0x08
boss_event, // 0x09
change_difficulty, // 0x0A
chunk_batch_finished, // 0x0B
chunk_batch_start, // 0x0C
chunks_biomes, // 0x0D
clear_titles, // 0x0E
command_suggestions, // 0x0F
commands, // 0x10
container_close, // 0x11
container_set_content, // 0x12
container_set_data, // 0x13
container_set_slot, // 0x14
cookie_request, // 0x15
cooldown, // 0x16
custom_chat_completions, // 0x17
custom_payload, // 0x18
damage_event, // 0x19
debug_sample, // 0x1A
delete_chat, // 0x1B
disconnect, // 0x1C
disguised_chat, // 0x1D
entity_event, // 0x1E
entity_position_sync, // 0x1F
explode, // 0x20
forget_level_chunk, // 0x21
game_event, // 0x22
horse_screen_open, // 0x23
hurt_animation, // 0x24
initialize_border, // 0x25
keep_alive, // 0x26
level_chunk_with_light, // 0x27
level_event, // 0x28
level_particles, // 0x29
light_update, // 0x2A
login, // 0x2B
map_item_data, // 0x2C
merchant_offers, // 0x2D
move_entity_pos, // 0x2E
move_entity_pos_rot, // 0x2F
move_minecart_along_track, // 0x30
move_entity_rot, // 0x31
move_vehicle, // 0x32
open_book, // 0x33
open_screen, // 0x34
open_sign_editor, // 0x35
ping, // 0x36
pong_response, // 0x37
place_ghost_recipe, // 0x38
player_abilities, // 0x39
player_chat, // 0x3A
player_combat_end, // 0x3B
player_combat_enter, // 0x3C
player_combat_kill, // 0x3D
player_info_remove, // 0x3E
player_info_update, // 0x3F
player_look_at, // 0x40
player_position, // 0x41
player_rotation, // 0x42
recipe_book_add, // 0x43
recipe_book_remove, // 0x44
recipe_book_settings, // 0x45
remove_entities, // 0x46
remove_mob_effect, // 0x47
reset_score, // 0x48
resource_pack_pop, // 0x49
resource_pack_push, // 0x4A
respawn, // 0x4B
rotate_head, // 0x4C
section_blocks_update, // 0x4D
select_advancements_tab, // 0x4E
server_data, // 0x4F
set_action_bar_text, // 0x50
set_border_center, // 0x51
set_border_lerp_size, // 0x52
set_border_size, // 0x53
set_border_warning_delay, // 0x54
set_border_warning_distance, // 0x55
set_camera, // 0x56
set_chunk_cache_center, // 0x57
set_chunk_cache_radius, // 0x58
set_cursor_item, // 0x59
set_default_spawn_position, // 0x5A
set_display_objective, // 0x5B
set_entity_data, // 0x5C
set_entity_link, // 0x5D
set_entity_motion, // 0x5E
set_equipment, // 0x5F
set_experience, // 0x60
set_health, // 0x61
set_held_slot, // 0x62
set_objective, // 0x63
set_passengers, // 0x64
set_player_inventory, // 0x65
set_player_team, // 0x66
set_score, // 0x67
set_simulation_distance, // 0x68
set_subtitle_text, // 0x69
set_time, // 0x6A
set_title_text, // 0x6B
set_titles_animation, // 0x6C
sound_entity, // 0x6D
sound, // 0x6E
start_configuration, // 0x6F
stop_sound, // 0x70
store_cookie, // 0x71
system_chat, // 0x72
tab_list, // 0x73
tag_query, // 0x74
take_item_entity, // 0x75
teleport_entity, // 0x76
test_instance_block_status, // 0x77
ticking_state, // 0x78
ticking_step, // 0x79
transfer, // 0x7A
update_advancements, // 0x7B
update_attributes, // 0x7C
update_mob_effect, // 0x7D
update_recipes, // 0x7E
update_tags, // 0x7F
projectile_power, // 0x80
custom_report_details, // 0x81
server_links, // 0x82
waypoint, // 0x83
bundle_delimiter,
add_entity,
animate,
award_stats,
block_changed_ack,
block_destruction,
block_entity_data,
block_event,
block_update,
boss_event,
change_difficulty,
chunk_batch_finished,
chunk_batch_start,
chunks_biomes,
clear_titles,
command_suggestions,
commands,
container_close,
container_set_content,
container_set_data,
container_set_slot,
cookie_request,
cooldown,
custom_chat_completions,
custom_payload,
damage_event,
debug_sample,
delete_chat,
disconnect,
disguised_chat,
entity_event,
entity_position_sync,
explode,
forget_level_chunk,
game_event,
horse_screen_open,
hurt_animation,
initialize_border,
keep_alive,
level_chunk_with_light,
level_event,
level_particles,
light_update,
login,
map_item_data,
merchant_offers,
move_entity_pos,
move_entity_pos_rot,
move_minecart_along_track,
move_entity_rot,
move_vehicle,
open_book,
open_screen,
open_sign_editor,
ping,
pong_response,
place_ghost_recipe,
player_abilities,
player_chat,
player_combat_end,
player_combat_enter,
player_combat_kill,
player_info_remove,
player_info_update,
player_look_at,
player_position,
player_rotation,
recipe_book_add,
recipe_book_remove,
recipe_book_settings,
remove_entities,
remove_mob_effect,
reset_score,
resource_pack_pop,
resource_pack_push,
respawn,
rotate_head,
section_blocks_update,
select_advancements_tab,
server_data,
set_action_bar_text,
set_border_center,
set_border_lerp_size,
set_border_size,
set_border_warning_delay,
set_border_warning_distance,
set_camera,
set_chunk_cache_center,
set_chunk_cache_radius,
set_cursor_item,
set_default_spawn_position,
set_display_objective,
set_entity_data,
set_entity_link,
set_entity_motion,
set_equipment,
set_experience,
set_health,
set_held_slot,
set_objective,
set_passengers,
set_player_inventory,
set_player_team,
set_score,
set_simulation_distance,
set_subtitle_text,
set_time,
set_title_text,
set_titles_animation,
sound_entity,
sound,
start_configuration,
stop_sound,
store_cookie,
system_chat,
tab_list,
tag_query,
take_item_entity,
teleport_entity,
test_instance_block_status,
ticking_state,
ticking_step,
transfer,
update_advancements,
update_attributes,
update_mob_effect,
update_recipes,
update_tags,
projectile_power,
custom_report_details,
server_links,
waypoint,
clear_dialog,
show_dialog,
],
Serverbound => [
accept_teleportation, // 0x00
block_entity_tag_query, // 0x01
bundle_item_selected, // 0x02
change_difficulty, // 0x03
chat_ack, // 0x04
chat_command, // 0x05
chat_command_signed, // 0x06
chat, // 0x07
chat_session_update, // 0x08
chunk_batch_received, // 0x09
client_command, // 0x0A
client_tick_end, // 0x0B
client_information, // 0x0C
command_suggestion, // 0x0D
configuration_acknowledged, // 0x0E
container_button_click, // 0x0F
container_click, // 0x10
container_close, // 0x11
container_slot_state_changed, // 0x12
cookie_response, // 0x13
custom_payload, // 0x14
debug_sample_subscription, // 0x15
edit_book, // 0x16
entity_tag_query, // 0x17
interact, // 0x18
jigsaw_generate, // 0x19
keep_alive, // 0x1A
lock_difficulty, // 0x1B
move_player_pos, // 0x1C
move_player_pos_rot, // 0x1D
move_player_rot, // 0x1E
move_player_status_only, // 0x1F
move_vehicle, // 0x20
paddle_boat, // 0x21
pick_item_from_block, // 0x22
pick_item_from_entity, // 0x23
ping_request, // 0x24
place_recipe, // 0x25
player_abilities, // 0x26
player_action, // 0x27
player_command, // 0x28
player_input, // 0x29
player_loaded, // 0x2A
pong, // 0x2B
recipe_book_change_settings, // 0x2C
recipe_book_seen_recipe, // 0x2D
rename_item, // 0x2E
resource_pack, // 0x2F
seen_advancements, // 0x30
select_trade, // 0x31
set_beacon, // 0x32
set_carried_item, // 0x33
set_command_block, // 0x34
set_command_minecart, // 0x35
set_creative_mode_slot, // 0x36
set_jigsaw_block, // 0x37
set_structure_block, // 0x38
set_test_block, // 0x39
sign_update, // 0x3A
swing, // 0x3B
teleport_to_entity, // 0x3C
test_instance_block_action, // 0x3D
use_item_on, // 0x3E
use_item, // 0x3F
accept_teleportation,
block_entity_tag_query,
bundle_item_selected,
change_difficulty,
change_game_mode,
chat_ack,
chat_command,
chat_command_signed,
chat,
chat_session_update,
chunk_batch_received,
client_command,
client_tick_end,
client_information,
command_suggestion,
configuration_acknowledged,
container_button_click,
container_click,
container_close,
container_slot_state_changed,
cookie_response,
custom_payload,
debug_sample_subscription,
edit_book,
entity_tag_query,
interact,
jigsaw_generate,
keep_alive,
lock_difficulty,
move_player_pos,
move_player_pos_rot,
move_player_rot,
move_player_status_only,
move_vehicle,
paddle_boat,
pick_item_from_block,
pick_item_from_entity,
ping_request,
place_recipe,
player_abilities,
player_action,
player_command,
player_input,
player_loaded,
pong,
recipe_book_change_settings,
recipe_book_seen_recipe,
rename_item,
resource_pack,
seen_advancements,
select_trade,
set_beacon,
set_carried_item,
set_command_block,
set_command_minecart,
set_creative_mode_slot,
set_jigsaw_block,
set_structure_block,
set_test_block,
sign_update,
swing,
teleport_to_entity,
test_instance_block_action,
use_item_on,
use_item,
custom_click_action,
]
);

View file

@ -0,0 +1,8 @@
use azalea_buf::AzBuf;
use azalea_core::game_type::GameMode;
use azalea_protocol_macros::ServerboundGamePacket;
#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)]
pub struct ServerboundChangeGameMode {
pub mode: GameMode,
}

View file

@ -0,0 +1,9 @@
use azalea_buf::AzBuf;
use azalea_core::resource_location::ResourceLocation;
use azalea_protocol_macros::ServerboundGamePacket;
#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)]
pub struct ServerboundCustomClickAction {
pub id: ResourceLocation,
pub payload: Option<String>,
}

View file

@ -7,6 +7,6 @@ declare_state_packets!(HandshakePacket,
Clientbound => [
],
Serverbound => [
intention, // 0x00
intention,
]
);

View file

@ -5,18 +5,18 @@ use azalea_protocol_macros::declare_state_packets;
declare_state_packets!(LoginPacket,
Clientbound => [
login_disconnect, // 0x00
hello, // 0x01
login_finished, // 0x02
login_compression, // 0x03
custom_query, // 0x04
cookie_request, // 0x05
login_disconnect,
hello,
login_finished,
login_compression,
custom_query,
cookie_request,
],
Serverbound => [
hello, // 0x00
key, // 0x01
custom_query_answer, // 0x02
login_acknowledged, // 0x03
cookie_response, // 0x04
hello,
key,
custom_query_answer,
login_acknowledged,
cookie_response,
]
);

View file

@ -11,8 +11,8 @@ use azalea_buf::{AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError};
use crate::read::ReadPacketError;
pub const PROTOCOL_VERSION: i32 = 1073742073;
pub const VERSION_NAME: &str = "25w19a";
pub const PROTOCOL_VERSION: i32 = 1073742075;
pub const VERSION_NAME: &str = "25w21a";
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum ConnectionProtocol {

View file

@ -5,11 +5,11 @@ use azalea_protocol_macros::declare_state_packets;
declare_state_packets!(StatusPacket,
Clientbound => [
status_response, // 0x00
pong_response, // 0x01
status_response,
pong_response,
],
Serverbound => [
status_request, // 0x00
ping_request, // 0x01
status_request,
ping_request,
]
);

View file

@ -45,6 +45,9 @@ macro_rules! data_registry {
data_registry! {Enchantment, "enchantment"}
data_registry! {DimensionType, "dimension_type"}
data_registry! {DamageKind, "damage_kind"}
data_registry! {Dialog, "dialog"}
// entity variants
data_registry! {WolfSoundVariant, "wolf_sound_variant"}
data_registry! {CowVariant, "cow_variant"}
data_registry! {ChickenVariant, "chicken_variant"}

View file

@ -1539,6 +1539,7 @@ enum CommandArgumentKind {
LootTable => "minecraft:loot_table",
LootPredicate => "minecraft:loot_predicate",
LootModifier => "minecraft:loot_modifier",
Dialog => "minecraft:dialog",
Uuid => "minecraft:uuid",
}
}
@ -3157,6 +3158,7 @@ enum Item {
MusicDisc5 => "minecraft:music_disc_5",
MusicDiscPigstep => "minecraft:music_disc_pigstep",
MusicDiscPrecipice => "minecraft:music_disc_precipice",
MusicDiscTears => "minecraft:music_disc_tears",
DiscFragment5 => "minecraft:disc_fragment_5",
Trident => "minecraft:trident",
NautilusShell => "minecraft:nautilus_shell",
@ -4644,6 +4646,7 @@ enum SoundEvent {
EntityHorseAmbient => "minecraft:entity.horse.ambient",
EntityHorseAngry => "minecraft:entity.horse.angry",
EntityHorseArmor => "minecraft:entity.horse.armor",
ItemHorseArmorUnequip => "minecraft:item.horse_armor.unequip",
EntityHorseBreathe => "minecraft:entity.horse.breathe",
EntityHorseDeath => "minecraft:entity.horse.death",
EntityHorseEat => "minecraft:entity.horse.eat",
@ -4715,8 +4718,9 @@ enum SoundEvent {
BlockLeafLitterPlace => "minecraft:block.leaf_litter.place",
BlockLeafLitterHit => "minecraft:block.leaf_litter.hit",
BlockLeafLitterFall => "minecraft:block.leaf_litter.fall",
EntityLeashKnotBreak => "minecraft:entity.leash_knot.break",
EntityLeashKnotPlace => "minecraft:entity.leash_knot.place",
ItemLeadUntied => "minecraft:item.lead.untied",
ItemLeadTied => "minecraft:item.lead.tied",
ItemLeadBreak => "minecraft:item.lead.break",
BlockLeverClick => "minecraft:block.lever.click",
EntityLightningBoltImpact => "minecraft:entity.lightning_bolt.impact",
EntityLightningBoltThunder => "minecraft:entity.lightning_bolt.thunder",
@ -4730,6 +4734,7 @@ enum SoundEvent {
EntityLlamaSpit => "minecraft:entity.llama.spit",
EntityLlamaStep => "minecraft:entity.llama.step",
EntityLlamaSwag => "minecraft:entity.llama.swag",
ItemLlamaCarpetUnequip => "minecraft:item.llama_carpet.unequip",
EntityMagmaCubeDeathSmall => "minecraft:entity.magma_cube.death_small",
BlockLodestoneBreak => "minecraft:block.lodestone.break",
BlockLodestoneStep => "minecraft:block.lodestone.step",
@ -4826,6 +4831,7 @@ enum SoundEvent {
MusicDiscCreator => "minecraft:music_disc.creator",
MusicDiscCreatorMusicBox => "minecraft:music_disc.creator_music_box",
MusicDiscPrecipice => "minecraft:music_disc.precipice",
MusicDiscTears => "minecraft:music_disc.tears",
MusicDragon => "minecraft:music.dragon",
MusicEnd => "minecraft:music.end",
MusicGame => "minecraft:music.game",
@ -5600,6 +5606,7 @@ enum SoundEvent {
EventMobEffectBadOmen => "minecraft:event.mob_effect.bad_omen",
EventMobEffectTrialOmen => "minecraft:event.mob_effect.trial_omen",
EventMobEffectRaidOmen => "minecraft:event.mob_effect.raid_omen",
ItemSaddleUnequip => "minecraft:item.saddle.unequip",
}
}
@ -6798,3 +6805,39 @@ enum SpawnConditionKind {
Biome => "minecraft:biome",
}
}
registry! {
enum DialogBodyKind {
Item => "minecraft:item",
PlainMessage => "minecraft:plain_message",
}
}
registry! {
enum DialogKind {
Notice => "minecraft:notice",
ServerLinks => "minecraft:server_links",
DialogList => "minecraft:dialog_list",
MultiAction => "minecraft:multi_action",
MultiActionInputForm => "minecraft:multi_action_input_form",
SimpleInputForm => "minecraft:simple_input_form",
Confirmation => "minecraft:confirmation",
}
}
registry! {
enum InputControlKind {
Boolean => "minecraft:boolean",
NumberRange => "minecraft:number_range",
SingleOption => "minecraft:single_option",
Text => "minecraft:text",
}
}
registry! {
enum SubmitMethodKind {
CommandTemplate => "minecraft:command_template",
CustomTemplate => "minecraft:custom_template",
CustomForm => "minecraft:custom_form",
}
}

View file

@ -1151,6 +1151,7 @@ pub static HORSE_FOOD: LazyLock<HashSet<Item>> = LazyLock::new(|| {
Item::Sugar,
Item::HayBlock,
Item::Apple,
Item::Carrot,
Item::GoldenCarrot,
Item::GoldenApple,
Item::EnchantedGoldenApple,

View file

@ -67,12 +67,12 @@ def set_packets(packets_report):
code.append(f'declare_state_packets!({to_camel_case(state)}Packet,')
code.append(' Clientbound => [')
for packet_id, packet_name in enumerate(clientbound_packets):
code.append(f' {packet_name}, // {padded_hex(packet_id)}')
code.append(f' {packet_name},')
expected_packet_module_names.add(get_packet_module_name(packet_name, 'clientbound'))
code.append(' ],')
code.append(' Serverbound => [')
for packet_id, packet_name in enumerate(serverbound_packets):
code.append(f' {packet_name}, // {padded_hex(packet_id)}')
code.append(f' {packet_name},')
expected_packet_module_names.add(get_packet_module_name(packet_name, 'serverbound'))
code.append(' ]')
code.append(');')

View file

@ -213,7 +213,7 @@ def clear_version_cache():
'yarn_versions.json',
'fabric_api_versions.json',
'fabric_loader_versions.json',
'fabric-api-maven-metadata.json',
'fabric-api-maven-metadata.xml',
]
for file in files:
if os.path.exists(get_dir_location(f'__cache__/{file}')):

View file

@ -152,8 +152,10 @@ fabric_version={fabric_api_version}
f.write(gradle_properties)
# update the minecraft version dependency in src/main/resources/fabric.mod.json
with open(f'{pumpkin_dir}/src/main/resources/fabric.mod.json', 'w') as f:
fabric_mod_json_path = f'{pumpkin_dir}/src/main/resources/fabric.mod.json'
with open(fabric_mod_json_path, 'r') as f:
fabric_mod_json = f.read()
with open(fabric_mod_json_path, 'w') as f:
fabric_mod_json = fabric_mod_json.replace(
'"minecraft": "${minecraft_version}"',
f'"minecraft": "*"'