diff --git a/foundation-shared/src/main/kotlin/gay/pizza/foundation/shared/ChatExtensions.kt b/common-plugin/src/main/kotlin/gay/pizza/foundation/common/ChatExtensions.kt similarity index 78% rename from foundation-shared/src/main/kotlin/gay/pizza/foundation/shared/ChatExtensions.kt rename to common-plugin/src/main/kotlin/gay/pizza/foundation/common/ChatExtensions.kt index e936552..0774869 100644 --- a/foundation-shared/src/main/kotlin/gay/pizza/foundation/shared/ChatExtensions.kt +++ b/common-plugin/src/main/kotlin/gay/pizza/foundation/common/ChatExtensions.kt @@ -1,4 +1,4 @@ -package gay.pizza.foundation.shared +package gay.pizza.foundation.common import org.bukkit.entity.Player diff --git a/foundation-shared/src/main/kotlin/gay/pizza/foundation/shared/CollectionExtensions.kt b/common-plugin/src/main/kotlin/gay/pizza/foundation/common/CollectionExtensions.kt similarity index 85% rename from foundation-shared/src/main/kotlin/gay/pizza/foundation/shared/CollectionExtensions.kt rename to common-plugin/src/main/kotlin/gay/pizza/foundation/common/CollectionExtensions.kt index 0eae95e..4c2c709 100644 --- a/foundation-shared/src/main/kotlin/gay/pizza/foundation/shared/CollectionExtensions.kt +++ b/common-plugin/src/main/kotlin/gay/pizza/foundation/common/CollectionExtensions.kt @@ -1,4 +1,4 @@ -package gay.pizza.foundation.shared +package gay.pizza.foundation.common fun > Collection.sortedBy(order: SortOrder, selector: (T) -> R?): List = if (order == SortOrder.Ascending) { diff --git a/foundation-shared/src/main/kotlin/gay/pizza/foundation/shared/ServerExtensions.kt b/common-plugin/src/main/kotlin/gay/pizza/foundation/common/ServerExtensions.kt similarity index 96% rename from foundation-shared/src/main/kotlin/gay/pizza/foundation/shared/ServerExtensions.kt rename to common-plugin/src/main/kotlin/gay/pizza/foundation/common/ServerExtensions.kt index b6c7f83..a15d0fe 100644 --- a/foundation-shared/src/main/kotlin/gay/pizza/foundation/shared/ServerExtensions.kt +++ b/common-plugin/src/main/kotlin/gay/pizza/foundation/common/ServerExtensions.kt @@ -1,4 +1,4 @@ -package gay.pizza.foundation.shared +package gay.pizza.foundation.common import org.bukkit.Material import org.bukkit.OfflinePlayer diff --git a/foundation-shared/src/main/kotlin/gay/pizza/foundation/shared/SortOrder.kt b/common-plugin/src/main/kotlin/gay/pizza/foundation/common/SortOrder.kt similarity index 59% rename from foundation-shared/src/main/kotlin/gay/pizza/foundation/shared/SortOrder.kt rename to common-plugin/src/main/kotlin/gay/pizza/foundation/common/SortOrder.kt index 4d2cbd6..e08d84f 100644 --- a/foundation-shared/src/main/kotlin/gay/pizza/foundation/shared/SortOrder.kt +++ b/common-plugin/src/main/kotlin/gay/pizza/foundation/common/SortOrder.kt @@ -1,4 +1,4 @@ -package gay.pizza.foundation.shared +package gay.pizza.foundation.common enum class SortOrder { Ascending, diff --git a/foundation-shared/src/main/kotlin/gay/pizza/foundation/shared/SpawnExtensions.kt b/common-plugin/src/main/kotlin/gay/pizza/foundation/common/SpawnExtensions.kt similarity index 91% rename from foundation-shared/src/main/kotlin/gay/pizza/foundation/shared/SpawnExtensions.kt rename to common-plugin/src/main/kotlin/gay/pizza/foundation/common/SpawnExtensions.kt index 79d04cf..c0f334d 100644 --- a/foundation-shared/src/main/kotlin/gay/pizza/foundation/shared/SpawnExtensions.kt +++ b/common-plugin/src/main/kotlin/gay/pizza/foundation/common/SpawnExtensions.kt @@ -1,4 +1,4 @@ -package gay.pizza.foundation.shared +package gay.pizza.foundation.common import org.bukkit.Location import org.bukkit.World diff --git a/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/ChaosController.kt b/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/ChaosController.kt index 4b6f384..773ee1c 100644 --- a/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/ChaosController.kt +++ b/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/ChaosController.kt @@ -18,7 +18,8 @@ class ChaosController(val plugin: Plugin, val config: ChaosConfig) : Listener { val selectorController = ChaosSelectorController(this, plugin) val allModules = ChaosModules.all(plugin) - private var allowedModules: List = emptyList() + var allowedModules: List = emptyList() + private var activeModules = mutableSetOf() var bossBar: BossBar? = null diff --git a/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/ChaosSelectorController.kt b/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/ChaosSelectorController.kt index 2be0438..fe33879 100644 --- a/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/ChaosSelectorController.kt +++ b/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/ChaosSelectorController.kt @@ -15,8 +15,10 @@ class ChaosSelectorController(val controller: ChaosController, val plugin: Plugi fun select() { controller.deactivateAll() - val module = controller.allModules.random() - controller.activate(module) + val module = controller.allowedModules.randomOrNull() + if (module != null) { + controller.activate(module) + } } fun cancel() { diff --git a/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/modules/MegaTnt.kt b/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/modules/MegaTnt.kt index c85f421..1a91239 100644 --- a/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/modules/MegaTnt.kt +++ b/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/modules/MegaTnt.kt @@ -1,6 +1,6 @@ package gay.pizza.foundation.chaos.modules -import gay.pizza.foundation.shared.spawn +import gay.pizza.foundation.common.spawn import org.bukkit.entity.TNTPrimed import org.bukkit.plugin.Plugin diff --git a/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/modules/TntAllPlayers.kt b/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/modules/TntAllPlayers.kt index 3426c44..c9727bb 100644 --- a/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/modules/TntAllPlayers.kt +++ b/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/modules/TntAllPlayers.kt @@ -1,6 +1,6 @@ package gay.pizza.foundation.chaos.modules -import gay.pizza.foundation.shared.spawn +import gay.pizza.foundation.common.spawn import org.bukkit.entity.TNTPrimed import org.bukkit.plugin.Plugin diff --git a/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/modules/WorldSwapper.kt b/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/modules/WorldSwapper.kt index 47faef0..03228cf 100644 --- a/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/modules/WorldSwapper.kt +++ b/foundation-chaos/src/main/kotlin/gay/pizza/foundation/chaos/modules/WorldSwapper.kt @@ -4,6 +4,8 @@ import gay.pizza.foundation.chaos.randomPlayer import gay.pizza.foundation.common.without import org.bukkit.Chunk import org.bukkit.ChunkSnapshot +import org.bukkit.Location +import org.bukkit.Material import org.bukkit.block.Block import org.bukkit.block.data.BlockData import org.bukkit.plugin.Plugin diff --git a/foundation-core/src/main/kotlin/gay/pizza/foundation/core/features/player/GooseCommand.kt b/foundation-core/src/main/kotlin/gay/pizza/foundation/core/features/player/GooseCommand.kt index ce4a521..8855d94 100644 --- a/foundation-core/src/main/kotlin/gay/pizza/foundation/core/features/player/GooseCommand.kt +++ b/foundation-core/src/main/kotlin/gay/pizza/foundation/core/features/player/GooseCommand.kt @@ -1,6 +1,6 @@ package gay.pizza.foundation.core.features.player -import gay.pizza.foundation.shared.chat +import gay.pizza.foundation.common.chat import org.bukkit.command.Command import org.bukkit.command.CommandExecutor import org.bukkit.command.CommandSender diff --git a/foundation-core/src/main/kotlin/gay/pizza/foundation/core/features/player/MegaTntCommand.kt b/foundation-core/src/main/kotlin/gay/pizza/foundation/core/features/player/MegaTntCommand.kt index affc4cb..6bd03f1 100644 --- a/foundation-core/src/main/kotlin/gay/pizza/foundation/core/features/player/MegaTntCommand.kt +++ b/foundation-core/src/main/kotlin/gay/pizza/foundation/core/features/player/MegaTntCommand.kt @@ -1,6 +1,6 @@ package gay.pizza.foundation.core.features.player -import gay.pizza.foundation.shared.spawn +import gay.pizza.foundation.common.spawn import org.bukkit.command.Command import org.bukkit.command.CommandExecutor import org.bukkit.command.CommandSender diff --git a/foundation-core/src/main/kotlin/gay/pizza/foundation/core/features/stats/LeaderboardCommand.kt b/foundation-core/src/main/kotlin/gay/pizza/foundation/core/features/stats/LeaderboardCommand.kt index e1d092a..45799a2 100644 --- a/foundation-core/src/main/kotlin/gay/pizza/foundation/core/features/stats/LeaderboardCommand.kt +++ b/foundation-core/src/main/kotlin/gay/pizza/foundation/core/features/stats/LeaderboardCommand.kt @@ -1,7 +1,7 @@ package gay.pizza.foundation.core.features.stats -import gay.pizza.foundation.shared.SortOrder -import gay.pizza.foundation.shared.allPlayerStatisticsOf +import gay.pizza.foundation.common.SortOrder +import gay.pizza.foundation.common.allPlayerStatisticsOf import org.bukkit.Statistic import org.bukkit.command.Command import org.bukkit.command.CommandExecutor