Skip to content

Commit 844ded2

Browse files
fix: #738 (#739)
1 parent a403c1c commit 844ded2

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

crates/hyperion/src/lib.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ impl HyperionCore {
207207

208208
world.component::<Prev>();
209209

210+
// Minecraft tick rate is 20 ticks per second
211+
world.set_target_fps(20.0);
212+
210213
// todo: sadly this requires u32
211214
// .bit("on_fire", *EntityFlags::ON_FIRE)
212215
// .bit("crouching", *EntityFlags::CROUCHING)
@@ -342,14 +345,6 @@ impl HyperionCore {
342345
world.set(StreamLookup::default());
343346

344347
world.set_threads(i32::try_from(rayon::current_num_threads())?);
345-
346-
let mut app = world.app();
347-
348-
app.enable_rest(0)
349-
.enable_stats(true)
350-
.set_threads(i32::try_from(rayon::current_num_threads())?)
351-
.set_target_fps(20.0);
352-
353348
world.import::<SimModule>();
354349
world.import::<EgressModule>();
355350
world.import::<IngressModule>();

events/tag/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ pub fn init_game(address: SocketAddr) -> anyhow::Result<()> {
173173

174174
app.enable_rest(0)
175175
.enable_stats(true)
176-
.set_threads(i32::try_from(rayon::current_num_threads())?)
177-
.set_target_fps(20.0);
176+
.set_threads(i32::try_from(rayon::current_num_threads())?);
178177

179178
world.app().run();
180179

0 commit comments

Comments
 (0)