Skip to content

Commit

Permalink
refactor: move some classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy0000 committed May 27, 2024
1 parent 5af51a1 commit d7cd224
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mineinabyss.packy.helpers
package com.mineinabyss.packy

import com.mineinabyss.packy.config.packy
import com.mineinabyss.packy.helpers.VanillaPackKeys
import net.kyori.adventure.key.Key
import team.unnamed.creative.ResourcePack
import team.unnamed.creative.atlas.AtlasSource
Expand Down Expand Up @@ -32,7 +33,7 @@ object PackObfuscator {

fun obfuscatePack(resourcePack: ResourcePack) {
packy.logger.i("Obfuscating pack...")
this.resourcePack = resourcePack
PackObfuscator.resourcePack = resourcePack
obfuscatedModels.clear()
obfuscatedTextures.clear()

Expand Down
3 changes: 0 additions & 3 deletions src/main/kotlin/com/mineinabyss/packy/PackyCommands.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ import com.mineinabyss.idofront.commands.extensions.actions.playerAction
import com.mineinabyss.idofront.messaging.error
import com.mineinabyss.idofront.messaging.info
import com.mineinabyss.idofront.messaging.success
import com.mineinabyss.idofront.messaging.warn
import com.mineinabyss.packy.components.packyData
import com.mineinabyss.packy.config.PackyTemplate
import com.mineinabyss.packy.config.packy
import com.mineinabyss.packy.helpers.PackyDownloader
import com.mineinabyss.packy.helpers.PackyServer
import com.mineinabyss.packy.menus.picker.PackyMainMenu
import org.bukkit.command.Command
import org.bukkit.command.CommandSender
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.mineinabyss.packy.helpers
package com.mineinabyss.packy

import com.github.shynixn.mccoroutine.bukkit.asyncDispatcher
import com.github.shynixn.mccoroutine.bukkit.launch
import com.google.gson.JsonParser
import com.mineinabyss.idofront.textcomponents.miniMsg
import com.mineinabyss.packy.config.PackyTemplate
import com.mineinabyss.packy.config.packy
import com.mineinabyss.packy.helpers.downloadZipFromGithubResponse
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import okhttp3.OkHttpClient
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package com.mineinabyss.packy.helpers
package com.mineinabyss.packy

import com.github.shynixn.mccoroutine.bukkit.asyncDispatcher
import com.github.shynixn.mccoroutine.bukkit.launch
import com.mineinabyss.idofront.textcomponents.miniMsg
import com.mineinabyss.packy.components.PackyPack
import com.mineinabyss.packy.config.packy
import com.mineinabyss.packy.helpers.CacheMap
import com.mineinabyss.packy.helpers.TemplateIds
import com.mineinabyss.packy.helpers.readPack
import kotlinx.coroutines.*
import net.kyori.adventure.resource.ResourcePackInfo
import net.minecraft.server.packs.repository.Pack
import team.unnamed.creative.BuiltResourcePack
import team.unnamed.creative.ResourcePack
import team.unnamed.creative.base.Writable
import team.unnamed.creative.serialize.minecraft.MinecraftResourcePackWriter
import team.unnamed.creative.sound.SoundRegistry
import java.util.*
import kotlin.io.path.div
import kotlin.io.path.exists

Expand Down
18 changes: 0 additions & 18 deletions src/main/kotlin/com/mineinabyss/packy/PackyPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,18 @@ import com.charleskorn.kaml.Yaml
import com.charleskorn.kaml.YamlConfiguration
import com.github.shynixn.mccoroutine.bukkit.launch
import com.mineinabyss.geary.autoscan.autoscan
import com.mineinabyss.geary.datatypes.GearyEntity
import com.mineinabyss.geary.helpers.entity
import com.mineinabyss.geary.helpers.temporaryEntity
import com.mineinabyss.geary.modules.geary
import com.mineinabyss.geary.papermc.datastore.decode
import com.mineinabyss.geary.papermc.datastore.remove
import com.mineinabyss.geary.papermc.tracking.entities.gearyMobs
import com.mineinabyss.geary.papermc.tracking.entities.toGeary
import com.mineinabyss.idofront.config.ConfigFormats
import com.mineinabyss.idofront.config.Format
import com.mineinabyss.idofront.config.config
import com.mineinabyss.idofront.di.DI
import com.mineinabyss.idofront.entities.toOfflinePlayer
import com.mineinabyss.idofront.messaging.broadcastVal
import com.mineinabyss.idofront.messaging.logVal
import com.mineinabyss.idofront.messaging.observeLogger
import com.mineinabyss.idofront.nms.nbt.WrappedPDC
import com.mineinabyss.idofront.nms.nbt.getOfflinePDC
import com.mineinabyss.idofront.plugin.listeners
import com.mineinabyss.idofront.textcomponents.miniMsg
import com.mineinabyss.packy.components.PackyData
import com.mineinabyss.packy.config.*
import com.mineinabyss.packy.helpers.PackyDownloader
import com.mineinabyss.packy.helpers.PackyGenerator
import com.mineinabyss.packy.helpers.PackyServer
import com.mineinabyss.packy.listener.PlayerListener
import com.mineinabyss.packy.listener.TemplateLoadTriggers
import io.netty.channel.Channel
Expand All @@ -39,18 +26,13 @@ import io.netty.channel.ChannelHandlerContext
import io.netty.channel.ChannelPromise
import io.papermc.paper.adventure.PaperAdventure
import io.papermc.paper.network.ChannelInitializeListenerHolder
import io.th0rgal.oraxen.OraxenPlugin
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.yield
import kotlinx.serialization.modules.EmptySerializersModule
import net.kyori.adventure.resource.ResourcePackInfo
import net.minecraft.network.Connection
import net.minecraft.network.protocol.common.ClientboundResourcePackPushPacket
import net.minecraft.network.protocol.common.ServerboundResourcePackPacket
import net.minecraft.network.protocol.configuration.ClientboundFinishConfigurationPacket
import org.bukkit.NamespacedKey
import org.bukkit.entity.Player
import org.bukkit.plugin.java.JavaPlugin
import team.unnamed.creative.ResourcePack
import java.util.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.mineinabyss.packy.helpers
package com.mineinabyss.packy

import com.github.shynixn.mccoroutine.bukkit.launch
import com.github.shynixn.mccoroutine.bukkit.ticks
import com.mineinabyss.idofront.textcomponents.miniMsg
import com.mineinabyss.packy.components.packyData
import com.mineinabyss.packy.config.packy
import com.mineinabyss.packy.helpers.TemplateIds
import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive
import net.kyori.adventure.resource.ResourcePackRequest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.mineinabyss.packy.helpers
package com.mineinabyss.packy

import com.mineinabyss.packy.config.PackyTemplate
import com.mineinabyss.packy.config.packy
import com.mineinabyss.packy.helpers.unzip
import okio.Path.Companion.toPath
import team.unnamed.creative.ResourcePack
import team.unnamed.creative.serialize.minecraft.MinecraftResourcePackWriter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package com.mineinabyss.packy.listener

import com.github.shynixn.mccoroutine.bukkit.launch
import com.mineinabyss.packy.components.packyData
import com.mineinabyss.packy.config.packy
import com.mineinabyss.packy.helpers.PackyServer
import kotlinx.coroutines.delay
import org.bukkit.event.EventHandler
import org.bukkit.event.EventPriority
import org.bukkit.event.Listener
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package com.mineinabyss.packy.listener

import com.mineinabyss.idofront.messaging.*
import com.mineinabyss.idofront.plugin.Plugins
import com.mineinabyss.idofront.plugin.listeners
import com.mineinabyss.idofront.plugin.unregisterListeners
import com.mineinabyss.packy.config.PackyTemplate
import com.mineinabyss.packy.config.packy
import com.mineinabyss.packy.helpers.PackyGenerator
import com.mineinabyss.packy.helpers.PackySquash
import com.mineinabyss.packy.PackyGenerator
import com.mineinabyss.packy.PackySquash
import com.mineinabyss.packy.listener.TemplateLoadTriggers.unregisterTemplateHandlers
import com.ticxo.modelengine.api.events.ModelRegistrationEvent
import com.ticxo.modelengine.api.generator.ModelGenerator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import com.mineinabyss.packy.components.PackyData
import com.mineinabyss.packy.components.packyData
import com.mineinabyss.packy.config.PackyConfig
import com.mineinabyss.packy.config.packy
import com.mineinabyss.packy.helpers.PackyServer
import com.mineinabyss.packy.PackyServer
import kotlinx.coroutines.withContext
import org.bukkit.entity.Player

Expand Down

0 comments on commit d7cd224

Please sign in to comment.