mirror of
https://github.com/Auxilor/EcoSkills.git
synced 2025-12-31 04:46:31 +00:00
Fixed permission cache
This commit is contained in:
@@ -74,6 +74,7 @@ public class EcoSkillsPlugin extends EcoPlugin {
|
||||
ActionBarUtils.startRunnable();
|
||||
}
|
||||
|
||||
this.getScheduler().runTimer(EcoSkillsPlayerKt::clearExpMultiplierCache, 100, 100);
|
||||
SkillDisplayListener.tickBossBars(this);
|
||||
this.getScheduler().runAsyncTimer(new LeaderboardHandler.Runnable(), 50, 2400);
|
||||
}
|
||||
|
||||
@@ -16,12 +16,16 @@ import org.bukkit.entity.Entity
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.entity.Projectile
|
||||
import org.bukkit.entity.Tameable
|
||||
import java.util.UUID
|
||||
import java.util.*
|
||||
import kotlin.math.abs
|
||||
|
||||
private val expMultiplierCache = mutableMapOf<UUID, Double>()
|
||||
private val plugin: EcoSkillsPlugin = EcoSkillsPlugin.getInstance()
|
||||
|
||||
fun clearExpMultiplierCache() {
|
||||
expMultiplierCache.clear()
|
||||
}
|
||||
|
||||
fun Player.getSkillExperienceMultiplier(): Double {
|
||||
if (expMultiplierCache.containsKey(this.uniqueId)) {
|
||||
return expMultiplierCache[this.uniqueId]!!
|
||||
@@ -55,10 +59,6 @@ private fun Player.cacheSkillExperienceMultiplier(): Double {
|
||||
}
|
||||
}
|
||||
|
||||
plugin.scheduler.runLater({
|
||||
expMultiplierCache.remove(this.uniqueId)
|
||||
}, 200)
|
||||
|
||||
return 1.0
|
||||
}
|
||||
|
||||
@@ -179,7 +179,8 @@ fun OfflinePlayer.setStatLevel(stat: Stat, level: Int) {
|
||||
}
|
||||
}
|
||||
|
||||
private val gainSoundKey = PersistentDataKey<Boolean>(plugin.namespacedKeyFactory.create("gainSound"), PersistentDataKeyType.BOOLEAN, true);
|
||||
private val gainSoundKey =
|
||||
PersistentDataKey<Boolean>(plugin.namespacedKeyFactory.create("gainSound"), PersistentDataKeyType.BOOLEAN, true);
|
||||
|
||||
fun OfflinePlayer.hasGainSoundEnabled(): Boolean {
|
||||
return PlayerProfile.load(this).read(gainSoundKey)
|
||||
|
||||
Reference in New Issue
Block a user