Skip to content

Commit

Permalink
Clean up folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
andyksaw committed Nov 24, 2024
1 parent fefb7b1 commit 0a4cedf
Show file tree
Hide file tree
Showing 77 changed files with 182 additions and 201 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import com.projectcitybuild.pcbridge.paper.features.warps.commands.WarpCommand
import com.projectcitybuild.pcbridge.paper.features.warps.commands.WarpsCommand
import com.projectcitybuild.pcbridge.paper.features.warps.repositories.WarpRepository
import com.projectcitybuild.pcbridge.http.PCBHttp
import com.projectcitybuild.pcbridge.paper.core.discord.services.DiscordSend
import com.projectcitybuild.pcbridge.paper.core.libs.services.DiscordSend
import com.projectcitybuild.pcbridge.paper.features.builds.commands.BuildCommand
import com.projectcitybuild.pcbridge.paper.features.builds.commands.BuildsCommand
import com.projectcitybuild.pcbridge.paper.features.builds.commands.builds.BuildCreateCommand
Expand All @@ -67,15 +67,14 @@ import com.projectcitybuild.pcbridge.paper.features.watchdog.listeners.commands.
import com.projectcitybuild.pcbridge.paper.integrations.DynmapIntegration
import com.projectcitybuild.pcbridge.paper.integrations.EssentialsIntegration
import com.projectcitybuild.pcbridge.paper.integrations.LuckPermsIntegration
import com.projectcitybuild.pcbridge.paper.support.spigot.SpigotCommandRegistry
import com.projectcitybuild.pcbridge.paper.support.spigot.SpigotEventBroadcaster
import com.projectcitybuild.pcbridge.paper.support.spigot.SpigotListenerRegistry
import com.projectcitybuild.pcbridge.paper.support.spigot.SpigotNamespace
import com.projectcitybuild.pcbridge.paper.support.spigot.SpigotTimer
import com.projectcitybuild.pcbridge.paper.core.support.spigot.SpigotCommandRegistry
import com.projectcitybuild.pcbridge.paper.core.support.spigot.SpigotEventBroadcaster
import com.projectcitybuild.pcbridge.paper.core.support.spigot.SpigotListenerRegistry
import com.projectcitybuild.pcbridge.paper.core.support.spigot.SpigotNamespace
import com.projectcitybuild.pcbridge.paper.core.support.spigot.SpigotTimer
import com.projectcitybuild.pcbridge.webserver.HttpServer
import com.projectcitybuild.pcbridge.webserver.HttpServerConfig
import io.github.reactivecircus.cache4k.Cache
import io.papermc.paper.plugin.lifecycle.event.LifecycleEventManager
import net.kyori.adventure.platform.bukkit.BukkitAudiences
import org.bukkit.plugin.java.JavaPlugin
import org.koin.core.module.Module
Expand Down Expand Up @@ -226,7 +225,7 @@ private fun Module.core() {
}

