Added guava caches to performance-sensitive components

This commit is contained in:
Auxilor
2022-02-01 10:44:19 +00:00
parent 885a7835ea
commit 70ef99e875
9 changed files with 97 additions and 32 deletions

View File

@@ -7,6 +7,5 @@ dependencies {
compileOnly 'org.reflections:reflections:0.9.12'
compileOnly 'net.kyori:adventure-text-minimessage:4.1.0-SNAPSHOT'
compileOnly 'net.kyori:adventure-platform-bukkit:4.0.0'
compileOnly 'com.google.guava:guava:31.0.1-jre'
compileOnly 'org.objenesis:objenesis:3.2'
}

View File

@@ -40,7 +40,6 @@ dependencies {
compileOnly 'com.bgsoftware:SuperiorSkyblockAPI:1.8.3'
compileOnly 'com.github.MilkBowl:VaultAPI:1.7'
compileOnly 'world.bentobox:bentobox:1.17.3-SNAPSHOT'
compileOnly 'com.google.guava:guava:31.0.1-jre'
compileOnly 'com.iridium:IridiumSkyblock:3.1.2'
compileOnly 'com.github.WhipDevelopment:CrashClaim:f9cd7d92eb'
compileOnly 'com.wolfyscript.wolfyutilities:wolfyutilities:3.16.0.0'

View File

@@ -1,6 +0,0 @@
package com.willfp.eco.internal.spigot.data
import com.willfp.eco.core.data.keys.PersistentDataKey
import com.willfp.eco.internal.spigot.data.storage.DataHandler
import java.util.UUID

View File

@@ -23,22 +23,17 @@ class EcoProfileHandler(
val data = mutableMapOf<PersistentDataKey<*>, Any>()
return if (uuid == serverProfileUUID) {
val profile = EcoServerProfile(data, handler)
loaded[uuid] = profile
profile
} else {
val profile = EcoPlayerProfile(data, uuid, handler)
loaded[uuid] = profile
profile
}
val profile = if (uuid == serverProfileUUID)
EcoServerProfile(data, handler) else EcoPlayerProfile(data, uuid, handler)
loaded[uuid] = profile
return profile
}
override fun load(uuid: UUID): PlayerProfile {
return loadGenericProfile(uuid) as PlayerProfile
}
override fun loadServerProfile(): ServerProfile {
return loadGenericProfile(serverProfileUUID) as ServerProfile
}

View File

@@ -57,5 +57,4 @@ libraries:
- 'mysql:mysql-connector-java:8.0.25'
- 'com.google.guava:guava:31.0.1-jre'
- 'com.zaxxer:HikariCP:5.0.0'
- 'org.apache.commons:commons-lang3:3.0'
- 'org.objenesis:objenesis:3.2'