From 8c43ff6b87f52d3910ea489b3d6241d5775781d1 Mon Sep 17 00:00:00 2001 From: bluefireoly Date: Sat, 31 Oct 2020 16:00:01 +0100 Subject: [PATCH] Added onlineSenders value --- .../net/axay/kspigot/extensions/GeneralExtensions.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/kotlin/net/axay/kspigot/extensions/GeneralExtensions.kt b/src/main/kotlin/net/axay/kspigot/extensions/GeneralExtensions.kt index bf074ccc..b56b4a5c 100644 --- a/src/main/kotlin/net/axay/kspigot/extensions/GeneralExtensions.kt +++ b/src/main/kotlin/net/axay/kspigot/extensions/GeneralExtensions.kt @@ -3,6 +3,8 @@ package net.axay.kspigot.extensions import net.axay.kspigot.main.KSpigotMainInstance import org.bukkit.Bukkit import org.bukkit.NamespacedKey +import org.bukkit.command.CommandSender +import org.bukkit.entity.Entity import org.bukkit.entity.Player /** @@ -11,6 +13,12 @@ import org.bukkit.entity.Player */ val onlinePlayers: Collection get() = Bukkit.getOnlinePlayers() +/** + * Shortcut to get a collection of all + * online players plus the console command sender. + */ +val onlineSenders: Collection get() = Bukkit.getOnlinePlayers().plus(Bukkit.getConsoleSender()) + /** * Shortcut to get the Server. * @see Bukkit.getServer