Skip to content

Commit

Permalink
fix: fix config node name again
Browse files Browse the repository at this point in the history
  • Loading branch information
MC-XiaoHei committed May 3, 2024
1 parent d512729 commit 462a4df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/cn/xor7/iseeyou/EventListener.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object EventListener : Listener {
photographer.setFollowPlayer(player)
return
}
if (toml!!.data.instantReplayConfig.enabled) {
if (toml!!.data.instantReplay.enabled) {
InstantReplayManager.watch(player)
}
var prefix = player.name
Expand Down Expand Up @@ -102,7 +102,7 @@ object EventListener : Listener {
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
fun onPlayerQuit(event: PlayerQuitEvent) {
val player = event.player
if (toml!!.data.instantReplayConfig.enabled) {
if (toml!!.data.instantReplay.enabled) {
InstantReplayManager.taskMap[player.uniqueId.toString()]?.cancel()
}
val photographer: Photographer = photographers[player.uniqueId.toString()] ?: return
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/cn/xor7/iseeyou/InstantReplayManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import java.util.concurrent.TimeUnit

object InstantReplayManager {
val photographerMap: ExpiringMap<String, Photographer> = ExpiringMap.builder()
.expiration(toml!!.data.instantReplayConfig.replayMinutes.toLong(), TimeUnit.MINUTES)
.expiration(toml!!.data.instantReplay.replayMinutes.toLong(), TimeUnit.MINUTES)
.expirationPolicy(ExpirationPolicy.CREATED)
.expirationListener { playerUUID: String, photographer: Photographer ->
recordFileMap[photographer.name]?.delete()
Expand All @@ -40,7 +40,7 @@ object InstantReplayManager {
.getPhotographerManager()
.createPhotographer(UUID.randomUUID().toString(), player.location)?.apply {
val currentTime = LocalDateTime.now()
val recordPath: String = toml!!.data.instantReplayConfig.recordPath
val recordPath: String = toml!!.data.instantReplay.recordPath
.replace("\${name}", player.name)
.replace("\${uuid}", player.uniqueId.toString())
File(recordPath).mkdirs()
Expand All @@ -58,7 +58,7 @@ object InstantReplayManager {
}.runTaskTimer(
instance ?: return,
0,
(toml!!.data.instantReplayConfig.createPerMinutes * 60 * 1000).toLong()
(toml!!.data.instantReplay.createPerMinutes * 60 * 1000).toLong()
).also { task ->
taskMap[player.uniqueId.toString()] = task
}
Expand Down

0 comments on commit 462a4df

Please sign in to comment.