Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
senseiwells committed Jan 30, 2024
1 parent e444c35 commit 12784d7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ repositories {

dependencies {
// For the most recent version use the latest commit hash
val version = "e108063c09"
val version = "e444c355ad"
modImplementation("com.github.Senseiwells:ServerReplay:$version")
}
```
Expand All @@ -296,16 +296,26 @@ class ExampleMod: ModInitializer {
if (!PlayerRecorders.has(player)) {
if (player.level().dimension() == Level.END) {
val recorder = PlayerRecorders.create(player)
recorder.start(log = true)
recorder.tryStart(log = true)
}
} else {
val existing = PlayerRecorders.get(player)
val existing = PlayerRecorders.get(player)!!
existing.getCompressedRecordingSize().thenAccept { size ->
println("Replay is $size bytes")
}
existing.stop(save = false)
}
}

ServerLifecycleEvents.SERVER_STARTED.register { server ->
val recorder = ChunkRecorders.create(
server.overworld(),
ChunkPos.ZERO,
ChunkPos(5, 5),
"Named"
)
recorder.tryStart(log = false)
}
}
}
```

0 comments on commit 12784d7

Please sign in to comment.