Skip to content

Commit 0a040a2

Browse files
authored
feat: 1.21.4 (#2)
2 parents 489b320 + 6dd6572 commit 0a040a2

File tree

24 files changed

+69557
-55194
lines changed

24 files changed

+69557
-55194
lines changed

assets/blocks.json

Lines changed: 62711 additions & 50314 deletions
Large diffs are not rendered by default.

assets/more_registries.json

Lines changed: 4929 additions & 4376 deletions
Large diffs are not rendered by default.

assets/registries.json

Lines changed: 1149 additions & 469 deletions
Large diffs are not rendered by default.

assets/tags.json

Lines changed: 607 additions & 0 deletions
Large diffs are not rendered by default.

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ mod server;
3737
mod state;
3838
mod world;
3939

40-
const VERSION: &str = "1.21.1";
41-
const VERSION_NUM: i32 = 767;
40+
const VERSION: &str = "1.21.4";
41+
const VERSION_NUM: i32 = 769;
4242
const TICK_RATE: u8 = 20;
4343

4444
type CrawlState = Arc<state::State>;

src/net/cache.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ use crate::{
2525
protocol::{
2626
datatypes::VarInt,
2727
packets::{
28-
login::registry::{AllRegistries, Registry},
28+
login::registry::{AllRegistries, Registry, AllTags},
2929
play::ChunkDataUpdateLightC,
3030
},
3131
Encoder,
3232
},
3333
world::{blocks::Blocks, BlockEntity, Container, World},
3434
CrawlState,
3535
};
36+
use crate::protocol::packets::login::registry::RegistryItem;
3637

3738
#[derive(Debug)]
3839
pub struct WorldCache {
@@ -123,6 +124,25 @@ impl WorldCache {
123124
}
124125
}
125126

127+
#[derive(Debug)]
128+
pub struct TagCache {
129+
pub encoded: Vec<u8>,
130+
}
131+
132+
impl From<&AllTags> for TagCache {
133+
fn from(tags: &AllTags) -> Self {
134+
let mut encoder = Encoder::new();
135+
136+
encoder
137+
.append_packet(tags)
138+
.expect("Failed to encode tags");
139+
140+
Self {
141+
encoded: encoder.take().to_vec()
142+
}
143+
}
144+
}
145+
126146
#[derive(Debug)]
127147
pub struct RegistryCache {
128148
pub encoded: Vec<u8>,

src/net/player.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ impl SharedPlayer {
245245
uuid,
246246
username: Bounded(&username),
247247
properties: Vec::new(),
248-
strict_error_handling: false,
249248
};
250249

251250
{
@@ -263,6 +262,7 @@ impl SharedPlayer {
263262
self.0.io.rx::<KnownPacksS>().await?;
264263

265264
self.0.io.tx_raw(&state.registry_cache.encoded).await?;
265+
self.0.io.tx_raw(&state.tag_cache.encoded).await?;
266266

267267
self.0.io.tx(&FinishConfigurationC).await?;
268268
self.0.io.rx::<FinishConfigurationAckS>().await?;
@@ -313,6 +313,7 @@ impl SharedPlayer {
313313
is_superflat: false,
314314
death_location: None,
315315
portal_cooldown: VarInt(0),
316+
sea_level: VarInt(64),
316317
enforces_secure_chat: false,
317318
};
318319

@@ -435,7 +436,7 @@ impl SharedPlayer {
435436
};
436437
}
437438

438-
let tp = SynchronisePositionC::new(x, y, z, yaw, pitch);
439+
let tp = SynchronisePositionC::new(x, y, z, 0.0, 0.0, 0.0, yaw, pitch);
439440
{
440441
let mut tp_state = self.0.tp_state.write().await;
441442
// player will be given 5 (FIVE) SECONDS TO ACK!!!!!

src/protocol/packets/login/login.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ pub struct LoginSuccessC<'a> {
4949
pub uuid: Uuid,
5050
pub username: Bounded<&'a str, 16>,
5151
pub properties: Vec<Property<'a>>,
52-
pub strict_error_handling: bool,
5352
}
5453

5554
impl Packet for LoginSuccessC<'_> {
@@ -64,7 +63,6 @@ impl<'a> Encode for LoginSuccessC<'a> {
6463
self.username.encode(&mut w)?;
6564
properties_len.encode(&mut w)?;
6665
self.properties.encode(&mut w)?;
67-
self.strict_error_handling.encode(&mut w)?;
6866

6967
Ok(())
7068
}

src/protocol/packets/login/registry/biome.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ struct Effects {
4444
ambient_sound: Option<StringOrCompound<AmbientSound>>,
4545
mood_sound: Option<MoodSound>,
4646
additions_sound: Option<AdditionsSound>,
47-
music: Option<Music>,
47+
music: Option<Vec<Music>>,
48+
music_volume: Option<f32>
4849
}
4950

5051
#[derive(Clone, Debug, Serialize, Deserialize)]
@@ -81,6 +82,12 @@ struct AdditionsSound {
8182

8283
#[derive(Clone, Debug, Serialize, Deserialize)]
8384
struct Music {
85+
data: MusicData,
86+
weight: f32,
87+
}
88+
89+
#[derive(Clone, Debug, Serialize, Deserialize)]
90+
struct MusicData {
8491
sound: String,
8592
min_delay: i32,
8693
max_delay: i32,

src/protocol/packets/login/registry/dimension.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,33 @@
1919

2020
use serde::{Deserialize, Serialize};
2121

22-
use super::RegistryItem;
22+
use super::{RegistryItem, deserialize_bool};
2323

2424
#[derive(Clone, Debug, Serialize, Deserialize)]
2525
pub struct DimensionType {
2626
fixed_time: Option<i64>,
27+
#[serde(deserialize_with = "deserialize_bool")]
2728
has_skylight: i8,
29+
#[serde(deserialize_with = "deserialize_bool")]
2830
has_ceiling: i8,
31+
#[serde(deserialize_with = "deserialize_bool")]
2932
ultrawarm: i8,
33+
#[serde(deserialize_with = "deserialize_bool")]
3034
natural: i8,
3135
coordinate_scale: f64,
36+
#[serde(deserialize_with = "deserialize_bool")]
3237
bed_works: i8,
38+
#[serde(deserialize_with = "deserialize_bool")]
3339
respawn_anchor_works: i8,
3440
min_y: i32,
3541
height: i32,
3642
logical_height: i32,
3743
infiniburn: String,
3844
effects: String,
3945
ambient_light: f32,
46+
#[serde(deserialize_with = "deserialize_bool")]
4047
piglin_safe: i8,
48+
#[serde(deserialize_with = "deserialize_bool")]
4149
has_raids: i8,
4250
monster_spawn_light_level: IntOrLightLevel,
4351
monster_spawn_block_light_limit: i32,

0 commit comments

Comments
 (0)