-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from OmniacDev/proto_rework
impl types for v662
- Loading branch information
Showing
100 changed files
with
1,500 additions
and
476 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
crates/proto/src/version/v662/enums/chat_restriction_level.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
crates/proto/src/version/v662/enums/command_permission_level.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 59 additions & 11 deletions
70
crates/proto/src/version/v662/enums/crafting_data_entry_type.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,64 @@ | ||
use uuid::Uuid; | ||
use bedrockrs_macros::ProtoCodec; | ||
use crate::version::v662::types::{NetworkItemInstanceDescriptor, ShapedChemistryRecipe, ShapedRecipe, ShapelessRecipe, ShulkerBoxRecipe, SmithingTransformRecipe, SmithingTrimRecipe}; | ||
|
||
#[derive(ProtoCodec)] | ||
#[enum_repr(i32)] | ||
#[enum_endianness(var)] | ||
#[repr(i32)] | ||
pub enum CraftingDataEntryType { | ||
ShapelessRecipe = 0, | ||
ShapedRecipe = 1, | ||
FurnaceRecipe = 2, | ||
FurnaceAuxRecipe = 3, | ||
MultiRecipe = 4, | ||
ShulkerBoxRecipe = 5, | ||
ShapelessChemistryRecipe = 6, | ||
ShapedChemistryRecipe = 7, | ||
SmithingTransformRecipe = 8, | ||
SmithingTrimRecipe = 9, | ||
Count = 10, | ||
ShapelessRecipe { | ||
shapeless_recipe: ShapelessRecipe, | ||
#[endianness(var)] | ||
net_id: i32, | ||
} = 0, | ||
ShapedRecipe { | ||
shaped_recipe: ShapedRecipe, | ||
#[endianness(var)] | ||
net_id: i32, | ||
} = 1, | ||
FurnaceRecipe { | ||
#[endianness(var)] | ||
item_data: i32, | ||
result_item: NetworkItemInstanceDescriptor, | ||
recipe_tag: String, | ||
} = 2, | ||
FurnaceAuxRecipe { | ||
#[endianness(var)] | ||
item_data: i32, | ||
#[endianness(var)] | ||
auxiliary_item_data: i32, | ||
result_item: NetworkItemInstanceDescriptor, | ||
recipe_tag: String, | ||
} = 3, | ||
MultiRecipe { | ||
multi_recipe: Uuid, | ||
#[endianness(var)] | ||
net_id: i32, | ||
} = 4, | ||
ShulkerBoxRecipe { | ||
shulker_box_recipe: ShulkerBoxRecipe, | ||
#[endianness(var)] | ||
net_id: i32, | ||
} = 5, | ||
ShapelessChemistryRecipe { | ||
shapeless_chemistry_recipe: ShapelessRecipe, | ||
#[endianness(var)] | ||
net_id: i32, | ||
} = 6, | ||
ShapedChemistryRecipe { | ||
shaped_chemistry_recipe: ShapedChemistryRecipe, | ||
#[endianness(var)] | ||
net_id: i32, | ||
} = 7, | ||
SmithingTransformRecipe { | ||
smithing_transform_recipe: SmithingTransformRecipe, | ||
#[endianness(var)] | ||
net_id: i32 | ||
} = 8, | ||
SmithingTrimRecipe { | ||
smithing_trim_recipe: SmithingTrimRecipe, | ||
#[endianness(var)] | ||
net_id: i32 | ||
} = 9, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
use bedrockrs_macros::ProtoCodec; | ||
use crate::version::v662::types::{BlockPos, CompoundTag, Vec3}; | ||
|
||
#[derive(ProtoCodec)] | ||
#[enum_repr(i8)] | ||
#[repr(i8)] | ||
pub enum DataItemType { | ||
Byte = 0, | ||
Short = 1, | ||
Int = 2, | ||
Float = 3, | ||
String = 4, | ||
CompoundTag = 5, | ||
Pos = 6, | ||
Int64 = 7, | ||
Vec3 = 8, | ||
Unknown = 9, | ||
Byte(i8) = 0, | ||
#[endianness(le)] | ||
Short(i16) = 1, | ||
#[endianness(var)] | ||
Int(i32) = 2, | ||
#[endianness(le)] | ||
Float(f32) = 3, | ||
String(String) = 4, | ||
CompoundTag(CompoundTag) = 5, | ||
Pos(BlockPos) = 6, | ||
#[endianness(var)] | ||
Int64(i64) = 7, | ||
Vec3(Vec3) = 8, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
crates/proto/src/version/v662/enums/education_edition_offer.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
crates/proto/src/version/v662/enums/inventory_source_type.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
use bedrockrs_macros::ProtoCodec; | ||
use crate::version::v662::enums::ContainerID; | ||
|
||
#[derive(ProtoCodec)] | ||
#[enum_repr(u32)] | ||
#[enum_endianness(var)] | ||
#[repr(u32)] | ||
pub enum InventorySourceType { | ||
InvalidInventory = i32::MAX as isize, | ||
ContainerInventory = 0, | ||
InvalidInventory = u32::MAX, | ||
ContainerInventory(ContainerID) = 0, | ||
GlobalInventory = 1, | ||
WorldInteraction = 2, | ||
#[endianness(var)] | ||
WorldInteraction(u32) = 2, | ||
CreativeInventory = 3, | ||
NonImplementedFeatureTODO = 99999, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
crates/proto/src/version/v662/enums/player_permission_level.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
crates/proto/src/version/v662/enums/server_auth_movement_mode.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.