Skip to content

Commit

Permalink
updated astralibs
Browse files Browse the repository at this point in the history
  • Loading branch information
makeevrserg committed Sep 17, 2023
1 parent 0fc7559 commit 6006f95
Show file tree
Hide file tree
Showing 32 changed files with 68 additions and 127 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ makeevrserg.java.ktarget=17
# Project
makeevrserg.project.name=AspeKt
makeevrserg.project.group=ru.astrainteractive.aspekt
makeevrserg.project.version.string=2.6.5
makeevrserg.project.version.string=2.7.0-RC1
makeevrserg.project.description=Essentials plugin for EmpireProjekt
makeevrserg.project.developers=makeevrserg|Makeev Roman|[email protected]
makeevrserg.project.url=https://empireprojekt.ru
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ minecraft-protocollib = "4.8.0"
minecraft-wg = "7.0.7"
minecraft-vault = "1.7"
minecraft-coreprotect = "21.2"
minecraft-astralibs = "2.9.0"
minecraft-astralibs = "2.11.0"
minecraft-bstats = "3.0.0"
minecraft-mockbukkit = "v1.19-SNAPSHOT"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ru.astrainteractive.aspekt.di.impl.RootModuleImpl
import ru.astrainteractive.aspekt.event.EventHandler
import ru.astrainteractive.aspekt.event.di.EventsModule
import ru.astrainteractive.astralibs.async.PluginScope
import ru.astrainteractive.astralibs.events.GlobalEventListener
import ru.astrainteractive.astralibs.event.GlobalEventListener
import ru.astrainteractive.astralibs.menu.event.GlobalInventoryClickEvent
import ru.astrainteractive.klibs.kdi.getValue

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class AdminPrivateRepositoryImpl(
this[chunk.uniqueWorldKey] = chunk
}
)
fileManager.configFile.writeText(ConfigLoader().defaultYaml.encodeToString(newRootConfig))
fileManager.configFile.writeText(ConfigLoader().yaml.encodeToString(newRootConfig))
}

override suspend fun deleteChunk(chunk: AdminChunk) = withContext(limitedDispatcher) {
Expand All @@ -47,6 +47,6 @@ class AdminPrivateRepositoryImpl(
remove(chunk.uniqueWorldKey)
}
)
fileManager.configFile.writeText(ConfigLoader().defaultYaml.encodeToString(newRootConfig))
fileManager.configFile.writeText(ConfigLoader().yaml.encodeToString(newRootConfig))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import org.bukkit.entity.Player
import ru.astrainteractive.aspekt.adminprivate.models.ChunkFlag
import ru.astrainteractive.aspekt.adminprivate.util.adminChunk
import ru.astrainteractive.aspekt.plugin.PluginPermission
import ru.astrainteractive.astralibs.commands.registerCommand
import ru.astrainteractive.astralibs.commands.registerTabCompleter
import ru.astrainteractive.astralibs.utils.hex
import ru.astrainteractive.astralibs.utils.withEntry
import ru.astrainteractive.astralibs.command.registerCommand
import ru.astrainteractive.astralibs.command.registerTabCompleter
import ru.astrainteractive.astralibs.util.hex
import ru.astrainteractive.astralibs.util.withEntry

