diff --git a/src/main/kotlin/com/mineinabyss/packy/PackyCommands.kt b/src/main/kotlin/com/mineinabyss/packy/PackyCommands.kt index 413f3e7..ac4b213 100644 --- a/src/main/kotlin/com/mineinabyss/packy/PackyCommands.kt +++ b/src/main/kotlin/com/mineinabyss/packy/PackyCommands.kt @@ -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 { @@ -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" { diff --git a/src/main/kotlin/com/mineinabyss/packy/config/PackyConfig.kt b/src/main/kotlin/com/mineinabyss/packy/config/PackyConfig.kt index e192934..6ea839d 100644 --- a/src/main/kotlin/com/mineinabyss/packy/config/PackyConfig.kt +++ b/src/main/kotlin/com/mineinabyss/packy/config/PackyConfig.kt @@ -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")