1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

McBuf -> AzBuf

This commit is contained in:
mat 2024-11-27 02:10:14 +00:00
parent 22bdc50130
commit 35441c33fa
267 changed files with 748 additions and 760 deletions

View file

@ -1,10 +1,10 @@
use std::collections::HashMap;
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
#[derive(McBuf, Debug, Clone, Default, Eq, PartialEq)]
#[derive(AzBuf, Debug, Clone, Default, Eq, PartialEq)]
pub struct GameProfile {
/// The UUID of the player.
pub uuid: Uuid,
@ -43,7 +43,7 @@ impl From<SerializableGameProfile> for GameProfile {
}
}
#[derive(McBuf, Debug, Clone, Eq, PartialEq)]
#[derive(AzBuf, Debug, Clone, Eq, PartialEq)]
pub struct ProfilePropertyValue {
pub value: String,
pub signature: Option<String>,

View file

@ -4,7 +4,7 @@ use std::{collections::HashSet, hash::Hash};
#[cfg(feature = "azalea-buf")]
use azalea_buf::{
BufReadError, McBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite,
BufReadError, AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite,
};
#[cfg(feature = "azalea-buf")]
use azalea_chat::FormattedText;
@ -81,7 +81,7 @@ impl Suggestions {
#[cfg(feature = "azalea-buf")]
impl AzaleaRead for Suggestions {
fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
#[derive(McBuf)]
#[derive(AzBuf)]
struct StandaloneSuggestion {
pub text: String,
pub tooltip: Option<FormattedText>,

View file

@ -1,5 +1,5 @@
[package]
description = "#[derive(McBuf)]"
description = "#[derive(AzBuf)]"
edition = "2021"
license = "MIT"
name = "azalea-buf-macros"

View file

@ -19,8 +19,8 @@ pub fn derive_azaleawrite(input: TokenStream) -> TokenStream {
write::create_impl_azaleawrite(&ident, &data).into()
}
#[proc_macro_derive(McBuf, attributes(var))]
pub fn derive_mcbuf(input: TokenStream) -> TokenStream {
#[proc_macro_derive(AzBuf, attributes(var))]
pub fn derive_azbuf(input: TokenStream) -> TokenStream {
let DeriveInput { ident, data, .. } = parse_macro_input!(input);
let writable = write::create_impl_azaleawrite(&ident, &data);

View file

@ -63,7 +63,7 @@ pub fn create_impl_azalearead(ident: &Ident, data: &Data) -> proc_macro2::TokenS
}
}
_ => {
panic!("#[derive(McBuf)] can only be used on structs with named fields")
panic!("#[derive(AzBuf)] can only be used on structs with named fields")
}
},
syn::Data::Enum(syn::DataEnum { variants, .. }) => {
@ -157,6 +157,6 @@ pub fn create_impl_azalearead(ident: &Ident, data: &Data) -> proc_macro2::TokenS
}
}
}
_ => panic!("#[derive(McBuf)] can only be used on structs"),
_ => panic!("#[derive(AzBuf)] can only be used on structs"),
}
}

View file

@ -63,7 +63,7 @@ pub fn create_impl_azaleawrite(ident: &Ident, data: &Data) -> proc_macro2::Token
}
}
_ => {
panic!("#[derive(McBuf)] can only be used on structs with named fields")
panic!("#[derive(AzBuf)] can only be used on structs with named fields")
}
},
syn::Data::Enum(syn::DataEnum { variants, .. }) => {
@ -197,6 +197,6 @@ pub fn create_impl_azaleawrite(ident: &Ident, data: &Data) -> proc_macro2::Token
}
}
}
_ => panic!("#[derive(McBuf)] can only be used on structs"),
_ => panic!("#[derive(AzBuf)] can only be used on structs"),
}
}

View file