single {
DiscordSend(
com.projectcitybuild.pcbridge.paper.core.libs.services.DiscordSend(
localConfig = get(),
discordHttpService = get<DiscordHttp>().discord,
sentryReporter = get(),
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.projectcitybuild.pcbridge.paper

import com.github.shynixn.mccoroutine.bukkit.SuspendingJavaPlugin
import com.projectcitybuild.pcbridge.paper.core.discord.services.DiscordSend
import com.projectcitybuild.pcbridge.paper.core.libs.services.DiscordSend
import com.projectcitybuild.pcbridge.paper.core.errors.SentryReporter
import com.projectcitybuild.pcbridge.paper.core.errors.trace
import com.projectcitybuild.pcbridge.paper.core.remoteconfig.commands.ConfigCommand
Expand Down Expand Up @@ -40,9 +40,9 @@ import com.projectcitybuild.pcbridge.paper.features.watchdog.listeners.commands.
import com.projectcitybuild.pcbridge.paper.integrations.DynmapIntegration
import com.projectcitybuild.pcbridge.paper.integrations.EssentialsIntegration
import com.projectcitybuild.pcbridge.paper.integrations.LuckPermsIntegration
import com.projectcitybuild.pcbridge.paper.support.spigot.SpigotCommandRegistry
import com.projectcitybuild.pcbridge.paper.support.spigot.SpigotListenerRegistry
import com.projectcitybuild.pcbridge.paper.support.spigot.SpigotTimer
import com.projectcitybuild.pcbridge.paper.core.support.spigot.SpigotCommandRegistry
import com.projectcitybuild.pcbridge.paper.core.support.spigot.SpigotListenerRegistry
import com.projectcitybuild.pcbridge.paper.core.support.spigot.SpigotTimer
import com.projectcitybuild.pcbridge.webserver.HttpServer
import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents
import net.kyori.adventure.platform.bukkit.BukkitAudiences
Expand Down Expand Up @@ -177,7 +177,7 @@ private class Lifecycle : KoinComponent {
get<EssentialsIntegration>().enable()
get<LuckPermsIntegration>().enable()

get<DiscordSend>().startProcessing()
get<com.projectcitybuild.pcbridge.paper.core.libs.services.DiscordSend>().startProcessing()
}

suspend fun shutdown() =
Expand All @@ -190,7 +190,7 @@ private class Lifecycle : KoinComponent {
get<EssentialsIntegration>().disable()
get<LuckPermsIntegration>().disable()

get<DiscordSend>().stopProcessing()
get<com.projectcitybuild.pcbridge.paper.core.libs.services.DiscordSend>().stopProcessing()

listenerRegistry.unregisterAll()
commandRegistry.unregisterAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.projectcitybuild.pcbridge.http.models.pcb.IPBan
import com.projectcitybuild.pcbridge.http.models.pcb.PlayerBan
import com.projectcitybuild.pcbridge.http.models.pcb.RemoteConfigVersion
import com.projectcitybuild.pcbridge.http.models.pcb.Warp
import com.projectcitybuild.pcbridge.paper.support.spigot.SpigotEventBroadcaster
import com.projectcitybuild.pcbridge.paper.core.support.spigot.SpigotEventBroadcaster
import com.projectcitybuild.pcbridge.webserver.HttpServerDelegate
import java.util.UUID

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.support.kotlin
package com.projectcitybuild.pcbridge.paper.core.extensions

import java.lang.Enum.valueOf

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.utils.extensions
package com.projectcitybuild.pcbridge.paper.core.extensions

import java.util.regex.Pattern

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.core.datetime
package com.projectcitybuild.pcbridge.paper.core.libs.datetime

import java.time.Instant
import java.time.ZoneId
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.core.datetime
package com.projectcitybuild.pcbridge.paper.core.libs.datetime

import java.time.LocalDateTime
import java.time.OffsetDateTime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.core.datetime
package com.projectcitybuild.pcbridge.paper.core.libs.datetime

import java.time.Clock
import java.time.LocalDateTime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.core.errors
package com.projectcitybuild.pcbridge.paper.core.libs.errors

import com.projectcitybuild.pcbridge.paper.core.localconfig.LocalConfig
import com.projectcitybuild.pcbridge.paper.core.logger.log
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.core.localconfig
package com.projectcitybuild.pcbridge.paper.core.libs.localconfig

import com.google.gson.FieldNamingPolicy
import com.google.gson.GsonBuilder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.core.localconfig
package com.projectcitybuild.pcbridge.paper.core.libs.localconfig

class LocalConfig(
private val jsonStorage: JsonStorage<LocalConfigKeyValues>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("ktlint:standard:max-line-length")

package com.projectcitybuild.pcbridge.paper.core.localconfig
package com.projectcitybuild.pcbridge.paper.core.libs.localconfig

import kotlinx.serialization.Serializable
import java.io.Serial
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.core.logger
package com.projectcitybuild.pcbridge.paper.core.libs.logger

import io.github.oshai.kotlinlogging.KotlinLogging

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.core.pagination
package com.projectcitybuild.pcbridge.paper.core.libs.pagination

data class Page<T>(
val items: List<T>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.core.pagination
package com.projectcitybuild.pcbridge.paper.core.libs.pagination

import kotlin.math.ceil
import kotlin.math.min
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.core.permissions
package com.projectcitybuild.pcbridge.paper.core.libs.permissions

import java.util.UUID

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.core.permissions.adapters
package com.projectcitybuild.pcbridge.paper.core.libs.permissions.adapters

import com.projectcitybuild.pcbridge.paper.core.logger.log
import com.projectcitybuild.pcbridge.paper.core.permissions.Permissions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.projectcitybuild.pcbridge.paper.core.remoteconfig.commands
package com.projectcitybuild.pcbridge.paper.core.libs.remoteconfig.commands

import com.projectcitybuild.pcbridge.paper.core.remoteconfig.services.RemoteConfig
import com.projectcitybuild.pcbridge.paper.support.messages.CommandHelpBuilder
import com.projectcitybuild.pcbridge.paper.support.spigot.BadCommandUsageException
import com.projectcitybuild.pcbridge.paper.support.spigot.CommandArgsParser
import com.projectcitybuild.pcbridge.paper.support.spigot.SpigotCommand
import com.projectcitybuild.pcbridge.paper.support.spigot.UnauthorizedCommandException
import com.projectcitybuild.pcbridge.paper.support.kotlin.tryValueOf
import com.projectcitybuild.pcbridge.paper.core.support.messages.CommandHelpBuilder
import com.projectcitybuild.pcbridge.paper.core.support.spigot.BadCommandUsageException
import com.projectcitybuild.pcbridge.paper.core.support.spigot.CommandArgsParser
import com.projectcitybuild.pcbridge.paper.core.support.spigot.SpigotCommand
import com.projectcitybuild.pcbridge.paper.core.support.spigot.UnauthorizedCommandException
import com.projectcitybuild.pcbridge.paper.core.extensions.tryValueOf
import net.kyori.adventure.text.minimessage.MiniMessage
import org.bukkit.command.Command
import org.bukkit.command.CommandSender
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.core.remoteconfig.events
package com.projectcitybuild.pcbridge.paper.core.libs.remoteconfig.events

import com.projectcitybuild.pcbridge.http.models.pcb.RemoteConfigVersion
import org.bukkit.event.Event
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.projectcitybuild.pcbridge.paper.core.remoteconfig.services
package com.projectcitybuild.pcbridge.paper.core.libs.remoteconfig.services

import com.projectcitybuild.pcbridge.paper.core.logger.log
import com.projectcitybuild.pcbridge.paper.core.remoteconfig.events.RemoteConfigUpdatedEvent
import com.projectcitybuild.pcbridge.http.models.pcb.RemoteConfigKeyValues
import com.projectcitybuild.pcbridge.http.models.pcb.RemoteConfigVersion
import com.projectcitybuild.pcbridge.http.services.pcb.ConfigHttpService
import com.projectcitybuild.pcbridge.paper.support.spigot.SpigotEventBroadcaster
import com.projectcitybuild.pcbridge.paper.core.support.spigot.SpigotEventBroadcaster

class RemoteConfig(
private val configHttpService: ConfigHttpService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.core.discord.services
package com.projectcitybuild.pcbridge.paper.core.libs.services

import com.projectcitybuild.pcbridge.http.services.discord.DiscordHttpService
import com.projectcitybuild.pcbridge.http.models.discord.DiscordEmbed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.core.store
package com.projectcitybuild.pcbridge.paper.core.libs.store

import com.projectcitybuild.pcbridge.http.models.pcb.Account
import com.projectcitybuild.pcbridge.http.models.pcb.Badge
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.core.store
package com.projectcitybuild.pcbridge.paper.core.libs.store

import com.projectcitybuild.pcbridge.paper.core.logger.log
import kotlinx.coroutines.Dispatchers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.support.brigadier
package com.projectcitybuild.pcbridge.paper.core.support.brigadier

import com.github.shynixn.mccoroutine.bukkit.launch
import com.mojang.brigadier.Command
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
package com.projectcitybuild.pcbridge.paper.support.brigadier
package com.projectcitybuild.pcbridge.paper.core.support.brigadier

import com.mojang.brigadier.tree.LiteralCommandNode
import io.papermc.paper.command.brigadier.CommandSourceStack

/**
* Represents either a command or subcommand that can be
* registered with Brigadier
*/
@Suppress("UnstableApiUsage")
interface BrigadierCommand {
fun buildLiteral(): LiteralCommandNode<CommandSourceStack>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.projectcitybuild.pcbridge.paper.support.brigadier
package com.projectcitybuild.pcbridge.paper.core.support.brigadier

import com.mojang.brigadier.context.CommandContext
import com.projectcitybuild.pcbridge.http.parsing.ResponseParser
import com.projectcitybuild.pcbridge.paper.support.spigot.BadCommandUsageException
import com.projectcitybuild.pcbridge.paper.support.spigot.UnauthorizedCommandException
import com.projectcitybuild.pcbridge.paper.core.support.spigot.BadCommandUsageException
import com.projectcitybuild.pcbridge.paper.core.support.spigot.UnauthorizedCommandException
import io.papermc.paper.command.brigadier.CommandSourceStack
import net.kyori.adventure.text.minimessage.MiniMessage
import org.bukkit.command.CommandSender
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.support.kotlin
package com.projectcitybuild.pcbridge.paper.core.support.kotlin

class Trie {
private class Node {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.support.messages
package com.projectcitybuild.pcbridge.paper.core.support.messages

import net.kyori.adventure.text.Component
import net.kyori.adventure.text.TextComponent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.support.messages
package com.projectcitybuild.pcbridge.paper.core.support.messages

import com.projectcitybuild.pcbridge.paper.core.pagination.Page
import net.kyori.adventure.text.Component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.support.messages
package com.projectcitybuild.pcbridge.paper.core.support.messages

import net.kyori.adventure.text.Component
import net.kyori.adventure.text.TextComponent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.projectcitybuild.pcbridge.paper.support.spigot
package com.projectcitybuild.pcbridge.paper.core.support.spigot

import com.projectcitybuild.pcbridge.paper.support.messages.CommandHelpBuilder
import com.projectcitybuild.pcbridge.paper.core.support.messages.CommandHelpBuilder
import org.bukkit.command.Command
import org.bukkit.command.CommandSender

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.support.spigot
package com.projectcitybuild.pcbridge.paper.core.support.spigot

import com.github.shynixn.mccoroutine.bukkit.SuspendingCommandExecutor
import com.github.shynixn.mccoroutine.bukkit.SuspendingTabCompleter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.support.spigot
package com.projectcitybuild.pcbridge.paper.core.support.spigot

import kotlinx.coroutines.withContext
import org.bukkit.Server
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.support.spigot
package com.projectcitybuild.pcbridge.paper.core.support.spigot

import com.projectcitybuild.pcbridge.paper.core.errors.SentryReporter
import com.projectcitybuild.pcbridge.paper.core.logger.log
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.support.spigot
package com.projectcitybuild.pcbridge.paper.core.support.spigot

import com.github.shynixn.mccoroutine.bukkit.registerSuspendingEvents
import org.bukkit.event.HandlerList
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.support.spigot
package com.projectcitybuild.pcbridge.paper.core.support.spigot

import org.bukkit.NamespacedKey
import org.bukkit.plugin.java.JavaPlugin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.projectcitybuild.pcbridge.paper.support.spigot
package com.projectcitybuild.pcbridge.paper.core.support.spigot

import com.projectcitybuild.pcbridge.paper.utils.Cancellable
import com.projectcitybuild.pcbridge.paper.core.utils.Cancellable
import org.bukkit.plugin.java.JavaPlugin
import org.bukkit.scheduler.BukkitTask
import java.util.concurrent.TimeUnit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.utils
package com.projectcitybuild.pcbridge.paper.core.utils

import java.util.concurrent.locks.ReentrantLock

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectcitybuild.pcbridge.paper.utils
package com.projectcitybuild.pcbridge.paper.core.utils

sealed class Result<out Success, out Failure>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.projectcitybuild.pcbridge.paper.features.announcements.actions

import com.projectcitybuild.pcbridge.paper.core.remoteconfig.services.RemoteConfig
import com.projectcitybuild.pcbridge.paper.features.announcements.repositories.AnnouncementRepository
import com.projectcitybuild.pcbridge.paper.support.spigot.SpigotTimer
import com.projectcitybuild.pcbridge.paper.core.support.spigot.SpigotTimer
import kotlinx.coroutines.runBlocking
import net.kyori.adventure.text.minimessage.MiniMessage
import org.bukkit.Server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.projectcitybuild.pcbridge.paper.features.bans.actions.AuthorizeConnec
import com.projectcitybuild.pcbridge.paper.features.bans.events.ConnectionPermittedEvent
import com.projectcitybuild.pcbridge.paper.features.bans.repositories.PlayerRepository
import com.projectcitybuild.pcbridge.paper.features.bans.utilities.toMiniMessage
import com.projectcitybuild.pcbridge.paper.support.spigot.SpigotEventBroadcaster
import com.projectcitybuild.pcbridge.paper.core.support.spigot.SpigotEventBroadcaster
import kotlinx.coroutines.runBlocking
import org.bukkit.event.EventHandler
import org.bukkit.event.EventPriority
Expand Down
Loading

0 comments on commit 0a4cedf

Please sign in to comment.