diff --git a/build.gradle.kts b/build.gradle.kts index ce63d31..d1b07ac 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -39,7 +39,7 @@ allprojects { } dependencies { - compileOnly("com.willfp:eco:6.56.0") + compileOnly("com.willfp:eco:6.77.0") compileOnly("org.jetbrains:annotations:23.0.0") compileOnly("org.jetbrains.kotlin:kotlin-stdlib:2.1.0") } diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/jobs/JobLevelListener.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/jobs/JobLevelListener.kt index eb97478..6bfbc1d 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/jobs/JobLevelListener.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/jobs/JobLevelListener.kt @@ -1,5 +1,6 @@ package com.willfp.ecojobs.jobs +import com.willfp.eco.util.SoundUtils import com.willfp.ecojobs.EcoJobsPlugin import com.willfp.ecojobs.api.event.PlayerJobLevelUpEvent import com.willfp.libreforge.toDispatcher @@ -21,15 +22,17 @@ class JobLevelListener( job.executeLevelCommands(player, level) if (this.plugin.configYml.getBool("level-up.sound.enabled")) { - val sound = Sound.valueOf(this.plugin.configYml.getString("level-up.sound.id").uppercase()) + val sound = SoundUtils.getSound(this.plugin.configYml.getString("level-up.sound.id")) val pitch = this.plugin.configYml.getDouble("level-up.sound.pitch") - player.playSound( - player.location, - sound, - 100f, - pitch.toFloat() - ) + if (sound != null) { + player.playSound( + player.location, + sound, + 100f, + pitch.toFloat() + ) + } } if (this.plugin.configYml.getBool("level-up.message.enabled")) { diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/jobs/JobsGUI.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/jobs/JobsGUI.kt index b9b40dd..67b21cf 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/jobs/JobsGUI.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecojobs/jobs/JobsGUI.kt @@ -12,6 +12,7 @@ import com.willfp.eco.core.gui.slot.MaskItems import com.willfp.eco.core.items.Items import com.willfp.eco.core.items.builder.ItemStackBuilder import com.willfp.eco.core.items.builder.SkullBuilder +import com.willfp.eco.util.SoundUtils import com.willfp.eco.util.formatEco import com.willfp.ecojobs.EcoJobsPlugin import com.willfp.ecojobs.api.activeJobs @@ -145,12 +146,16 @@ object JobsGUI { } } - player.playSound( - player.location, - Sound.valueOf(plugin.configYml.getString("gui.job-icon.click.sound").uppercase()), - 1f, - plugin.configYml.getDouble("gui.job-icon.click.pitch").toFloat() - ) + val sound = SoundUtils.getSound(plugin.configYml.getString("gui.job-icon.click.sound")) + + if (sound != null) { + player.playSound( + player.location, + sound, + 1f, + plugin.configYml.getDouble("gui.job-icon.click.pitch").toFloat() + ) + } } onRightClick { player, _, _, menu -> @@ -165,12 +170,16 @@ object JobsGUI { if (player.hasJobActive(job)) { job.leaveGUI.open(player) - player.playSound( - player.location, - Sound.valueOf(plugin.configYml.getString("gui.job-icon.click.sound").uppercase()), - 1f, - plugin.configYml.getDouble("gui.job-icon.click.pitch").toFloat() - ) + val sound = SoundUtils.getSound(plugin.configYml.getString("gui.job-icon.click.sound")) + + if (sound != null) { + player.playSound( + player.location, + sound, + 1f, + plugin.configYml.getDouble("gui.job-icon.click.pitch").toFloat() + ) + } } } }) @@ -199,12 +208,14 @@ object JobsGUI { ) maxPages { player -> - ceil(Jobs.values() - .filter { player.getJobLevel(it) > 0 } - .size.toDouble() / jobAreaSlots.size).toInt() + ceil( + Jobs.values() + .filter { player.getJobLevel(it) > 0 } + .size.toDouble() / jobAreaSlots.size).toInt() } - setSlot(plugin.configYml.getInt("gui.close.location.row"), + setSlot( + plugin.configYml.getInt("gui.close.location.row"), plugin.configYml.getInt("gui.close.location.column"), slot( ItemStackBuilder(Items.lookup(plugin.configYml.getString("gui.close.item"))) diff --git a/gradle.properties b/gradle.properties index 52f769f..2d1f038 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,4 +2,4 @@ #Mon Oct 06 08:56:29 BST 2025 kotlin.code.style=official libreforge-version=4.79.0 -version=3.77.1 +version=3.77.2