9
0
mirror of https://github.com/Auxilor/EcoJobs.git synced 2025-12-21 16:09:18 +00:00

Fixed leaderboard placeholders updating

This commit is contained in:
_OfTeN_
2023-02-18 02:20:16 +03:00
parent 4034f5098f
commit 6bf9d371b9
2 changed files with 5 additions and 1 deletions

View File

@@ -38,6 +38,7 @@ import org.bukkit.Bukkit
import org.bukkit.OfflinePlayer
import org.bukkit.entity.Player
import org.bukkit.inventory.ItemStack
import java.time.Duration
import java.util.DoubleSummaryStatistics
import java.util.Objects
import java.util.concurrent.TimeUnit
@@ -47,7 +48,9 @@ import kotlin.math.max
class Job(
val id: String, val config: Config, private val plugin: EcoJobsPlugin
) {
private val topCache = Caffeine.newBuilder().build<Int, LeaderboardCacheEntry?>()
private val topCache = Caffeine.newBuilder()
.expireAfterWrite(Duration.ofSeconds(plugin.configYml.getInt("leaderboard-cache-lifetime").toLong()))
.build<Int, LeaderboardCacheEntry?>()
val name = config.getFormattedString("name")
val description = config.getFormattedString("description")

View File

@@ -312,6 +312,7 @@ point-names: # If you have point names that look ugly (eg g_souls) then you can
use-faster-move-trigger: true # Disable if you want move trigger to detect sub-1-block movements
raytrace-distance: 80 # The distance that alt_click should check for a location
leaderboard-cache-lifetime: 180 # How often will top placeholders update their cache (in seconds)
potions:
icon: