Skip to content

Commit

Permalink
feat: add sendOnReload config setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed Aug 7, 2024
1 parent 8b7d393 commit 117230b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/kotlin/com/mineinabyss/packy/PackyCommands.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.mineinabyss.packy.components.packyData
import com.mineinabyss.packy.config.packy
import com.mineinabyss.packy.menus.picker.PackyMainMenu
import io.papermc.paper.command.brigadier.argument.ArgumentTypes
import org.bukkit.Bukkit
import org.bukkit.entity.Player

object PackyCommands {
Expand All @@ -19,6 +20,11 @@ object PackyCommands {
executes {
packy.plugin.createPackyContext()
sender.success("Packy has been reloaded!")
if (packy.config.sendOnReload) packy.plugin.server.onlinePlayers.forEach {
packy.plugin.launch {
PackyServer.sendPack(it)
}
}
}
}
"menu" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ data class PackyConfig(
@EncodeDefault(ALWAYS) val server: PackyServer = PackyServer(),
@EncodeDefault(ALWAYS) val prompt: String? = null,
@EncodeDefault(ALWAYS) val force: Boolean = false,
@EncodeDefault(ALWAYS) val sendOnReload: Boolean = false,
@YamlComment("What ObfuscationType to use, valid options are FULL, SIMPLE & NONE")
@EncodeDefault(ALWAYS) val obfuscation: ObfuscationType = ObfuscationType.FULL,
@YamlComment("This will use PackSquash to automatically squash all templates")
Expand Down

0 comments on commit 117230b

Please sign in to comment.