@ -1,7 +1,7 @@
use std::{collections::HashMap, fmt};
#[cfg(feature = "azalea-buf")]
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use once_cell::sync::Lazy;
use serde::{ser::SerializeStruct, Serialize, Serializer};
use serde_json::Value;
@ -101,7 +101,7 @@ impl Ansi {
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
#[cfg_attr(feature = "azalea-buf", derive(McBuf))]
#[cfg_attr(feature = "azalea-buf", derive(AzBuf))]
pub enum ChatFormatting {
Black,
DarkBlue,

View file

@ -29,7 +29,7 @@ use crate::{
/// A chat packet, either a system message or a chat message.
#[derive(Debug, Clone, PartialEq)]
pub enum Chat {
pub enum ChatPacket {
System(Arc<ClientboundSystemChat>),
Player(Arc<ClientboundPlayerChat>),
Disguised(Arc<ClientboundDisguisedChat>),
@ -42,13 +42,13 @@ macro_rules! regex {
}};
}
impl Chat {
impl ChatPacket {
/// Get the message shown in chat for this packet.
pub fn message(&self) -> FormattedText {
match self {
Chat::System(p) => p.content.clone(),
Chat::Player(p) => p.message(),
Chat::Disguised(p) => p.message(),
ChatPacket::System(p) => p.content.clone(),
ChatPacket::Player(p) => p.message(),
ChatPacket::Disguised(p) => p.message(),
}
}
@ -58,7 +58,7 @@ impl Chat {
/// None.
pub fn split_sender_and_content(&self) -> (Option<String>, String) {
match self {
Chat::System(p) => {
ChatPacket::System(p) => {
let message = p.content.to_string();
// Overlay messages aren't in chat
if p.overlay {
@ -72,13 +72,13 @@ impl Chat {
(None, message)
}
Chat::Player(p) => (
ChatPacket::Player(p) => (
// If it's a player chat packet, then the sender and content
// are already split for us.
Some(p.chat_type.name.to_string()),
p.body.content.clone(),
),
Chat::Disguised(p) => (
ChatPacket::Disguised(p) => (
// disguised chat packets are basically the same as player chat packets but without
// the chat signing things
Some(p.chat_type.name.to_string()),
@ -99,9 +99,9 @@ impl Chat {
/// when a server uses a plugin to modify chat messages).
pub fn uuid(&self) -> Option<Uuid> {
match self {
Chat::System(_) => None,
Chat::Player(m) => Some(m.sender),
Chat::Disguised(_) => None,
ChatPacket::System(_) => None,
ChatPacket::Player(m) => Some(m.sender),
ChatPacket::Disguised(_) => None,
}
}
@ -115,7 +115,7 @@ impl Chat {
/// Create a new Chat from a string. This is meant to be used as a
/// convenience function for testing.
pub fn new(message: &str) -> Self {
Chat::System(Arc::new(ClientboundSystemChat {
ChatPacket::System(Arc::new(ClientboundSystemChat {
content: FormattedText::from(message),
overlay: false,
}))
@ -197,7 +197,7 @@ impl Plugin for ChatPlugin {
#[derive(Event, Debug, Clone)]
pub struct ChatReceivedEvent {
pub entity: Entity,
pub packet: Chat,
pub packet: ChatPacket,
}
/// Send a chat message (or command, if it starts with a slash) to the server.

View file

@ -21,7 +21,7 @@ use derive_more::{Deref, DerefMut};
use tokio::sync::mpsc;
use crate::{
chat::{Chat, ChatReceivedEvent},
chat::{ChatPacket, ChatReceivedEvent},
disconnect::DisconnectEvent,
packet_handling::game::{
AddPlayerEvent, DeathEvent, KeepAliveEvent, PacketEvent, RemovePlayerEvent,
@ -62,7 +62,7 @@ pub enum Event {
/// The client is now in the world. Fired when we receive a login packet.
Login,
/// A chat message was sent in the game chat.
Chat(Chat),
Chat(ChatPacket),
/// Happens 20 times per second, but only when the world is loaded.
Tick,
/// We received a packet from the server.

View file

@ -33,7 +33,7 @@ use tracing::{debug, error, trace, warn};
use uuid::Uuid;
use crate::{
chat::{Chat, ChatReceivedEvent},
chat::{ChatPacket, ChatReceivedEvent},
chunks,
disconnect::DisconnectEvent,
inventory::{
@ -1030,7 +1030,7 @@ pub fn process_packet_events(ecs: &mut World) {
chat_events.send(ChatReceivedEvent {
entity: player_entity,
packet: Chat::Player(Arc::new(p.clone())),
packet: ChatPacket::Player(Arc::new(p.clone())),
});
}
ClientboundGamePacket::SystemChat(p) => {
@ -1042,7 +1042,7 @@ pub fn process_packet_events(ecs: &mut World) {
chat_events.send(ChatReceivedEvent {
entity: player_entity,
packet: Chat::System(Arc::new(p.clone())),
packet: ChatPacket::System(Arc::new(p.clone())),
});
}
ClientboundGamePacket::DisguisedChat(p) => {
@ -1054,7 +1054,7 @@ pub fn process_packet_events(ecs: &mut World) {
chat_events.send(ChatReceivedEvent {
entity: player_entity,
packet: Chat::Disguised(Arc::new(p.clone())),
packet: ChatPacket::Disguised(Arc::new(p.clone())),
});
}
ClientboundGamePacket::Sound(_p) => {

View file

@ -1,9 +1,9 @@
use std::io::{Cursor, Write};
use azalea_buf::{BufReadError, McBuf, AzaleaRead, AzaleaWrite};
use azalea_buf::{BufReadError, AzBuf, AzaleaRead, AzaleaWrite};
/// Represents Java's BitSet, a list of bits.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, McBuf)]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, AzBuf)]
pub struct BitSet {
data: Vec<u64>,
}

View file

@ -1,4 +1,4 @@
pub use azalea_buf::McBuf;
pub use azalea_buf::AzBuf;
use crate::position::Vec3;
@ -9,7 +9,7 @@ pub trait PositionDeltaTrait {
}
/// Only works for up to 8 blocks
#[derive(Clone, Debug, McBuf, Default)]
#[derive(Clone, Debug, AzBuf, Default)]
pub struct PositionDelta8 {
pub xa: i16,
pub ya: i16,

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use crate::position::Vec3;
#[derive(Clone, Copy, Debug, McBuf, Default, Eq, PartialEq)]
#[derive(Clone, Copy, Debug, AzBuf, Default, Eq, PartialEq)]
pub enum Direction {
#[default]
Down = 0,
@ -62,7 +62,7 @@ impl Direction {
}
// TODO: make azalea_block use this instead of FacingCardinal
#[derive(Clone, Copy, Debug, McBuf, PartialEq, Eq, Hash)]
#[derive(Clone, Copy, Debug, AzBuf, PartialEq, Eq, Hash)]
pub enum CardinalDirection {
North,
South,

View file

@ -3,9 +3,9 @@ use std::{
str::FromStr,
};
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
#[derive(Clone, Copy, Debug, McBuf)]
#[derive(Clone, Copy, Debug, AzBuf)]
pub enum ObjectiveCriteria {
Integer,
Hearts,

View file

@ -11,7 +11,7 @@ use std::{
str::FromStr,
};
use azalea_buf::{BufReadError, McBuf, AzaleaRead, AzaleaWrite};
use azalea_buf::{BufReadError, AzBuf, AzaleaRead, AzaleaWrite};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
@ -214,7 +214,7 @@ macro_rules! vec3_impl {
/// Used to represent an exact position in the world where an entity could be.
/// For blocks, [`BlockPos`] is used instead.
#[derive(Clone, Copy, Debug, Default, PartialEq, McBuf)]
#[derive(Clone, Copy, Debug, Default, PartialEq, AzBuf)]
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
pub struct Vec3 {
pub x: f64,

View file

@ -6,7 +6,7 @@ use std::{
str::FromStr,
};
use azalea_buf::{BufReadError, AzaleaRead, AzaleaWrite};
use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError};
#[cfg(feature = "serde")]
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
use simdnbt::{owned::NbtTag, FromNbtTag, ToNbtTag};
@ -142,7 +142,7 @@ mod tests {
}
#[test]
fn mcbuf_resource_location() {
fn azbuf_resource_location() {
let mut buf = Vec::new();
ResourceLocation::new("minecraft:dirt")
.azalea_write(&mut buf)

View file

@ -1,6 +1,6 @@
use std::time::{SystemTime, UNIX_EPOCH};
use azalea_buf::{McBuf, AzaleaWrite};
use azalea_buf::{AzBuf, AzaleaWrite};
use rsa::{
signature::{RandomizedSigner, SignatureEncoding},
RsaPrivateKey,
@ -8,18 +8,18 @@ use rsa::{
use sha2::Sha256;
use uuid::Uuid;
#[derive(Debug, Clone, McBuf)]
#[derive(Debug, Clone, AzBuf)]
pub struct SaltSignaturePair {
pub salt: u64,
pub signature: Vec<u8>,
}
#[derive(Clone, Debug, PartialEq, McBuf)]
#[derive(Clone, Debug, PartialEq, AzBuf)]
pub struct MessageSignature {
pub bytes: [u8; 256],
}
#[derive(Clone, Debug, McBuf, PartialEq)]
#[derive(Clone, Debug, AzBuf, PartialEq)]
pub struct SignedMessageHeader {
pub previous_signature: Option<MessageSignature>,
pub sender: Uuid,

View file

@ -2,7 +2,7 @@
use std::collections::{hash_map, HashMap};
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::resource_location::ResourceLocation;
use bevy_ecs::component::Component;
use thiserror::Error;
@ -71,14 +71,14 @@ impl AttributeInstance {
}
}
#[derive(Clone, Debug, McBuf)]
#[derive(Clone, Debug, AzBuf)]
pub struct AttributeModifier {
pub id: ResourceLocation,
pub amount: f64,
pub operation: AttributeModifierOperation,
}
#[derive(Clone, Debug, Copy, McBuf)]
#[derive(Clone, Debug, Copy, AzBuf)]
pub enum AttributeModifierOperation {
Addition,
MultiplyBase,

View file

@ -2,7 +2,7 @@
use std::io::{Cursor, Write};
use azalea_buf::{AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError, McBuf};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError};
use azalea_chat::FormattedText;
use azalea_core::{
direction::Direction,
@ -62,7 +62,7 @@ impl AzaleaWrite for EntityMetadataItems {
// Note: This enum is partially generated and parsed by
// codegen/lib/code/entity.py
#[derive(Clone, Debug, EnumAsInner, McBuf)]
#[derive(Clone, Debug, EnumAsInner, AzBuf)]
pub enum EntityDataValue {
Byte(u8),
Int(#[var] i32),
@ -102,7 +102,7 @@ pub enum EntityDataValue {
#[derive(Clone, Debug)]
pub struct OptionalUnsignedInt(pub Option<u32>);
#[derive(Clone, Debug, McBuf)]
#[derive(Clone, Debug, AzBuf)]
pub struct Quaternion {
pub x: f32,
pub y: f32,
@ -112,7 +112,7 @@ pub struct Quaternion {
// mojang just calls this ArmadilloState but i added "Kind" since otherwise it
// collides with a name in metadata.rs
#[derive(Clone, Debug, Copy, Default, McBuf)]
#[derive(Clone, Debug, Copy, Default, AzBuf)]
pub enum ArmadilloStateKind {
#[default]
Idle,
@ -140,14 +140,14 @@ impl AzaleaWrite for OptionalUnsignedInt {
}
/// A set of x, y, and z rotations. This is used for armor stands.
#[derive(Clone, Debug, McBuf, Default)]
#[derive(Clone, Debug, AzBuf, Default)]
pub struct Rotations {
pub x: f32,
pub y: f32,
pub z: f32,
}
#[derive(Clone, Debug, Copy, McBuf, Default, Component, Eq, PartialEq)]
#[derive(Clone, Debug, Copy, AzBuf, Default, Component, Eq, PartialEq)]
pub enum Pose {
#[default]
Standing = 0,
@ -160,7 +160,7 @@ pub enum Pose {
Dying,
}
#[derive(Debug, Clone, McBuf)]
#[derive(Debug, Clone, AzBuf)]
pub struct VillagerData {
pub kind: azalea_registry::VillagerKind,
pub profession: azalea_registry::VillagerProfession,
@ -197,7 +197,7 @@ impl TryFrom<EntityMetadataItems> for Vec<EntityDataValue> {
}
}
#[derive(Debug, Copy, Clone, McBuf, Default)]
#[derive(Debug, Copy, Clone, AzBuf, Default)]
pub enum SnifferState {
#[default]
Idling,

View file

@ -1,4 +1,4 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::position::BlockPos;
use azalea_inventory::ItemStack;
use azalea_registry::ParticleKind;
@ -7,7 +7,7 @@ use bevy_ecs::component::Component;
// the order of this enum must be kept in sync with ParticleKind, otherwise
// we get errors parsing particles.
/// A [`ParticleKind`] with data potentially attached to it.
#[derive(Component, Clone, Debug, McBuf, Default)]
#[derive(Component, Clone, Debug, AzBuf, Default)]
pub enum Particle {
AngryVillager,
Block(BlockParticle),
@ -249,12 +249,12 @@ impl From<ParticleKind> for Particle {
}
}
#[derive(Debug, Clone, McBuf, Default)]
#[derive(Debug, Clone, AzBuf, Default)]
pub struct BlockParticle {
#[var]
pub block_state: i32,
}
#[derive(Debug, Clone, McBuf, Default)]
#[derive(Debug, Clone, AzBuf, Default)]
pub struct DustParticle {
/// Red value, 0-1
pub red: f32,
@ -266,7 +266,7 @@ pub struct DustParticle {
pub scale: f32,
}
#[derive(Debug, Clone, McBuf, Default)]
#[derive(Debug, Clone, AzBuf, Default)]
pub struct DustColorTransitionParticle {
/// Red value, 0-1
pub from_red: f32,
@ -284,12 +284,12 @@ pub struct DustColorTransitionParticle {
pub to_blue: f32,
}
#[derive(Debug, Clone, McBuf, Default)]
#[derive(Debug, Clone, AzBuf, Default)]
pub struct ItemParticle {
pub item: ItemStack,
}
#[derive(Debug, Clone, McBuf, Default)]
#[derive(Debug, Clone, AzBuf, Default)]
pub struct VibrationParticle {
pub origin: BlockPos,
pub position_type: String,
@ -300,12 +300,12 @@ pub struct VibrationParticle {
pub ticks: u32,
}
#[derive(Debug, Clone, McBuf, Default)]
#[derive(Debug, Clone, AzBuf, Default)]
pub struct SculkChargeParticle {
pub roll: f32,
}
#[derive(Debug, Clone, McBuf, Default)]
#[derive(Debug, Clone, AzBuf, Default)]
pub struct ShriekParticle {
#[var]
pub delay: i32, // The time in ticks before the particle is displayed

View file

@ -1,7 +1,7 @@
use core::f64;
use std::{any::Any, collections::HashMap, io::Cursor};
use azalea_buf::{BufReadError, McBuf, AzaleaRead, AzaleaWrite};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite, BufReadError};
use azalea_chat::FormattedText;
use azalea_core::{position::GlobalPos, resource_location::ResourceLocation};
use azalea_registry::{
@ -134,27 +134,27 @@ pub fn from_kind(
})
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct CustomData {
pub nbt: Nbt,
}
impl DataComponent for CustomData {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct MaxStackSize {
#[var]
pub count: i32,
}
impl DataComponent for MaxStackSize {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct MaxDamage {
#[var]
pub amount: i32,
}
impl DataComponent for MaxDamage {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Damage {
#[var]
pub amount: i32,
@ -162,7 +162,7 @@ pub struct Damage {
impl DataComponent for Damage {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Unbreakable {
pub show_in_tooltip: bool,
}
@ -175,26 +175,26 @@ impl Default for Unbreakable {
}
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct CustomName {
pub name: FormattedText,
}
impl DataComponent for CustomName {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct ItemName {
pub name: FormattedText,
}
impl DataComponent for ItemName {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Lore {
pub lines: Vec<FormattedText>,
// vanilla also has styled_lines here but it doesn't appear to be used for the protocol
}
impl DataComponent for Lore {}
#[derive(Clone, PartialEq, Copy, McBuf)]
#[derive(Clone, PartialEq, Copy, AzBuf)]
pub enum Rarity {
Common,
Uncommon,
@ -203,7 +203,7 @@ pub enum Rarity {
}
impl DataComponent for Rarity {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Enchantments {
#[var]
pub levels: HashMap<Enchantment, u32>,
@ -211,7 +211,7 @@ pub struct Enchantments {
}
impl DataComponent for Enchantments {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub enum BlockStateValueMatcher {
Exact {
value: String,
@ -222,38 +222,38 @@ pub enum BlockStateValueMatcher {
},
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct BlockStatePropertyMatcher {
pub name: String,
pub value_matcher: BlockStateValueMatcher,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct BlockPredicate {
pub blocks: Option<HolderSet<Block, ResourceLocation>>,
pub properties: Option<Vec<BlockStatePropertyMatcher>>,
pub nbt: Option<NbtCompound>,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct AdventureModePredicate {
pub predicates: Vec<BlockPredicate>,
pub show_in_tooltip: bool,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct CanPlaceOn {
pub predicate: AdventureModePredicate,
}
impl DataComponent for CanPlaceOn {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct CanBreak {
pub predicate: AdventureModePredicate,
}
impl DataComponent for CanBreak {}
#[derive(Clone, Copy, PartialEq, McBuf)]
#[derive(Clone, Copy, PartialEq, AzBuf)]
pub enum EquipmentSlotGroup {
Any,
Mainhand,
@ -267,7 +267,7 @@ pub enum EquipmentSlotGroup {
Body,
}
#[derive(Clone, Copy, PartialEq, McBuf)]
#[derive(Clone, Copy, PartialEq, AzBuf)]
pub enum AttributeModifierOperation {
Addition,
MultiplyBase,
@ -277,7 +277,7 @@ pub enum AttributeModifierOperation {
// this is duplicated in azalea-entity, BUT the one there has a different
// protocol format (and we can't use it anyways because it would cause a
// circular dependency)
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct AttributeModifier {
pub uuid: Uuid,
pub name: String,
@ -285,57 +285,57 @@ pub struct AttributeModifier {
pub operation: AttributeModifierOperation,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct AttributeModifiersEntry {
pub attribute: Attribute,
pub modifier: AttributeModifier,
pub slot: EquipmentSlotGroup,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct AttributeModifiers {
pub modifiers: Vec<AttributeModifiersEntry>,
pub show_in_tooltip: bool,
}
impl DataComponent for AttributeModifiers {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct CustomModelData {
#[var]
pub value: i32,
}
impl DataComponent for CustomModelData {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct HideAdditionalTooltip;
impl DataComponent for HideAdditionalTooltip {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct HideTooltip;
impl DataComponent for HideTooltip {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct RepairCost {
#[var]
pub cost: u32,
}
impl DataComponent for RepairCost {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct CreativeSlotLock;
impl DataComponent for CreativeSlotLock {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct EnchantmentGlintOverride {
pub show_glint: bool,
}
impl DataComponent for EnchantmentGlintOverride {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct IntangibleProjectile;
impl DataComponent for IntangibleProjectile {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct MobEffectDetails {
#[var]
pub amplifier: i32,
@ -347,19 +347,19 @@ pub struct MobEffectDetails {
pub hidden_effect: Option<Box<MobEffectDetails>>,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct MobEffectInstance {
pub effect: MobEffect,
pub details: MobEffectDetails,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct PossibleEffect {
pub effect: MobEffectInstance,
pub probability: f32,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Food {
#[var]
pub nutrition: i32,
@ -370,14 +370,14 @@ pub struct Food {
}
impl DataComponent for Food {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct ToolRule {
pub blocks: HolderSet<Block, ResourceLocation>,
pub speed: Option<f32>,
pub correct_for_drops: Option<bool>,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Tool {
pub rules: Vec<ToolRule>,
pub default_mining_speed: f32,
@ -386,7 +386,7 @@ pub struct Tool {
}
impl DataComponent for Tool {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct StoredEnchantments {
#[var]
pub enchantments: HashMap<Enchantment, i32>,
@ -394,52 +394,52 @@ pub struct StoredEnchantments {
}
impl DataComponent for StoredEnchantments {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct DyedColor {
pub rgb: i32,
pub show_in_tooltip: bool,
}
impl DataComponent for DyedColor {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct MapColor {
pub color: i32,
}
impl DataComponent for MapColor {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct MapId {
#[var]
pub id: i32,
}
impl DataComponent for MapId {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct MapDecorations {
pub decorations: NbtCompound,
}
impl DataComponent for MapDecorations {}
#[derive(Clone, Copy, PartialEq, McBuf)]
#[derive(Clone, Copy, PartialEq, AzBuf)]
pub enum MapPostProcessing {
Lock,
Scale,
}
impl DataComponent for MapPostProcessing {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct ChargedProjectiles {
pub items: Vec<ItemStack>,
}
impl DataComponent for ChargedProjectiles {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct BundleContents {
pub items: Vec<ItemStack>,
}
impl DataComponent for BundleContents {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct PotionContents {
pub potion: Option<Potion>,
pub custom_color: Option<i32>,
@ -447,26 +447,26 @@ pub struct PotionContents {
}
impl DataComponent for PotionContents {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct SuspiciousStewEffect {
pub effect: MobEffect,
#[var]
pub duration: i32,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct SuspiciousStewEffects {
pub effects: Vec<SuspiciousStewEffect>,
}
impl DataComponent for SuspiciousStewEffects {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct WritableBookContent {
pub pages: Vec<String>,
}
impl DataComponent for WritableBookContent {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct WrittenBookContent {
pub title: String,
pub author: String,
@ -477,7 +477,7 @@ pub struct WrittenBookContent {
}
impl DataComponent for WrittenBookContent {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Trim {
pub material: TrimMaterial,
pub pattern: TrimPattern,
@ -485,57 +485,57 @@ pub struct Trim {
}
impl DataComponent for Trim {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct DebugStickState {
pub properties: NbtCompound,
}
impl DataComponent for DebugStickState {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct EntityData {
pub entity: NbtCompound,
}
impl DataComponent for EntityData {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct BucketEntityData {
pub entity: NbtCompound,
}
impl DataComponent for BucketEntityData {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct BlockEntityData {
pub entity: NbtCompound,
}
impl DataComponent for BlockEntityData {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Instrument {
pub instrument: azalea_registry::Instrument,
}
impl DataComponent for Instrument {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct OminousBottleAmplifier {
#[var]
pub amplifier: i32,
}
impl DataComponent for OminousBottleAmplifier {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Recipes {
pub recipes: Vec<ResourceLocation>,
}
impl DataComponent for Recipes {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct LodestoneTracker {
pub target: Option<GlobalPos>,
pub tracked: bool,
}
impl DataComponent for LodestoneTracker {}
#[derive(Clone, Copy, PartialEq, McBuf)]
#[derive(Clone, Copy, PartialEq, AzBuf)]
pub enum FireworkExplosionShape {
SmallBall,
LargeBall,
@ -544,7 +544,7 @@ pub enum FireworkExplosionShape {
Burst,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct FireworkExplosion {
pub shape: FireworkExplosionShape,
pub colors: Vec<i32>,
@ -554,7 +554,7 @@ pub struct FireworkExplosion {
}
impl DataComponent for FireworkExplosion {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Fireworks {
#[var]
pub flight_duration: i32,
@ -562,14 +562,14 @@ pub struct Fireworks {
}
impl DataComponent for Fireworks {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct GameProfileProperty {
pub name: String,
pub value: String,
pub signature: Option<String>,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Profile {
pub name: String,
pub id: Option<Uuid>,
@ -577,13 +577,13 @@ pub struct Profile {
}
impl DataComponent for Profile {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct NoteBlockSound {
pub sound: ResourceLocation,
}
impl DataComponent for NoteBlockSound {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct BannerPattern {
#[var]
pub pattern: i32,
@ -591,13 +591,13 @@ pub struct BannerPattern {
pub color: i32,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct BannerPatterns {
pub patterns: Vec<BannerPattern>,
}
impl DataComponent for BannerPatterns {}
#[derive(Clone, Copy, PartialEq, McBuf)]
#[derive(Clone, Copy, PartialEq, AzBuf)]
pub enum DyeColor {
White,
Orange,
@ -617,31 +617,31 @@ pub enum DyeColor {
Black,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct BaseColor {
pub color: DyeColor,
}
impl DataComponent for BaseColor {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct PotDecorations {
pub items: Vec<Item>,
}
impl DataComponent for PotDecorations {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Container {
pub items: Vec<ItemStack>,
}
impl DataComponent for Container {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct BlockState {
pub properties: HashMap<String, String>,
}
impl DataComponent for BlockState {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct BeehiveOccupant {
pub entity_data: NbtCompound,
#[var]
@ -650,32 +650,32 @@ pub struct BeehiveOccupant {
pub min_ticks_in_hive: i32,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Bees {
pub occupants: Vec<BeehiveOccupant>,
}
impl DataComponent for Bees {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Lock {
pub key: String,
}
impl DataComponent for Lock {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct ContainerLoot {
pub loot: NbtCompound,
}
impl DataComponent for ContainerLoot {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct JukeboxPlayable {
pub song: azalea_registry::JukeboxSong,
pub show_in_tooltip: bool,
}
impl DataComponent for JukeboxPlayable {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Consumable {
pub consume_seconds: f32,
pub animation: ItemUseAnimation,
@ -685,7 +685,7 @@ pub struct Consumable {
}
impl DataComponent for Consumable {}
#[derive(Clone, Copy, PartialEq, McBuf)]
#[derive(Clone, Copy, PartialEq, AzBuf)]
pub enum ItemUseAnimation {
None,
Eat,
@ -699,39 +699,39 @@ pub enum ItemUseAnimation {
Brush,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct UseRemainder {
pub convert_into: ItemStack,
}
impl DataComponent for UseRemainder {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct UseCooldown {
pub seconds: f32,
pub cooldown_group: Option<ResourceLocation>,
}
impl DataComponent for UseCooldown {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Enchantable {
#[var]
pub value: u32,
}
impl DataComponent for Enchantable {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Repairable {
pub items: HolderSet<Item, ResourceLocation>,
}
impl DataComponent for Repairable {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct ItemModel {
pub resource_location: ResourceLocation,
}
impl DataComponent for ItemModel {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct DamageResistant {
// in the vanilla code this is
// ```
@ -745,7 +745,7 @@ pub struct DamageResistant {
}
impl DataComponent for DamageResistant {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Equippable {
pub slot: EquipmentSlot,
pub equip_sound: SoundEvent,
@ -754,7 +754,7 @@ pub struct Equippable {
}
impl DataComponent for Equippable {}
#[derive(Clone, Copy, Debug, PartialEq, McBuf)]
#[derive(Clone, Copy, Debug, PartialEq, AzBuf)]
pub enum EquipmentSlot {
Mainhand,
Offhand,
@ -767,17 +767,17 @@ pub enum EquipmentSlot {
Body,
}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct Glider;
impl DataComponent for Glider {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct TooltipStyle {
pub resource_location: ResourceLocation,
}
impl DataComponent for TooltipStyle {}
#[derive(Clone, PartialEq, McBuf)]
#[derive(Clone, PartialEq, AzBuf)]
pub struct DeathProtection {
pub death_effects: Vec<ConsumeEffectKind>,
}

View file

@ -1,6 +1,6 @@
use std::ops::RangeInclusive;
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use crate::{
item::MaxStackSizeExt, AnvilMenuLocation, BeaconMenuLocation, BlastFurnaceMenuLocation,
@ -250,7 +250,7 @@ impl ClickOperation {
}
}
#[derive(McBuf, Clone, Copy, Debug)]
#[derive(AzBuf, Clone, Copy, Debug)]
pub enum ClickType {
Pickup = 0,
QuickMove = 1,

View file

@ -21,6 +21,6 @@ Adding new packets is usually pretty easy, but you'll want to have Minecraft's d
### Implementing packets
You can manually implement reading and writing functionality for a packet by implementing AzaleaRead and AzaleaWrite, but you can also have this automatically generated for a struct or enum by deriving McBuf.
You can manually implement reading and writing functionality for a packet by implementing AzaleaRead and AzaleaWrite, but you can also have this automatically generated for a struct or enum by deriving AzBuf.
Look at other packets as an example.

View file

@ -1,13 +1,13 @@
//! Some serializable data types that are used by several packets.
use azalea_buf::{AzaleaRead, AzaleaWrite, McBuf};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite};
use azalea_core::bitset::FixedBitSet;
use bevy_ecs::component::Component;
/// A component that contains some of the "settings" for this client that are
/// sent to the server, such as render distance. This is only present on local
/// players.
#[derive(Clone, Debug, McBuf, PartialEq, Eq, Component)]
#[derive(Clone, Debug, AzBuf, PartialEq, Eq, Component)]
pub struct ClientInformation {
/// The locale of the client.
pub language: String,
@ -45,7 +45,7 @@ impl Default for ClientInformation {
}
}
#[derive(McBuf, Clone, Copy, Debug, PartialEq, Eq, Default)]
#[derive(AzBuf, Clone, Copy, Debug, PartialEq, Eq, Default)]
pub enum ChatVisibility {
/// All chat messages should be sent to the client.
#[default]
@ -57,7 +57,7 @@ pub enum ChatVisibility {
Hidden = 2,
}
#[derive(McBuf, Clone, Copy, Debug, PartialEq, Eq, Default)]
#[derive(AzBuf, Clone, Copy, Debug, PartialEq, Eq, Default)]
pub enum HumanoidArm {
Left = 0,
#[default]
@ -75,7 +75,7 @@ pub struct ModelCustomization {
pub hat: bool,
}
#[derive(McBuf, Clone, Copy, Debug, PartialEq, Eq, Default)]
#[derive(AzBuf, Clone, Copy, Debug, PartialEq, Eq, Default)]
pub enum ParticleStatus {
#[default]
All,

View file

@ -1,11 +1,11 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::{
game_type::{GameMode, OptionalGameType},
position::GlobalPos,
resource_location::ResourceLocation,
};
#[derive(Clone, Debug, McBuf)]
#[derive(Clone, Debug, AzBuf)]
pub struct CommonPlayerSpawnInfo {
pub dimension_type: azalea_registry::DimensionType,
pub dimension: ResourceLocation,

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::resource_location::ResourceLocation;
use azalea_protocol_macros::ClientboundConfigPacket;
#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundCookieRequest {
pub key: ResourceLocation,
}

View file

@ -1,9 +1,9 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_buf::UnsizedByteArray;
use azalea_core::resource_location::ResourceLocation;
use azalea_protocol_macros::ClientboundConfigPacket;
#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundCustomPayload {
pub identifier: ResourceLocation,
pub data: UnsizedByteArray,

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_chat::FormattedText;
use azalea_protocol_macros::ClientboundConfigPacket;
#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundDisconnect {
pub reason: FormattedText,
}

View file

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

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundConfigPacket;
#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundKeepAlive {
pub id: u64,
}

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundConfigPacket;
#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundPing {
pub id: u32,
}

View file

@ -1,11 +1,11 @@
use std::collections::HashMap;
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::resource_location::ResourceLocation;
use azalea_protocol_macros::ClientboundConfigPacket;
use simdnbt::owned::NbtCompound;
#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundRegistryData {
pub registry_id: ResourceLocation,
pub entries: HashMap<ResourceLocation, Option<NbtCompound>>,

View file

@ -1,5 +1,5 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundConfigPacket;
#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundResetChat;

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_chat::FormattedText;
use azalea_protocol_macros::ClientboundConfigPacket;
#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundResourcePack {
pub url: String,
pub hash: String,

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundConfigPacket;
use uuid::Uuid;
#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundResourcePackPop {
pub id: Option<Uuid>,
}

View file

@ -1,9 +1,9 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_chat::FormattedText;
use azalea_protocol_macros::ClientboundConfigPacket;
use uuid::Uuid;
#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundResourcePackPush {
pub id: Uuid,
pub url: String,

View file

@ -1,9 +1,9 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundConfigPacket;
use super::s_select_known_packs::KnownPack;
#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundSelectKnownPacks {
pub known_packs: Vec<KnownPack>,
}

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::resource_location::ResourceLocation;
use azalea_protocol_macros::ClientboundConfigPacket;
#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundStoreCookie {
pub key: ResourceLocation,
pub payload: Vec<u8>,

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundConfigPacket;
#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundTransfer {
pub host: String,
#[var]

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::resource_location::ResourceLocation;
use azalea_protocol_macros::ClientboundConfigPacket;
#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundUpdateEnabledFeatures {
pub features: Vec<ResourceLocation>,
}

View file

@ -2,12 +2,12 @@ use std::io::Cursor;
use std::ops::Deref;
use std::{collections::HashMap, io::Write};
use azalea_buf::{AzBuf, AzaleaReadVar, AzaleaWriteVar, BufReadError};
use azalea_buf::{AzaleaRead, AzaleaWrite};
use azalea_buf::{AzaleaWriteVar, BufReadError, McBuf, AzaleaReadVar};
use azalea_core::resource_location::ResourceLocation;
use azalea_protocol_macros::ClientboundConfigPacket;
#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)]
pub struct ClientboundUpdateTags {
pub tags: TagMap,
}

View file

@ -1,9 +1,9 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ServerboundConfigPacket;
use crate::common::ClientInformation;
#[derive(Clone, Debug, McBuf, ServerboundConfigPacket, PartialEq, Eq)]
#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket, PartialEq, Eq)]
pub struct ServerboundClientInformation {
pub information: ClientInformation,
}

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::resource_location::ResourceLocation;
use azalea_protocol_macros::ServerboundConfigPacket;
#[derive(Clone, Debug, McBuf, ServerboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)]
pub struct ServerboundCookieResponse {
pub key: ResourceLocation,
pub payload: Option<Vec<u8>>,

View file

@ -1,9 +1,9 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_buf::UnsizedByteArray;
use azalea_core::resource_location::ResourceLocation;
use azalea_protocol_macros::ServerboundConfigPacket;
#[derive(Clone, Debug, McBuf, ServerboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)]
pub struct ServerboundCustomPayload {
pub identifier: ResourceLocation,
pub data: UnsizedByteArray,

View file

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

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ServerboundConfigPacket;
#[derive(Clone, Debug, McBuf, ServerboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)]
pub struct ServerboundKeepAlive {
pub id: u64,
}

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ServerboundConfigPacket;
#[derive(Clone, Debug, McBuf, ServerboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)]
pub struct ServerboundPong {
pub id: u32,
}

View file

@ -1,14 +1,14 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ServerboundConfigPacket;
use uuid::Uuid;
#[derive(Clone, Debug, McBuf, ServerboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)]
pub struct ServerboundResourcePack {
pub id: Uuid,
pub action: Action,
}
#[derive(McBuf, Clone, Copy, Debug)]
#[derive(AzBuf, Clone, Copy, Debug)]
pub enum Action {
SuccessfullyLoaded = 0,
Declined = 1,

View file

@ -1,12 +1,12 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ServerboundConfigPacket;
#[derive(Clone, Debug, McBuf, ServerboundConfigPacket)]
#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)]
pub struct ServerboundSelectKnownPacks {
pub known_packs: Vec<KnownPack>,
}
#[derive(Clone, Debug, McBuf)]
#[derive(Clone, Debug, AzBuf)]
pub struct KnownPack {
pub namespace: String,
pub id: String,

View file

@ -1,10 +1,10 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::{position::Vec3, resource_location::ResourceLocation};
use azalea_entity::{metadata::apply_default_metadata, EntityBundle};
use azalea_protocol_macros::ClientboundGamePacket;
use uuid::Uuid;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundAddEntity {
/// The id of the entity.
#[var]

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundAddExperienceOrb {
#[var]
pub id: u32,

View file

@ -1,4 +1,4 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::{ResourceLocation, Vec3};
use azalea_entity::{metadata::PlayerMetadataBundle, EntityBundle, PlayerBundle};
use azalea_protocol_macros::ClientboundGamePacket;
@ -7,7 +7,7 @@ use uuid::Uuid;
/// This packet is sent by the server when a player comes into visible range,
/// not when a player joins.
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundAddPlayer {
#[var]
pub id: u32,

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundAnimate {
#[var]
pub id: u32,
@ -10,7 +10,7 @@ pub struct ClientboundAnimate {
// minecraft actually uses a u8 for this, but a varint still works and makes it
// so i don't have to add a special handler
#[derive(Clone, Debug, Copy, McBuf)]
#[derive(Clone, Debug, Copy, AzBuf)]
pub enum AnimationAction {
SwingMainHand = 0,
Hurt = 1,

View file

@ -1,15 +1,15 @@
use std::collections::HashMap;
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundAwardStats {
#[var]
pub stats: HashMap<Stat, i32>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, McBuf)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, AzBuf)]
pub enum Stat {
Mined(azalea_registry::Block),
Crafted(azalea_registry::Item),

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundBlockChangedAck {
#[var]
pub sequence: i32,

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::position::BlockPos;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundBlockDestruction {
/// The ID of the entity breaking the block.
#[var]

View file

@ -1,9 +1,9 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::position::BlockPos;
use azalea_protocol_macros::ClientboundGamePacket;
use simdnbt::owned::Nbt;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundBlockEntityData {
pub pos: BlockPos,
pub block_entity_type: azalea_registry::BlockEntityKind,

View file

@ -1,9 +1,9 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::position::BlockPos;
use azalea_protocol_macros::ClientboundGamePacket;
use azalea_registry::Block;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundBlockEvent {
pub pos: BlockPos,
pub action_id: u8,

View file

@ -1,9 +1,9 @@
use azalea_block::BlockState;
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::position::BlockPos;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundBlockUpdate {
pub pos: BlockPos,
pub block_state: BlockState,

View file

@ -1,15 +1,13 @@
use std::io::Cursor;
use std::io::Write;
use azalea_buf::{
BufReadError, McBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite,
};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError};
use azalea_chat::FormattedText;
use azalea_core::bitset::FixedBitSet;
use azalea_protocol_macros::ClientboundGamePacket;
use uuid::Uuid;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundBossEvent {
pub id: Uuid,
pub operation: Operation,
@ -75,7 +73,7 @@ impl AzaleaWrite for Operation {
}
}
#[derive(Clone, Debug, McBuf)]
#[derive(Clone, Debug, AzBuf)]
pub struct AddOperation {
pub name: FormattedText,
pub progress: f32,
@ -83,13 +81,13 @@ pub struct AddOperation {
pub properties: Properties,
}
#[derive(Clone, Debug, McBuf)]
#[derive(Clone, Debug, AzBuf)]
pub struct Style {
pub color: BossBarColor,
pub overlay: BossBarOverlay,
}
#[derive(McBuf, Clone, Copy, Debug)]
#[derive(AzBuf, Clone, Copy, Debug)]
pub enum BossBarColor {
Pink = 0,
Blue = 1,
@ -100,7 +98,7 @@ pub enum BossBarColor {
White = 6,
}
#[derive(McBuf, Clone, Copy, Debug)]
#[derive(AzBuf, Clone, Copy, Debug)]
pub enum BossBarOverlay {
Progress = 0,
Notched6 = 1,

View file

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

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::difficulty::Difficulty;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundChangeDifficulty {
pub difficulty: Difficulty,
pub locked: bool,

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_chat::FormattedText;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundChatPreview {
pub query_id: i32,
pub preview: Option<FormattedText>,

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundChunkBatchFinished {
#[var]
pub batch_size: u32,

View file

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

View file

@ -1,13 +1,13 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::position::ChunkPos;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundChunksBiomes {
pub chunk_biome_data: Vec<ChunkBiomeData>,
}
#[derive(Clone, Debug, McBuf)]
#[derive(Clone, Debug, AzBuf)]
pub struct ChunkBiomeData {
pub pos: ChunkPos,
pub buffer: Vec<u8>,

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundClearTitles {
pub reset_times: bool,
}

View file

@ -1,8 +1,8 @@
use azalea_brigadier::suggestion::Suggestions;
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundCommandSuggestions {
#[var]
pub id: u32,

View file

@ -1,13 +1,11 @@
use std::io::{Cursor, Write};
use azalea_buf::{
BufReadError, McBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite,
};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError};
use azalea_core::{bitset::FixedBitSet, resource_location::ResourceLocation};
use azalea_protocol_macros::ClientboundGamePacket;
use tracing::warn;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundCommands {
pub entries: Vec<BrigadierNodeStub>,
#[var]
@ -82,7 +80,7 @@ impl<T: AzaleaWrite> AzaleaWrite for BrigadierNumber<T> {
}
}
#[derive(Debug, Clone, Copy, McBuf, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, AzBuf, PartialEq, Eq)]
pub enum BrigadierString {
/// Reads a single word
SingleWord = 0,
@ -93,7 +91,7 @@ pub enum BrigadierString {
GreedyPhrase = 2,
}
#[derive(Debug, Clone, McBuf, PartialEq)]
#[derive(Debug, Clone, AzBuf, PartialEq)]
pub enum BrigadierParser {
Bool,
Float(BrigadierNumber<f32>),

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundContainerClose {
pub container_id: u8,
}

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_inventory::ItemStack;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundContainerSetContent {
pub container_id: i8,
#[var]

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundContainerSetData {
pub container_id: i8,
pub id: u16,

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_inventory::ItemStack;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundContainerSetSlot {
pub container_id: i8,
#[var]

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::resource_location::ResourceLocation;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundCookieRequest {
pub key: ResourceLocation,
}

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundCooldown {
pub item: azalea_registry::Item,
#[var]

View file

@ -1,13 +1,13 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundCustomChatCompletions {
pub action: Action,
pub entries: Vec<String>,
}
#[derive(McBuf, Clone, Copy, Debug)]
#[derive(AzBuf, Clone, Copy, Debug)]
pub enum Action {
Add = 0,
Remove = 1,

View file

@ -1,9 +1,9 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_buf::UnsizedByteArray;
use azalea_core::resource_location::ResourceLocation;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundCustomPayload {
pub identifier: ResourceLocation,
pub data: UnsizedByteArray,

View file

@ -1,9 +1,9 @@
use std::collections::HashMap;
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundCustomReportDetails {
// azalea doesn't implement max lengths yet

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::resource_location::ResourceLocation;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundCustomSound {
pub name: ResourceLocation,
pub source: SoundSource,
@ -13,7 +13,7 @@ pub struct ClientboundCustomSound {
pub pitch: f32,
}
#[derive(McBuf, Clone, Copy, Debug)]
#[derive(AzBuf, Clone, Copy, Debug)]
pub enum SoundSource {
Master = 0,
Music = 1,

View file

@ -1,10 +1,10 @@
use std::io::{Cursor, Write};
use azalea_buf::{McBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite};
use azalea_core::position::Vec3;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundDamageEvent {
#[var]
pub entity_id: u32,

View file

@ -1,9 +1,9 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
use super::s_debug_sample_subscription::RemoteDebugSampleType;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundDebugSample {
pub sample: Vec<u64>,
pub debug_sample_type: RemoteDebugSampleType,

View file

@ -1,9 +1,9 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
use super::c_player_chat::PackedMessageSignature;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundDeleteChat {
pub signature: PackedMessageSignature,
}

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_chat::FormattedText;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundDisconnect {
pub reason: FormattedText,
}

View file

@ -1,4 +1,4 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_chat::{
translatable_component::{StringOrComponent, TranslatableComponent},
FormattedText,
@ -11,7 +11,7 @@ use super::c_player_chat::ChatTypeBound;
// [`ClientboundPlayerChat`], except that it doesn't have any of the chat
// signing things. Vanilla servers use this when messages are sent from the
// console.
#[derive(Clone, Debug, McBuf, ClientboundGamePacket, PartialEq)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket, PartialEq)]
pub struct ClientboundDisguisedChat {
pub message: FormattedText,
pub chat_type: ChatTypeBound,

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundEntityEvent {
pub entity_id: u32,
pub event_id: u8,

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::position::Vec3;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundEntityPositionSync {
#[var]
pub id: u32,
@ -10,7 +10,7 @@ pub struct ClientboundEntityPositionSync {
pub on_ground: bool,
}
#[derive(McBuf, Clone, Debug)]
#[derive(AzBuf, Clone, Debug)]
pub struct PositionMoveRotation {
pub position: Vec3,
pub delta_movement: Vec3,

View file

@ -3,9 +3,7 @@ use std::{
str::FromStr,
};
use azalea_buf::{
BufReadError, McBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite,
};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError};
use azalea_core::{position::BlockPos, resource_location::ResourceLocation};
use azalea_protocol_macros::ClientboundGamePacket;
use azalea_registry::{ParticleKind, SoundEvent};
@ -26,7 +24,7 @@ pub struct ClientboundExplode {
pub explosion_sound: SoundEvent,
}
#[derive(Clone, Copy, Debug, PartialEq, McBuf)]
#[derive(Clone, Copy, Debug, PartialEq, AzBuf)]
pub enum BlockInteraction {
Keep,
Destroy,

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::position::ChunkPos;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundForgetLevelChunk {
pub pos: ChunkPos,
}

View file

@ -1,13 +1,13 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundGameEvent {
pub event: EventType,
pub param: f32,
}
#[derive(Clone, Debug, Copy, McBuf)]
#[derive(Clone, Debug, Copy, AzBuf)]
pub enum EventType {
NoRespawnBlockAvailable = 0,
StartRaining = 1,

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundHorseScreenOpen {
pub container_id: u8,
#[var]

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundHurtAnimation {
#[var]
pub id: u32,

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, ClientboundGamePacket, McBuf)]
#[derive(Clone, Debug, ClientboundGamePacket, AzBuf)]
pub struct ClientboundInitializeBorder {
pub new_center_x: f64,
pub new_center_z: f64,

View file

@ -1,7 +1,7 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundKeepAlive {
pub id: u64,
}

View file

@ -1,10 +1,10 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_protocol_macros::ClientboundGamePacket;
use simdnbt::owned::Nbt;
use super::c_light_update::ClientboundLightUpdatePacketData;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundLevelChunkWithLight {
pub x: i32,
pub z: i32,
@ -12,7 +12,7 @@ pub struct ClientboundLevelChunkWithLight {
pub light_data: ClientboundLightUpdatePacketData,
}
#[derive(Clone, Debug, McBuf)]
#[derive(Clone, Debug, AzBuf)]
pub struct ClientboundLevelChunkPacketData {
pub heightmaps: Nbt,
// we can't parse the data in azalea-protocol because it depends on context from other packets
@ -20,7 +20,7 @@ pub struct ClientboundLevelChunkPacketData {
pub block_entities: Vec<BlockEntity>,
}
#[derive(Clone, Debug, McBuf)]
#[derive(Clone, Debug, AzBuf)]
pub struct BlockEntity {
pub packed_xz: u8,
pub y: u16,

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::position::BlockPos;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundLevelEvent {
pub event_type: u32,
pub pos: BlockPos,

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_entity::particle::Particle;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundLevelParticles {
pub override_limiter: bool,
pub x: f64,

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::bitset::BitSet;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundLightUpdate {
#[var]
pub x: i32,
@ -11,7 +11,7 @@ pub struct ClientboundLightUpdate {
pub light_data: ClientboundLightUpdatePacketData,
}
#[derive(Clone, Debug, McBuf)]
#[derive(Clone, Debug, AzBuf)]
pub struct ClientboundLightUpdatePacketData {
pub sky_y_mask: BitSet,
pub block_y_mask: BitSet,

View file

@ -1,4 +1,4 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_core::resource_location::ResourceLocation;
use azalea_protocol_macros::ClientboundGamePacket;
@ -8,7 +8,7 @@ use crate::packets::common::CommonPlayerSpawnInfo;
///
/// This packet contains information about the state of the player, the
/// world, and the registry.
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundLogin {
pub player_id: u32,
pub hardcore: bool,

View file

@ -1,8 +1,8 @@
use azalea_buf::{AzaleaRead, AzaleaWrite, McBuf};
use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite};
use azalea_chat::FormattedText;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, ClientboundGamePacket, McBuf)]
#[derive(Clone, Debug, ClientboundGamePacket, AzBuf)]
pub struct ClientboundMapItemData {
#[var]
pub map_id: u32,
@ -12,7 +12,7 @@ pub struct ClientboundMapItemData {
pub color_patch: OptionalMapPatch,
}
#[derive(Clone, Debug, McBuf)]
#[derive(Clone, Debug, AzBuf)]
pub struct MapDecoration {
pub decoration_type: DecorationType,
pub x: i8,
@ -47,7 +47,7 @@ impl AzaleaWrite for OptionalMapPatch {
}
}
#[derive(Debug, Clone, McBuf)]
#[derive(Debug, Clone, AzBuf)]
pub struct MapPatch {
pub width: u8,
pub height: u8,
@ -56,7 +56,7 @@ pub struct MapPatch {
pub map_colors: Vec<u8>,
}
#[derive(Clone, Copy, Debug, McBuf)]
#[derive(Clone, Copy, Debug, AzBuf)]
pub enum DecorationType {
Player,
Frame,

View file

@ -1,8 +1,8 @@
use azalea_buf::McBuf;
use azalea_buf::AzBuf;
use azalea_inventory::ItemStack;
use azalea_protocol_macros::ClientboundGamePacket;
#[derive(Clone, Debug, McBuf, ClientboundGamePacket)]
#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
pub struct ClientboundMerchantOffers {
#[var]
pub container_id: u32,
@ -15,7 +15,7 @@ pub struct ClientboundMerchantOffers {
pub can_restock: bool,
}
#[derive(Clone, Debug, McBuf)]
#[derive(Clone, Debug, AzBuf)]
pub struct MerchantOffer {
pub base_cost_a: ItemStack,
pub result: ItemStack,

Some files were not shown because too many files have changed in this diff Show more