Skip to content

Commit 4efcec7

Browse files
committed
Patch for bitcode, bump deps
1 parent 58c6cf9 commit 4efcec7

File tree

4 files changed

+58
-31
lines changed

4 files changed

+58
-31
lines changed

Cargo.toml

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -115,101 +115,104 @@ ferrumc-world-gen = { path = "src/lib/world_gen" }
115115
ferrumc-inventories = { path = "src/lib/inventories" }
116116

117117
# Asynchronous
118-
tokio = { version = "1.47.1", features = ["macros", "net", "rt", "sync", "time", "io-util", "test-util"], default-features = false }
118+
tokio = { version = "1.48.0", features = ["macros", "net", "rt", "sync", "time", "io-util", "test-util"], default-features = false }
119119

120120
# Logging
121121
tracing = "0.1.41"
122-
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
122+
tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }
123123
tracing-appender = "0.2.3"
124-
log = "0.4.27"
125-
console-subscriber = "0.4.1"
124+
log = "0.4.28"
126125

127126
# Concurrency/Parallelism
128-
parking_lot = "0.12.4"
127+
parking_lot = "0.12.5"
129128
rayon = "1.11.0"
130129
crossbeam-channel = "0.5.15"
131130
rusty_pool = "0.7.0"
132131
crossbeam-queue = "0.3.12"
133132

134133
# Network
135-
reqwest = { version = "0.12.22", features = ["json"] }
136-
ureq = "3.1.0"
134+
ureq = "3.1.2"
137135

138136
# Error handling
139-
thiserror = "2.0.15"
137+
thiserror = "2.0.17"
140138

141139
# Cryptography
142-
rand = "0.9.2"
140+
rand = "0.10.0-rc.0"
143141
fnv = "1.0.7"
144142
wyhash = "0.6.0"
145143
ahash = "0.8.12"
146144

147145
# Encoding/Serialization
148-
serde = { version = "1.0.219", features = ["derive"] }
149-
serde_json = "1.0.142"
150-
serde_derive = "1.0.219"
151-
serde_yaml_ng = "0.9.36"
146+
serde = { version = "1.0.228", features = ["derive"] }
147+
serde_json = "1.0.145"
148+
serde_derive = "1.0.228"
149+
serde_yaml_ng = "0.10.0"
152150
base64 = "0.22.1"
153-
bitcode = "0.6.7"
154-
bitcode_derive = "0.6.7"
155-
toml = "0.9.5"
151+
152+
# When if bitcode's latest version has been changed, see if clippy still complains about
153+
# src/lib/net/src/packets/outgoing/chunk_and_light_data.rs
154+
#bitcode = "0.6.7"
155+
#bitcode_derive = "0.6.7"
156+
toml = "0.9.8"
156157
craftflow-nbt = "2.1.0"
157158
figment = { version = "0.10.19", features = ["toml", "env"] }
158-
simd-json = "0.15.1"
159+
simd-json = "0.17.0"
159160

160161
# Bit manipulation
161162
byteorder = "1.5.0"
162163

163164
# Data types
164165
dashmap = "7.0.0-rc2"
165-
uuid = { version = "1.18.0", features = ["v4", "v3", "serde"] }
166-
indexmap = { version = "2.10.0", features = ["serde"] }
166+
uuid = { version = "1.18.1", features = ["v4", "v3", "serde"] }
167+
indexmap = { version = "2.12.0", features = ["serde"] }
167168

168169
# Macros
169170
lazy_static = "1.5.0"
170-
quote = "1.0.40"
171+
quote = "1.0.41"
171172
syn = "2.0.106"
172173
proc-macro2 = "1.0.101"
173-
proc-macro-crate = "3.3.0"
174+
proc-macro-crate = "3.4.0"
174175
paste = "1.0.15"
175176
maplit = "1.0.2"
176177
macro_rules_attribute = "0.2.2"
177178

178179
# Magic
179180
dhat = "0.3.3"
180-
ctor = "0.4.2"
181+
ctor = "0.6.0"
181182

