mirror of
https://github.com/Auxilor/EcoSkills.git
synced 2026-01-04 15:41:36 +00:00
Fixed descriptions, skill requirements, alchemy, skill start levels, and other bugs
This commit is contained in:
@@ -10,6 +10,7 @@ import com.willfp.eco.core.placeholder.PlayerStaticPlaceholder
|
||||
import com.willfp.eco.core.placeholder.PlayerlessPlaceholder
|
||||
import com.willfp.eco.core.placeholder.context.placeholderContext
|
||||
import com.willfp.eco.core.registry.KRegistrable
|
||||
import com.willfp.eco.util.formatEco
|
||||
import com.willfp.eco.util.toNumeral
|
||||
import com.willfp.ecoskills.EcoSkillsPlugin
|
||||
import com.willfp.ecoskills.util.DescriptionPlaceholder
|
||||
@@ -27,13 +28,11 @@ abstract class Levellable(
|
||||
val config: Config,
|
||||
protected val plugin: EcoSkillsPlugin
|
||||
) : KRegistrable {
|
||||
open val startLevel: Int = 0
|
||||
|
||||
private val key by lazy {
|
||||
PersistentDataKey(
|
||||
plugin.createNamespacedKey(id),
|
||||
PersistentDataKeyType.INT,
|
||||
startLevel
|
||||
1
|
||||
)
|
||||
}
|
||||
|
||||
@@ -93,8 +92,7 @@ abstract class Levellable(
|
||||
}
|
||||
|
||||
fun getDescription(player: Player): String {
|
||||
return config.getFormattedString(
|
||||
unformattedDescription,
|
||||
return unformattedDescription.formatEco(
|
||||
placeholderContext(
|
||||
player = player,
|
||||
injectable = LevelInjectable(getActualLevel(player))
|
||||
|
||||
@@ -40,8 +40,6 @@ class Skill(
|
||||
config: Config,
|
||||
plugin: EcoSkillsPlugin
|
||||
) : Levellable(id, config, plugin) {
|
||||
override val startLevel = 1
|
||||
|
||||
private val xpKey = PersistentDataKey(
|
||||
plugin.createNamespacedKey("${id}_xp"),
|
||||
PersistentDataKeyType.DOUBLE,
|
||||
@@ -128,7 +126,7 @@ class Skill(
|
||||
}
|
||||
|
||||
if (requirements != null) {
|
||||
return requirements.getOrNull(level - 1) ?: Double.POSITIVE_INFINITY
|
||||
return requirements.getOrNull(level) ?: Double.POSITIVE_INFINITY
|
||||
}
|
||||
|
||||
return Double.POSITIVE_INFINITY
|
||||
|
||||
@@ -93,8 +93,8 @@ stats-gui:
|
||||
pattern:
|
||||
- "111101111"
|
||||
- "111111111"
|
||||
- "110101011"
|
||||
- "101010101"
|
||||
- "110101011"
|
||||
- "111111111"
|
||||
- "011101111"
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ gui:
|
||||
- " %ecoskills_mystic_resilience_description%"
|
||||
|
||||
position:
|
||||
row: 3
|
||||
column: 3
|
||||
row: 4
|
||||
column: 4
|
||||
|
||||
xp-requirements:
|
||||
- 1
|
||||
|
||||
Reference in New Issue
Block a user