Skip to content

Commit

Permalink
23w42a
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Oct 21, 2023
1 parent 6a30a43 commit f9aca5c
Show file tree
Hide file tree
Showing 13 changed files with 213 additions and 93 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A collection of Rust crates for making Minecraft bots, clients, and tools.
</p>

<!-- The line below is automatically read and updated by the migrate script, so don't change it manually. -->
*Currently supported Minecraft version: `23w41a`.*
*Currently supported Minecraft version: `23w42a`.*

> **Warning**
> Azalea is still very unfinished, though most crates are in a somewhat useable state
Expand Down
6 changes: 6 additions & 0 deletions azalea-block/src/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1902,6 +1902,7 @@ make_block_states! {
Z,
},
"cracked" => bool,
"crafting" => bool,
},
Blocks => {
air => BlockBehavior::new(), {},
Expand Down Expand Up @@ -5099,5 +5100,10 @@ make_block_states! {
facing: FacingCardinal::North,
waterlogged: false,
},
crafter => BlockBehavior::new().strength(1.5, 3.5), {
crafting: false,
orientation: Orientation::NorthUp,
triggered: false,
},
}
}
15 changes: 11 additions & 4 deletions azalea-entity/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ pub struct BlockDisplayHeight(pub f32);
#[derive(Component, Deref, DerefMut, Clone)]
pub struct BlockDisplayGlowColorOverride(pub i32);
#[derive(Component, Deref, DerefMut, Clone)]
pub struct BlockState(pub azalea_block::BlockState);
pub struct BlockDisplayBlockState(pub azalea_block::BlockState);
#[derive(Component)]
pub struct BlockDisplay;
impl BlockDisplay {
Expand Down Expand Up @@ -855,7 +855,7 @@ impl BlockDisplay {
entity.insert(BlockDisplayGlowColorOverride(d.value.into_int()?));
}
23 => {
entity.insert(BlockState(d.value.into_block_state()?));
entity.insert(BlockDisplayBlockState(d.value.into_block_state()?));
}
_ => {}
}
Expand Down Expand Up @@ -884,7 +884,7 @@ pub struct BlockDisplayMetadataBundle {
block_display_width: BlockDisplayWidth,
block_display_height: BlockDisplayHeight,
block_display_glow_color_override: BlockDisplayGlowColorOverride,
block_state: BlockState,
block_display_block_state: BlockDisplayBlockState,
}
impl Default for BlockDisplayMetadataBundle {
fn default() -> Self {
Expand Down Expand Up @@ -946,7 +946,7 @@ impl Default for BlockDisplayMetadataBundle {
block_display_width: BlockDisplayWidth(0.0),
block_display_height: BlockDisplayHeight(0.0),
block_display_glow_color_override: BlockDisplayGlowColorOverride(-1),
block_state: BlockState(Default::default()),
block_display_block_state: BlockDisplayBlockState(Default::default()),
}
}
}
Expand Down Expand Up @@ -8074,6 +8074,8 @@ impl Default for TextDisplayMetadataBundle {

#[derive(Component, Deref, DerefMut, Clone)]
pub struct Fuse(pub i32);
#[derive(Component, Deref, DerefMut, Clone)]
pub struct TntBlockState(pub azalea_block::BlockState);
#[derive(Component)]
pub struct Tnt;
impl Tnt {
Expand All @@ -8086,6 +8088,9 @@ impl Tnt {
8 => {
entity.insert(Fuse(d.value.into_int()?));
}
9 => {
entity.insert(TntBlockState(d.value.into_block_state()?));
}
_ => {}
}
Ok(())
Expand All @@ -8097,6 +8102,7 @@ pub struct TntMetadataBundle {
_marker: Tnt,
parent: AbstractEntityMetadataBundle,
fuse: Fuse,
tnt_block_state: TntBlockState,
}
impl Default for TntMetadataBundle {
fn default() -> Self {
Expand All @@ -8120,6 +8126,7 @@ impl Default for TntMetadataBundle {
ticks_frozen: TicksFrozen(0),
},
fuse: Fuse(80),
tnt_block_state: TntBlockState(Default::default()),
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions azalea-inventory/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ declare_menus! {
Generic3x3 {
contents: 9,
},
Crafter3x3 {
contents: 9,
},
Anvil {
first: 1,
second: 1,
Expand Down
25 changes: 18 additions & 7 deletions azalea-inventory/src/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ use azalea_buf::McBuf;

use crate::{
item::MaxStackSizeExt, AnvilMenuLocation, BeaconMenuLocation, BlastFurnaceMenuLocation,
BrewingStandMenuLocation, CartographyTableMenuLocation, CraftingMenuLocation,
EnchantmentMenuLocation, FurnaceMenuLocation, Generic3x3MenuLocation, Generic9x1MenuLocation,
Generic9x2MenuLocation, Generic9x3MenuLocation, Generic9x4MenuLocation, Generic9x5MenuLocation,
Generic9x6MenuLocation, GrindstoneMenuLocation, HopperMenuLocation, ItemSlot, ItemSlotData,
LecternMenuLocation, LoomMenuLocation, Menu, MenuLocation, MerchantMenuLocation, Player,
PlayerMenuLocation, ShulkerBoxMenuLocation, SmithingMenuLocation, SmokerMenuLocation,
StonecutterMenuLocation,
BrewingStandMenuLocation, CartographyTableMenuLocation, Crafter3x3MenuLocation,
CraftingMenuLocation, EnchantmentMenuLocation, FurnaceMenuLocation, Generic3x3MenuLocation,
Generic9x1MenuLocation, Generic9x2MenuLocation, Generic9x3MenuLocation, Generic9x4MenuLocation,
Generic9x5MenuLocation, Generic9x6MenuLocation, GrindstoneMenuLocation, HopperMenuLocation,
ItemSlot, ItemSlotData, LecternMenuLocation, LoomMenuLocation, Menu, MenuLocation,
MerchantMenuLocation, Player, PlayerMenuLocation, ShulkerBoxMenuLocation, SmithingMenuLocation,
SmokerMenuLocation, StonecutterMenuLocation,
};

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -383,6 +383,17 @@ impl Menu {
);
}
},
MenuLocation::Crafter3x3(l) => match l {
Crafter3x3MenuLocation::Contents => {
self.try_move_item_to_slots(slot_index, self.player_slots_range());
}
Crafter3x3MenuLocation::Player => {
self.try_move_item_to_slots_or_toggle_hotbar(
slot_index,
Menu::GENERIC3X3_CONTENTS_SLOTS,
);
}
},
MenuLocation::Anvil(l) => match l {
AnvilMenuLocation::Player => {
self.try_move_item_to_slots_or_toggle_hotbar(
Expand Down
Loading

0 comments on commit f9aca5c

Please sign in to comment.