182183
# Compression/Decompression
183-
flate2 = { version = "1.1.2", features = ["zlib"], default-features = false }
184+
flate2 = { version = "1.1.4", features = ["zlib"], default-features = false }
184185
lzzzz = "2.0.0"
185186
yazi = "0.2.1"
186-
bzip2 = "0.6.0"
187-
lz4_flex = "0.11.5"
188187

189188
# Database
190189
heed = "0.22.0"
191-
moka = "0.12.10"
190+
moka = "0.12.11"
192191

193192
# CLI
194-
clap = "4.5.45"
193+
clap = "4.5.49"
195194
indicatif = "0.18.0"
196195
colored = "3.0.0"
197196

198197
# Misc
199198
deepsize = "0.2.0"
200199
page_size = "0.6.0"
201200
enum-ordinalize = "4.3.0"
202-
regex = "1.11.1"
201+
regex = "1.12.2"
203202
noise = "0.9.0"
204-
ctrlc = "3.4.7"
203+
ctrlc = "3.5.0"
205204
num_cpus = "1.17.0"
206205
typename = "0.1.2"
207206
bevy_ecs = { version = "0.16.1", features = ["multi_threaded", "trace"] }
208207
once_cell = "1.21.3"
209208

210209
# I/O
211-
memmap2 = "0.9.7"
212-
tempfile = "3.20.0"
210+
memmap2 = "0.9.8"
211+
tempfile = "3.23.0"
213212

214213
# Benchmarking
215214
criterion = { version = "0.7.0", features = ["html_reports"] }
215+
216+
217+
bitcode = { git = "https://github.com/SoftbearStudios/bitcode" }
218+
bitcode_derive = { git = "https://github.com/SoftbearStudios/bitcode" }

src/lib/derive_macros/src/lib.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,22 @@ pub fn build_registry_packets(input: TokenStream) -> TokenStream {
9898
registries_packets::build_mapping(input)
9999
}
100100

101+
/// A macro to lookup block IDs at compile time.
102+
///
103+
/// Feed in the block name as a string literal, and an optional set of properties as a map.
104+
/// It will output a `BlockId` struct with the correct ID for that block and properties.
105+
/// Usage:
106+
/// ```ignore
107+
/// let block_id = block!("stone");
108+
/// let another_block_id = block!("minecraft:grass_block", {snowy: true});
109+
/// ```
110+
/// Unfortunately, due to current limitations in Rust's proc macros, you will need to import the
111+
/// `BlockId` struct manually.
112+
///
113+
/// The `minecraft:` namespace is optional and will be added automatically if not present.
114+
///
115+
/// If the block or properties are invalid, a compile-time error will be thrown that should hopefully
116+
/// explain the issue.
101117
#[proc_macro]
102118
pub fn block(input: TokenStream) -> TokenStream {
103119
block::block(input)

src/lib/world/src/block_id.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ lazy_static! {
4444

4545
/// An ID for a block, and it's state in the world. Use this over `BlockData` unless you need to
4646
/// modify or read the block's name/properties directly.
47+
///
48+
/// This should be used over `BlockData` in most cases, as it's much more efficient to store and pass around.
49+
/// You can also generate a block's id at runtime with the [ferrumc_macros::block!] macro.
4750
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Encode, Decode, DeepSizeOf)]
4851
pub struct BlockId(pub u32);
4952

src/lib/world/src/vanilla_chunk_format.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ pub(crate) struct BlockStates {
9898
pub palette: Option<Vec<BlockData>>,
9999
}
100100

101+
/// Information about a block's name and properties.
102+
///
103+
/// This should be used sparingly, as it's much more efficient to use [BlockId] where possible.
104+
///
105+
/// If you want to use it as a literal and the convert to a BlockId, use the [ferrumc_macros::block_data!] macro.
101106
#[apply(ChunkDerives)]
102107
#[derive(deepsize::DeepSizeOf, Hash)]
103108
pub struct BlockData {

0 commit comments

Comments
 (0)