Skip to content

Commit

Permalink
refactor(reorganize): Reorganized code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dawsson committed Nov 16, 2023
1 parent 0cc4107 commit 2424c6e
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 169 deletions.
100 changes: 0 additions & 100 deletions common/src/main/kotlin/gg/flyte/common/util/HTTP.kt

This file was deleted.

18 changes: 5 additions & 13 deletions spigot/src/main/kotlin/gg/flyte/pluginPortal/PluginPortal.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package gg.flyte.pluginPortal

import gg.flyte.pluginPortal.command.CommandManager
import gg.flyte.pluginPortal.type.manager.Config
import gg.flyte.pluginPortal.type.manager.PPPluginCache
import gg.flyte.pluginPortal.manager.Config
import gg.flyte.pluginPortal.manager.PPPluginCache
import gg.flyte.twilight.twilight
import io.papermc.lib.PaperLib
import org.bstats.bukkit.Metrics
Expand All @@ -17,25 +17,17 @@ class PluginPortal : JavaPlugin() {
override fun onEnable() {
instance = this

Config.init(this)
twilight(this) {}
Config.init(this)

CommandManager.init()

PPPluginCache.loadInstalledPlugins(
// dataFolder.apply { mkdir() }.parentFile,
// SpigotInstalledPluginLoader.apply {
// loadInstalledPlugins()
// }
)
PPPluginCache.loadInstalledPlugins()

Metrics(this, 18005)
PaperLib.suggestPaper(this)
}

override fun onDisable() {
PPPluginCache.saveInstalledPlugins()
logger.info("PluginPortal has been disabled!")
}
override fun onDisable() { PPPluginCache.saveInstalledPlugins() }

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import gg.flyte.pluginPortal.command.downloadable.UpdateSubCommand
import gg.flyte.pluginPortal.command.info.HelpSubCommand
import gg.flyte.pluginPortal.command.info.InfoSubCommand
import gg.flyte.pluginPortal.command.info.ListSubCommand
import gg.flyte.pluginPortal.command.info.SearchSubCommand
import gg.flyte.pluginPortal.type.manager.PPPluginCache
import gg.flyte.pluginPortal.manager.PPPluginCache
import gg.flyte.twilight.scheduler.async
import net.kyori.adventure.platform.bukkit.BukkitAudiences
import org.bukkit.Bukkit
Expand All @@ -36,7 +35,6 @@ object CommandManager {
HelpSubCommand(),
InfoSubCommand(),
ListSubCommand(),
SearchSubCommand(),
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package gg.flyte.pluginPortal.command.downloadable

import gg.flyte.common.api.API
import gg.flyte.common.api.plugins.schemas.MarketplacePlugin
import gg.flyte.pluginPortal.command.CommandManager
import gg.flyte.pluginPortal.type.extension.sendError
import gg.flyte.pluginPortal.type.extension.sendInfo
import gg.flyte.pluginPortal.type.extension.sendSuccess
import gg.flyte.pluginPortal.type.manager.PPPluginCache
import gg.flyte.pluginPortal.type.manager.PPPluginCache.isInstalled
import gg.flyte.pluginPortal.type.manager.PluginManager
import gg.flyte.pluginPortal.manager.language.sendError
import gg.flyte.pluginPortal.manager.language.sendInfo
import gg.flyte.pluginPortal.manager.language.sendSuccess
import gg.flyte.pluginPortal.manager.PPPluginCache.isInstalled
import gg.flyte.pluginPortal.manager.PluginManager
import net.kyori.adventure.audience.Audience
import revxrsal.commands.annotation.AutoComplete
import revxrsal.commands.annotation.Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ package gg.flyte.pluginPortal.command.downloadable

import gg.flyte.common.api.API
import gg.flyte.common.api.plugins.schemas.InstalledPlugin
import gg.flyte.common.api.plugins.schemas.MarketplacePlugin
import gg.flyte.pluginPortal.command.CommandManager
import gg.flyte.pluginPortal.type.extension.sendError
import gg.flyte.pluginPortal.type.extension.sendInfo
import gg.flyte.pluginPortal.type.extension.sendSuccess
import gg.flyte.pluginPortal.type.manager.PPPluginCache
import gg.flyte.pluginPortal.type.manager.PPPluginCache.isInstalled
import gg.flyte.pluginPortal.type.manager.PluginManager
import gg.flyte.pluginPortal.manager.language.sendError
import gg.flyte.pluginPortal.manager.language.sendInfo
import gg.flyte.pluginPortal.manager.language.sendSuccess
import gg.flyte.pluginPortal.manager.PPPluginCache
import gg.flyte.pluginPortal.manager.PluginManager
import net.kyori.adventure.audience.Audience
import revxrsal.commands.annotation.*
import revxrsal.commands.bukkit.annotation.CommandPermission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ package gg.flyte.pluginPortal.command.info

import gg.flyte.pluginPortal.command.CommandManager
import gg.flyte.pluginPortal.command.info.display.InfoDisplay
import gg.flyte.pluginPortal.type.extension.sendError
import gg.flyte.pluginPortal.type.extension.sendInfo
import gg.flyte.pluginPortal.manager.language.sendError
import gg.flyte.pluginPortal.manager.language.sendInfo
import net.kyori.adventure.audience.Audience
import org.bukkit.Bukkit
import revxrsal.commands.annotation.*
import revxrsal.commands.bukkit.annotation.CommandPermission

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package gg.flyte.pluginPortal.command.info

import gg.flyte.pluginPortal.type.extension.sendInfo
import gg.flyte.pluginPortal.type.manager.PPPluginCache
import gg.flyte.pluginPortal.type.manager.language.Message.toComponent
import gg.flyte.pluginPortal.manager.PPPluginCache
import gg.flyte.twilight.extension.solidLine
import net.kyori.adventure.audience.Audience
import net.kyori.adventure.text.Component
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package gg.flyte.pluginPortal.command.info.display

import gg.flyte.common.api.plugins.schemas.MarketplacePlugin
import gg.flyte.pluginPortal.type.manager.language.Message.serialize
import gg.flyte.pluginPortal.type.manager.language.Message.toComponent
import gg.flyte.pluginPortal.manager.language.Message.serialize
import gg.flyte.pluginPortal.manager.language.Message.toComponent
import gg.flyte.twilight.extension.solidLine
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 gg.flyte.pluginPortal.type.manager
package gg.flyte.pluginPortal.manager

import gg.flyte.pluginPortal.PluginPortal
import org.bukkit.configuration.file.FileConfiguration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gg.flyte.pluginPortal.type.manager
package gg.flyte.pluginPortal.manager

import com.github.benmanes.caffeine.cache.Cache
import com.github.benmanes.caffeine.cache.Caffeine
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package gg.flyte.pluginPortal.type.manager
package gg.flyte.pluginPortal.manager

import gg.flyte.common.api.plugins.schemas.InstalledPlugin
import gg.flyte.common.api.plugins.schemas.MarketplacePlugin
import gg.flyte.common.util.getHashes
import gg.flyte.common.util.pluginApiInterface
import gg.flyte.pluginPortal.type.manager.PPPluginCache.isInstalled
import gg.flyte.pluginPortal.type.manager.PPPluginCache.pluginFolder
import gg.flyte.pluginPortal.type.manager.PPPluginCache.updateFolder
import gg.flyte.pluginPortal.manager.PPPluginCache.isInstalled
import gg.flyte.pluginPortal.manager.PPPluginCache.pluginFolder
import gg.flyte.pluginPortal.manager.PPPluginCache.updateFolder
import gg.flyte.twilight.scheduler.async
import java.io.File

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gg.flyte.pluginPortal.type.manager.language
package gg.flyte.pluginPortal.manager.language

import gg.flyte.pluginPortal.PluginPortal
import gg.flyte.pluginPortal.type.manager.Config
import gg.flyte.pluginPortal.manager.Config
import link.portalbox.pluginportal.type.language.Language
import link.portalbox.pluginportal.type.language.LanguageLoadingException
import net.kyori.adventure.platform.bukkit.BukkitAudiences
Expand Down Expand Up @@ -122,4 +122,5 @@ object Message {

return configString
}
}
}

Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package gg.flyte.pluginPortal.type.extension
package gg.flyte.pluginPortal.manager.language

import gg.flyte.pluginPortal.type.manager.language.Message.toComponent
import gg.flyte.pluginPortal.manager.language.Message.toComponent
import net.kyori.adventure.audience.Audience
import org.bukkit.entity.Player

var prefix = "<bold><gray>[<aqua>PP</aqua>]</gray> <dark_gray>></bold> "

Expand Down

0 comments on commit 2424c6e

Please sign in to comment.