/**
* /adminprivate claim
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package ru.astrainteractive.aspekt.command
import org.bukkit.entity.ItemFrame
import org.bukkit.entity.Player
import ru.astrainteractive.aspekt.plugin.PluginPermission
import ru.astrainteractive.astralibs.commands.registerCommand
import ru.astrainteractive.astralibs.commands.registerTabCompleter
import ru.astrainteractive.astralibs.command.registerCommand
import ru.astrainteractive.astralibs.command.registerTabCompleter

// atemframe isVisible isFixed radius
fun CommandManager.atemFrameTabCompleter() = plugin.registerTabCompleter("atemframe") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import org.jetbrains.kotlin.tooling.core.UnsafeApi
import ru.astrainteractive.aspekt.gui.EntitiesGui
import ru.astrainteractive.aspekt.plugin.PluginPermission
import ru.astrainteractive.astralibs.async.PluginScope
import ru.astrainteractive.astralibs.commands.registerCommand
import ru.astrainteractive.astralibs.command.registerCommand

fun CommandManager.entities() = plugin.registerCommand("entities") {
if (!PluginPermission.Entities.hasPermission(sender)) return@registerCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ru.astrainteractive.aspekt.command

import org.bukkit.Bukkit
import ru.astrainteractive.aspekt.plugin.PluginPermission
import ru.astrainteractive.astralibs.commands.registerCommand
import ru.astrainteractive.astralibs.command.registerCommand

fun CommandManager.maxOnline() = plugin.registerCommand("maxonline") {
if (!PluginPermission.MaxOnline.hasPermission(sender)) return@registerCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.bukkit.entity.Player
import ru.astrainteractive.aspekt.gui.menu.MenuGui
import ru.astrainteractive.astralibs.commands.registerCommand
import ru.astrainteractive.astralibs.commands.registerTabCompleter
import ru.astrainteractive.astralibs.commands.types.PrimitiveArgumentType
import ru.astrainteractive.astralibs.utils.withEntry
import ru.astrainteractive.astralibs.command.registerCommand
import ru.astrainteractive.astralibs.command.registerTabCompleter
import ru.astrainteractive.astralibs.command.types.PrimitiveArgumentType
import ru.astrainteractive.astralibs.util.withEntry

fun CommandManager.menuCompleter() = plugin.registerTabCompleter("menu") {
when {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ru.astrainteractive.aspekt.command

import ru.astrainteractive.aspekt.plugin.PluginPermission
import ru.astrainteractive.astralibs.commands.registerCommand
import ru.astrainteractive.astralibs.command.registerCommand

/**
* Reload command handler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package ru.astrainteractive.aspekt.command
import com.earth2me.essentials.Essentials
import com.earth2me.essentials.RandomTeleport
import org.bukkit.Bukkit
import ru.astrainteractive.astralibs.commands.registerCommand
import ru.astrainteractive.astralibs.commands.types.PrimitiveArgumentType
import ru.astrainteractive.astralibs.utils.hex
import ru.astrainteractive.astralibs.command.registerCommand
import ru.astrainteractive.astralibs.command.types.PrimitiveArgumentType
import ru.astrainteractive.astralibs.util.hex

fun CommandManager.rtp() = plugin.registerCommand("rtp") {
sender.sendMessage("#db2c18Возможно, вы хотели ввести /tpr".hex())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ru.astrainteractive.aspekt.command

import org.bukkit.entity.Player
import ru.astrainteractive.astralibs.commands.registerCommand
import ru.astrainteractive.astralibs.command.registerCommand

fun CommandManager.sit() = plugin.registerCommand("sit") {
(sender as? Player)?.let(sitController::toggleSitPlayer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package ru.astrainteractive.aspekt.command

import org.bukkit.Bukkit
import ru.astrainteractive.aspekt.plugin.PluginPermission
import ru.astrainteractive.astralibs.commands.registerCommand
import ru.astrainteractive.astralibs.utils.hex
import ru.astrainteractive.astralibs.command.registerCommand
import ru.astrainteractive.astralibs.util.hex

fun CommandManager.tellChat() = plugin.registerCommand("tellchat") {
if (!PluginPermission.TellChat.hasPermission(sender)) return@registerCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import ru.astrainteractive.aspekt.plugin.PluginTranslation
import ru.astrainteractive.astralibs.async.AsyncComponent
import ru.astrainteractive.astralibs.async.BukkitDispatchers
import ru.astrainteractive.astralibs.economy.EconomyProvider
import ru.astrainteractive.astralibs.events.EventListener
import ru.astrainteractive.astralibs.event.EventListener
import ru.astrainteractive.astralibs.filemanager.FileManager
import ru.astrainteractive.astralibs.filemanager.SpigotFileManager
import ru.astrainteractive.astralibs.logging.Logger
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ru.astrainteractive.aspekt.event.sort.SortController
import ru.astrainteractive.aspekt.plugin.PluginConfiguration
import ru.astrainteractive.aspekt.plugin.PluginTranslation
import ru.astrainteractive.astralibs.async.BukkitDispatchers
import ru.astrainteractive.astralibs.events.EventListener
import ru.astrainteractive.astralibs.event.EventListener
import ru.astrainteractive.klibs.kdi.Provider
import ru.astrainteractive.klibs.kdi.Single
import ru.astrainteractive.klibs.kdi.getValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import ru.astrainteractive.aspekt.adminprivate.controller.di.AdminPrivateControl
import ru.astrainteractive.aspekt.command.di.CommandsModule
import ru.astrainteractive.aspekt.di.ControllersModule
import ru.astrainteractive.aspekt.di.RootModule
import ru.astrainteractive.aspekt.di.factories.EconomyProviderFactory
import ru.astrainteractive.aspekt.di.factories.MenuModelFactory
import ru.astrainteractive.aspekt.event.di.EventsModule
import ru.astrainteractive.aspekt.event.discord.DiscordEvent
Expand All @@ -16,8 +15,9 @@ import ru.astrainteractive.aspekt.plugin.PluginConfiguration
import ru.astrainteractive.aspekt.plugin.PluginTranslation
import ru.astrainteractive.astralibs.async.AsyncComponent
import ru.astrainteractive.astralibs.async.DefaultBukkitDispatchers
import ru.astrainteractive.astralibs.economy.AnyEconomyProvider
import ru.astrainteractive.astralibs.economy.EconomyProvider
import ru.astrainteractive.astralibs.events.EventListener
import ru.astrainteractive.astralibs.event.EventListener
import ru.astrainteractive.astralibs.filemanager.DefaultSpigotFileManager
import ru.astrainteractive.astralibs.filemanager.FileManager
import ru.astrainteractive.astralibs.filemanager.SpigotFileManager
Expand Down Expand Up @@ -95,7 +95,7 @@ object RootModuleImpl : RootModule {
}
override val economyProvider: Reloadable<EconomyProvider?> = Reloadable {
runCatching {
EconomyProviderFactory().create()
AnyEconomyProvider(plugin.value)
}.onFailure { it.printStackTrace() }.getOrNull()
}
override val tempFileManager: Reloadable<SpigotFileManager> = Reloadable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import ru.astrainteractive.aspekt.adminprivate.models.ChunkFlag
import ru.astrainteractive.aspekt.adminprivate.util.adminChunk
import ru.astrainteractive.aspekt.event.di.EventsModule
import ru.astrainteractive.aspekt.plugin.PluginPermission
import ru.astrainteractive.astralibs.events.DSLEvent
import ru.astrainteractive.astralibs.event.DSLEvent

class AdminPrivateEvent(
module: EventsModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.bukkit.event.block.Action
import org.bukkit.event.player.PlayerInteractEvent
import org.bukkit.inventory.ItemStack
import ru.astrainteractive.aspekt.event.di.EventsModule
import ru.astrainteractive.astralibs.events.DSLEvent
import ru.astrainteractive.astralibs.event.DSLEvent
import kotlin.random.Random

class AutoCropEvent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import ru.astrainteractive.aspekt.event.sort.SortController
import ru.astrainteractive.aspekt.plugin.PluginConfiguration
import ru.astrainteractive.aspekt.plugin.PluginTranslation
import ru.astrainteractive.astralibs.async.BukkitDispatchers
import ru.astrainteractive.astralibs.events.EventListener
import ru.astrainteractive.astralibs.event.EventListener
import ru.astrainteractive.klibs.kdi.Module

interface EventsModule : Module {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import github.scarsz.discordsrv.util.DiscordUtil
import org.bukkit.Bukkit
import ru.astrainteractive.aspekt.event.discord.controllers.di.RoleControllerModule
import ru.astrainteractive.aspekt.plugin.PluginConfiguration
import ru.astrainteractive.astralibs.utils.uuid
import ru.astrainteractive.astralibs.util.uuid
import java.util.UUID

@Suppress("DuplicatedCode")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import org.bukkit.event.player.PlayerBucketEmptyEvent
import org.jetbrains.kotlin.tooling.core.UnsafeApi
import ru.astrainteractive.aspekt.event.di.EventsModule
import ru.astrainteractive.aspekt.plugin.PluginConfiguration
import ru.astrainteractive.astralibs.events.DSLEvent
import ru.astrainteractive.astralibs.event.DSLEvent
import ru.astrainteractive.klibs.kdi.Provider
import ru.astrainteractive.klibs.kdi.getValue

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.bukkit.event.player.PlayerTeleportEvent
import org.jetbrains.kotlin.tooling.core.UnsafeApi
import org.spigotmc.event.entity.EntityDismountEvent
import ru.astrainteractive.aspekt.event.di.EventsModule
import ru.astrainteractive.astralibs.events.DSLEvent
import ru.astrainteractive.astralibs.event.DSLEvent

class SitEvent(
module: EventsModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.bukkit.event.inventory.InventoryClickEvent
import org.bukkit.event.player.PlayerJoinEvent
import org.bukkit.event.player.PlayerQuitEvent
import ru.astrainteractive.aspekt.event.di.EventsModule
import ru.astrainteractive.astralibs.events.DSLEvent
import ru.astrainteractive.astralibs.event.DSLEvent

class SortEvent(
module: EventsModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import org.jetbrains.kotlin.tooling.core.UnsafeApi
import ru.astrainteractive.aspekt.event.di.EventsModule
import ru.astrainteractive.aspekt.plugin.PluginConfiguration
import ru.astrainteractive.astralibs.async.PluginScope
import ru.astrainteractive.astralibs.events.DSLEvent
import ru.astrainteractive.astralibs.event.DSLEvent
import ru.astrainteractive.klibs.kdi.Provider
import ru.astrainteractive.klibs.kdi.getValue
import kotlin.random.Random
Expand Down
Loading

0 comments on commit 6006f95

Please sign in to comment.