Skip to content

Commit 4f2bafe

Browse files
refactor: bevy (#882)
This is an experiment Related: valence-rs/valence#685 ## Why switch from flecs to Bevy - https://github.com/Indra-db/Flecs-Rust is not widely used; we could get more contributors who are familiar with Bevy. - https://github.com/Indra-db/Flecs-Rust has some current usability issues for Rust that need to be improved upon. ## Why stay in flecs - More performant - Has ability of us adding scripting language on top in non-Rust - Overall better design (at least for non-Rust). I expect flecs to always be ahead of Bevy in terms of its progress. Also less of a chance we get roadblocked by some Bevy design feature. --- Issues that need to be resolved: - in Bevy not everything is an entity. This makes some things annoying. For instance, I am unsure how `system-order` (which is core to hyperion) will work https://github.com/hyperion-mc/hyperion/blob/9b8c3d06124da811896a479e7d3c8dceb5f55349/crates/system-order/src/lib.rs#L1-L146 `system-order` is used for re-ordering packets once they reach the proxy. I definitely feel like flecs has fewer things that would hard roadblock us... however sadly flecs rust has some quality of life issues that can be annoying --------- Co-authored-by: TestingPlant <44930139+TestingPlant@users.noreply.github.com>
1 parent ddb1090 commit 4f2bafe

File tree

149 files changed

+9612
-9040
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+9612
-9040
lines changed

Cargo.lock

Lines changed: 1356 additions & 243 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ members = [
2121
'crates/hyperion-clap',
2222
'crates/hyperion-command',
2323
'crates/hyperion-crafting',
24-
'crates/hyperion-event-macros',
2524
'crates/hyperion-genmap',
2625
'crates/hyperion-gui',
2726
'crates/hyperion-inventory',
@@ -40,8 +39,8 @@ members = [
4039
'crates/hyperion-stats',
4140
'crates/hyperion-text',
4241
'crates/hyperion-utils',
42+
'crates/packet-channel',
4343
'crates/simd-utils',
44-
'crates/system-order',
4544
'events/tag',
4645
'tools/packet-inspector',
4746
'tools/rust-mc-bot',
@@ -51,10 +50,12 @@ resolver = '2'
5150
[workspace.dependencies]
5251
anyhow = '1.0.98'
5352
approx = '0.5.1'
53+
arc-swap = '1.7.1'
5454
arrayvec = '0.7.4'
5555
base64 = '0.22.1'
5656
bitfield-struct = "0.10.1"
5757
bitvec = '1.0.1'
58+
boxcar = '0.2.13'
5859
bumpalo = '3.16'
5960
byteorder = '1.5.0'
6061
bytes = '1.8.0'
@@ -72,7 +73,7 @@ enumset = '1.1.6'
7273
fastrand = '2.1.0'
7374
flume = '0.11.1'
7475
futures-util = '0.3.31'
75-
glam = "0.30.3"
76+
glam = "0.29.3"
7677
heapless = '0.8.0'
7778
heed = "0.21.0"
7879
hex = '0.4.3'
@@ -90,9 +91,9 @@ num-traits = '0.2.19'
9091
num_cpus = "1.16.0"
9192
once_cell = '1.21.3'
9293
ordered-float = "5.0.0"
93-
ouroboros = '0.18.5'
9494
papaya = "0.2.1"
9595
parking_lot = '0.12.3'
96+
paste = "1.0.15"
9697
plotters-bitmap = '0.3.6'
9798
proc-macro2 = '1.0.95'
9899
proptest = '1.5.0'
@@ -102,12 +103,14 @@ rayon = '1.10.0'
102103
rkyv = '0.8.8'
103104
serde = '1.0.217'
104105
serde_json = '1.0.140'
106+
serial_test = '3.2.0'
105107
slotmap = '1.0.7'
106108
snafu = '0.8.5'
107109
syn = '2.0.101'
108110
tango-bench = "0.6.0"
109111
tar = '0.4.41'
110112
thiserror = '2.0.12'
113+
thread_local = '1.1.8'
111114
tikv-jemallocator = '0.6.0'
112115
time = '0.3.41'
113116
tokio = '1.45.0'
@@ -119,11 +122,16 @@ uuid = '1.16.0'
119122
path = "crates/hyperion-proxy-module"
120123

121124
[workspace.dependencies.bvh]
122-
git = 'https://github.com/andrewgazelka/bvh-data'
125+
git = 'https://github.com/TestingPlant/bvh-data'
123126

124127
[workspace.dependencies.bvh-region]
125128
path = 'crates/bvh-region'
126129

130+
[workspace.dependencies.bevy]
131+
default-features = false
132+
features = ['multi_threaded']
133+
version = "0.16.1"
134+
127135
[workspace.dependencies.bytemuck]
128136
features = ['derive']
129137
version = '1.23.0'
@@ -133,7 +141,7 @@ features = ['derive']
133141
version = '4.5.38'
134142

135143
[workspace.dependencies.derive_more]
136-
features = ['display', 'from', 'deref', 'deref_mut', 'debug', 'constructor']
144+
features = ['display', 'from', 'into', 'deref', 'deref_mut', 'debug', 'constructor', 'add']
137145
version = "2.0.1"
138146

139147
[workspace.dependencies.divan]
@@ -143,10 +151,6 @@ git = 'https://github.com/nvzqz/divan'
143151
default-features = false
144152
version = '1.1.1'
145153

146-
[workspace.dependencies.flecs_ecs]
147-
features = ['flecs_manual_registration']
148-
git = 'https://github.com/Indra-db/Flecs-Rust'
149-
150154
[workspace.dependencies.geometry]
151155
path = 'crates/geometry'
152156

@@ -165,9 +169,6 @@ path = 'crates/hyperion-command'
165169
[workspace.dependencies.hyperion-crafting]
166170
path = 'crates/hyperion-crafting'
167171

168-
[workspace.dependencies.hyperion-event-macros]
169-
path = 'crates/hyperion-event-macros'
170-
171172
[workspace.dependencies.hyperion-genmap]
172173
path = 'crates/hyperion-genmap'
173174

@@ -207,6 +208,9 @@ path = 'crates/hyperion-text'
207208
[workspace.dependencies.hyperion-utils]
208209
path = 'crates/hyperion-utils'
209210

211+
[workspace.dependencies.packet-channel]
212+
path = 'crates/packet-channel'
213+
210214
[workspace.dependencies.indexmap]
211215
features = ['rayon']
212216
version = '2.9.0'
@@ -244,9 +248,6 @@ path = 'crates/simd-utils'
244248
default-features = false
245249
version = '5.2.0'
246250

247-
[workspace.dependencies.system-order]
248-
path = 'crates/system-order'
249-
250251
[workspace.dependencies.tokio-util]
251252
features = ['full']
252253
version = '0.7.15'
@@ -264,43 +265,47 @@ features = ['timer-fallback']
264265
version = '0.11.4'
265266

266267
[workspace.dependencies.valence_anvil]
267-
branch = 'feat-open'
268+
branch = 'feat-bytes'
268269
features = ['parsing']
269-
git = 'https://github.com/andrewgazelka/valence'
270+
git = 'https://github.com/TestingPlant/valence'
270271

271272
[workspace.dependencies.valence_build_utils]
272-
branch = 'feat-open'
273-
git = 'https://github.com/andrewgazelka/valence'
273+
branch = 'feat-bytes'
274+
git = 'https://github.com/TestingPlant/valence'
275+
276+
[workspace.dependencies.valence_bytes]
277+
branch = 'feat-bytes'
278+
git = 'https://github.com/TestingPlant/valence'
274279

275280
[workspace.dependencies.valence_generated]
276-
branch = 'feat-open'
277-
git = 'https://github.com/andrewgazelka/valence'
281+
branch = 'feat-bytes'
282+
git = 'https://github.com/TestingPlant/valence'
278283

279284
[workspace.dependencies.valence_ident]
280-
branch = 'feat-open'
281-
git = 'https://github.com/andrewgazelka/valence'
285+
branch = 'feat-bytes'
286+
git = 'https://github.com/TestingPlant/valence'
282287

283288
[workspace.dependencies.valence_nbt]
284-
branch = 'feat-open'
289+
branch = 'feat-bytes'
285290
features = ['serde']
286-
git = 'https://github.com/andrewgazelka/valence'
291+
git = 'https://github.com/TestingPlant/valence'
287292

288293
[workspace.dependencies.valence_protocol]
289-
branch = 'feat-open'
294+
branch = 'feat-bytes'
290295
features = ['compression']
291-
git = 'https://github.com/andrewgazelka/valence'
296+
git = 'https://github.com/TestingPlant/valence'
292297

293298
[workspace.dependencies.valence_registry]
294-
branch = 'feat-open'
295-
git = 'https://github.com/andrewgazelka/valence'
299+
branch = 'feat-bytes'
300+
git = 'https://github.com/TestingPlant/valence'
296301

297302
[workspace.dependencies.valence_server]
298-
branch = 'feat-open'
299-
git = 'https://github.com/andrewgazelka/valence'
303+
branch = 'feat-bytes'
304+
git = 'https://github.com/TestingPlant/valence'
300305

301306
[workspace.dependencies.valence_text]
302-
branch = 'feat-open'
303-
git = 'https://github.com/andrewgazelka/valence'
307+
branch = 'feat-bytes'
308+
git = 'https://github.com/TestingPlant/valence'
304309

305310
[workspace.dependencies.tag]
306311
path = "events/tag"
@@ -319,6 +324,9 @@ print_stdout = 'deny'
319324
single_match_else = 'allow'
320325
too_long_first_doc_paragraph = 'allow'
321326
too_many_lines = 'allow'
327+
needless_pass_by_value = 'allow'
328+
type_complexity = 'allow'
329+
too_many_arguments = 'allow'
322330

323331
upper_case_acronyms = 'deny'
324332

crates/hyperion-clap/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ readme = "README.md"
77
publish = false
88

99
[dependencies]
10-
clap ={ workspace = true }
11-
flecs_ecs = { workspace = true }
10+
clap = { workspace = true }
11+
bevy = { workspace = true }
1212
hyperion = { workspace = true }
1313
hyperion-clap-macros = { workspace = true }
1414
hyperion-command = { workspace = true }
1515
hyperion-permission = { workspace = true }
16+
hyperion-utils = { workspace = true }
1617
tracing = { workspace = true }
1718
valence_protocol = { workspace = true }
19+
valence_bytes = { workspace = true }
1820

1921
[lints]
2022
workspace = true

0 commit comments

Comments
 (0)