diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..7454180 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..2e6e589 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/src/main/kotlin/com/faithl/faithllevel/internal/compat/AttributePlus.kt b/src/main/kotlin/com/faithl/faithllevel/internal/compat/AttributePlus.kt deleted file mode 100644 index e9a7245..0000000 --- a/src/main/kotlin/com/faithl/faithllevel/internal/compat/AttributePlus.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.faithl.faithllevel.internal.compat - -object AttributePlus { -} \ No newline at end of file diff --git a/src/main/kotlin/com/faithl/faithllevel/internal/compat/MythicMobs.kt b/src/main/kotlin/com/faithl/faithllevel/internal/compat/MythicMobs.kt deleted file mode 100644 index c153546..0000000 --- a/src/main/kotlin/com/faithl/faithllevel/internal/compat/MythicMobs.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.faithl.faithllevel.internal.compat - -object MythicMobs { -} \ No newline at end of file diff --git a/src/main/kotlin/com/faithl/faithllevel/internal/compat/PlaceholderAPI.kt b/src/main/kotlin/com/faithl/faithllevel/internal/compat/PlaceholderAPI.kt deleted file mode 100644 index 0e6cbc8..0000000 --- a/src/main/kotlin/com/faithl/faithllevel/internal/compat/PlaceholderAPI.kt +++ /dev/null @@ -1,4 +0,0 @@ -package com.faithl.faithllevel.internal.compat - -object PlaceholderAPI { -} \ No newline at end of file diff --git a/src/main/kotlin/com/faithl/faithllevel/internal/core/Function.kt b/src/main/kotlin/com/faithl/faithllevel/internal/core/Function.kt deleted file mode 100644 index 232a11d..0000000 --- a/src/main/kotlin/com/faithl/faithllevel/internal/core/Function.kt +++ /dev/null @@ -1,22 +0,0 @@ -package com.faithl.faithllevel.internal.core - -import com.faithl.faithllevel.internal.core.impl.BasicLevel - -/** - * @author Leosouthey - * @since 2021/12/18-18:15 - **/ -//class Function(val basicLevel: BasicLevel) { -// -// val data = basicLevel.basis?.getConfigurationSection("data") -// val permission = basicLevel.basis?.getConfigurationSection("permission") -// val event = basicLevel.basis?.getConfigurationSection("event") -// val display = basicLevel.trait?.getConfigurationSection("display") -// val booster = basicLevel.trait?.getConfigurationSection("booster") -// val attribute = basicLevel.trait?.getConfigurationSection("attribute") -// val item = basicLevel.trait?.getConfigurationSection("item") -// -// init { -// BasicLevel.levelFunc.add(this) -// } -//} \ No newline at end of file diff --git a/src/main/kotlin/com/faithl/faithllevel/internal/core/impl/PureLevel.kt b/src/main/kotlin/com/faithl/faithllevel/internal/core/impl/PureLevel.kt index f3e7627..7f6f75c 100644 --- a/src/main/kotlin/com/faithl/faithllevel/internal/core/impl/PureLevel.kt +++ b/src/main/kotlin/com/faithl/faithllevel/internal/core/impl/PureLevel.kt @@ -39,6 +39,14 @@ open class PureLevel() : TempLevel() { expIncrease = value } + override fun getLevel(target: String): Int { + return levelData.getOrPut(target) { Database.INSTANCE.getLevel(target, FaithlLevelAPI.getName(this)) } + } + + override fun getExp(target: String): Int { + return expData.getOrPut(target) { Database.INSTANCE.getExp(target, FaithlLevelAPI.getName(this)) } + } + companion object { /** diff --git a/src/main/kotlin/com/faithl/faithllevel/internal/data/impl/DatabaseSQL.kt b/src/main/kotlin/com/faithl/faithllevel/internal/data/impl/DatabaseSQL.kt index 0fff7c7..a334f4f 100644 --- a/src/main/kotlin/com/faithl/faithllevel/internal/data/impl/DatabaseSQL.kt +++ b/src/main/kotlin/com/faithl/faithllevel/internal/data/impl/DatabaseSQL.kt @@ -20,7 +20,7 @@ import java.util.concurrent.ConcurrentHashMap **/ class DatabaseSQL : Database() { - val host = FaithlLevel.setting.getHost("storage.source.sql") + val host = FaithlLevel.setting.getHost("storage.source.mysql") val dataSource = host.createDataSource() val tableTarget = Table("${name}_target", host) { diff --git a/src/main/kotlin/com/faithl/faithllevel/module/compat/AttributePlus.kt b/src/main/kotlin/com/faithl/faithllevel/module/compat/AttributePlus.kt new file mode 100644 index 0000000..6d57e35 --- /dev/null +++ b/src/main/kotlin/com/faithl/faithllevel/module/compat/AttributePlus.kt @@ -0,0 +1,4 @@ +package com.faithl.faithllevel.module.compat + +object AttributePlus { +} \ No newline at end of file diff --git a/src/main/kotlin/com/faithl/faithllevel/module/compat/MythicMobs.kt b/src/main/kotlin/com/faithl/faithllevel/module/compat/MythicMobs.kt new file mode 100644 index 0000000..64a2619 --- /dev/null +++ b/src/main/kotlin/com/faithl/faithllevel/module/compat/MythicMobs.kt @@ -0,0 +1,4 @@ +package com.faithl.faithllevel.module.compat + +object MythicMobs { +} \ No newline at end of file diff --git a/src/main/kotlin/com/faithl/faithllevel/module/compat/PlaceholderAPI.kt b/src/main/kotlin/com/faithl/faithllevel/module/compat/PlaceholderAPI.kt new file mode 100644 index 0000000..1191064 --- /dev/null +++ b/src/main/kotlin/com/faithl/faithllevel/module/compat/PlaceholderAPI.kt @@ -0,0 +1,4 @@ +package com.faithl.faithllevel.module.compat + +object PlaceholderAPI { +} \ No newline at end of file diff --git a/src/main/kotlin/com/faithl/faithllevel/internal/trait/Event.kt b/src/main/kotlin/com/faithl/faithllevel/module/trait/Event.kt similarity index 73% rename from src/main/kotlin/com/faithl/faithllevel/internal/trait/Event.kt rename to src/main/kotlin/com/faithl/faithllevel/module/trait/Event.kt index 9621bba..8126a68 100644 --- a/src/main/kotlin/com/faithl/faithllevel/internal/trait/Event.kt +++ b/src/main/kotlin/com/faithl/faithllevel/module/trait/Event.kt @@ -1,11 +1,4 @@ -package com.faithl.faithllevel.internal.trait - -import com.faithl.faithllevel.api.event.ChangeType -import com.faithl.faithllevel.api.event.ExpUpdateEvent -import com.faithl.faithllevel.api.event.LevelUpdateEvent -import com.faithl.faithllevel.internal.core.impl.BasicLevel -import com.faithl.faithllevel.internal.util.run -import taboolib.common.platform.event.SubscribeEvent +package com.faithl.faithllevel.module.trait internal object Event { // @@ -28,4 +21,5 @@ internal object Event { // ?.run(e.player, BasicLevel.getPlayerData(e.basicLevel, e.player).playerLevel) // } // } + } \ No newline at end of file diff --git a/src/main/kotlin/com/faithl/faithllevel/internal/trait/Permission.kt b/src/main/kotlin/com/faithl/faithllevel/module/trait/Permission.kt similarity index 77% rename from src/main/kotlin/com/faithl/faithllevel/internal/trait/Permission.kt rename to src/main/kotlin/com/faithl/faithllevel/module/trait/Permission.kt index 1f954d1..c935a2d 100644 --- a/src/main/kotlin/com/faithl/faithllevel/internal/trait/Permission.kt +++ b/src/main/kotlin/com/faithl/faithllevel/module/trait/Permission.kt @@ -1,11 +1,4 @@ -package com.faithl.faithllevel.internal.trait - -import com.faithl.faithllevel.api.FaithlLevelAPI -import com.faithl.faithllevel.api.event.ChangeType -import com.faithl.faithllevel.api.event.ExpUpdateEvent -import com.faithl.faithllevel.api.event.LevelUpdateEvent -import com.faithl.faithllevel.internal.core.impl.BasicLevel -import taboolib.common.platform.event.SubscribeEvent +package com.faithl.faithllevel.module.trait internal object Permission { diff --git a/src/main/resources/lang/zh_CN.yml b/src/main/resources/lang/zh_CN.yml index 79b03c6..516e8d7 100644 --- a/src/main/resources/lang/zh_CN.yml +++ b/src/main/resources/lang/zh_CN.yml @@ -15,4 +15,11 @@ command-reload: '&7[&bFaithlLevel&7] &r插件已重载完成.' command-level-description: '等级管理 &8(faithllevel.level)' command-exp-description: '经验管理 &8(faithllevel.exp)' -command-reload-description: '重载插件 &8(faithllevel.reload)' \ No newline at end of file +command-reload-description: '重载插件 &8(faithllevel.reload)' + +level-update: + add: + take: +exp-update: + add: + take: \ No newline at end of file diff --git a/src/main/resources/settings.yml b/src/main/resources/settings.yml index 783fd12..7f32246 100644 --- a/src/main/resources/settings.yml +++ b/src/main/resources/settings.yml @@ -13,7 +13,7 @@ storage: player-index: uuid prefix: faithllevel source: - sql: + mysql: host: localhost port: 3306 user: root