Skip to content

Commit

Permalink
misc: renamed package
Browse files Browse the repository at this point in the history
  • Loading branch information
4drian3d committed Mar 12, 2023
1 parent 2e7b03b commit 45346e5
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 62 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ tasks {
"io.leangen.geantyref",
"org.bstats"
).forEach {
relocate(it, "me.adrianed.clientcatcher.libs.$it")
relocate(it, "io.github._4drian3d.clientcatcher.libs.$it")
}
}
compileKotlin {
Expand All @@ -52,7 +52,7 @@ tasks {
}

blossom {
replaceTokenIn("src/main/kotlin/me/adrianed/clientcatcher/Constants.kt")
replaceTokenIn("src/main/kotlin/io/github/_4drian3d/clientcatcher/Constants.kt")
replaceToken("{version}", project.version)
replaceToken("{configurate}", libs.versions.configurate.get())
replaceToken("{geantyref}", libs.versions.geantyref.get())
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
group = net.adrianed.clientcatcher
version = 3.0.0
group = io.github._4drian3d
version = 3.1.0-SNAPSHOT
description = A simple Velocity plugin to catch the client version
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.adrianed.clientcatcher
package io.github._4drian3d.clientcatcher

import com.google.inject.Inject
import com.velocitypowered.api.command.CommandManager
Expand All @@ -11,12 +11,12 @@ import com.velocitypowered.api.plugin.PluginManager
import com.velocitypowered.api.plugin.annotation.DataDirectory
import com.velocitypowered.api.proxy.ProxyServer

import me.adrianed.clientcatcher.command.register
import me.adrianed.clientcatcher.configuration.Configuration
import me.adrianed.clientcatcher.configuration.Messages
import me.adrianed.clientcatcher.configuration.load
import me.adrianed.clientcatcher.listener.BrandListener
import me.adrianed.clientcatcher.listener.ModListener
import io.github._4drian3d.clientcatcher.command.register
import io.github._4drian3d.clientcatcher.configuration.Configuration
import io.github._4drian3d.clientcatcher.configuration.Messages
import io.github._4drian3d.clientcatcher.configuration.load
import io.github._4drian3d.clientcatcher.listener.BrandListener
import io.github._4drian3d.clientcatcher.listener.ModListener
import org.bstats.velocity.Metrics
import org.slf4j.Logger
import java.nio.file.Path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.adrianed.clientcatcher
package io.github._4drian3d.clientcatcher

class Constants {
companion object {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.adrianed.clientcatcher
package io.github._4drian3d.clientcatcher

import net.kyori.adventure.text.minimessage.MiniMessage
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package me.adrianed.clientcatcher
package io.github._4drian3d.clientcatcher

import com.velocitypowered.api.plugin.PluginManager
import net.byteflux.libby.Library
import org.slf4j.Logger
import java.nio.file.Path
import net.byteflux.libby.VelocityLibraryManager
import net.byteflux.libby.relocation.Relocation
import org.slf4j.Logger
import java.nio.file.Path

fun loadDependencies(
plugin: ClientCatcher,
Expand All @@ -16,11 +16,11 @@ fun loadDependencies(
val libraryManager = VelocityLibraryManager(logger, path, manager, plugin, "libs")
val configurateRelocation = Relocation(
"org{}spongepowered",
"me.adrianed.clientcatcher.libs.org{}spongepowered"
"io.github._4drian3d.clientcatcher.libs.org{}spongepowered"
)
val geantyrefRelocation = Relocation(
"io{}leangen{}geantyref",
"me.adrianed.clientcatcher.libs.io{}leangen{}geantyref"
"io.github._4drian3d.clientcatcher.libs.io{}leangen{}geantyref"
)
val hocon = Library.builder()
.groupId("org{}spongepowered")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.adrianed.clientcatcher
package io.github._4drian3d.clientcatcher

import com.velocitypowered.api.proxy.Player
import com.velocitypowered.api.proxy.ProxyServer
Expand Down Expand Up @@ -30,6 +30,6 @@ fun registerExpansion(proxyServer: ProxyServer) {
}.register()
}

fun ArgumentQueue.player(proxyServer: ProxyServer): Player? =
private fun ArgumentQueue.player(proxyServer: ProxyServer): Player? =
proxyServer.getPlayer(popOr("You need to provide a Player Name").value()).getOrNull()

Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package me.adrianed.clientcatcher.command
package io.github._4drian3d.clientcatcher.command

import com.mojang.brigadier.Command
import com.mojang.brigadier.arguments.StringArgumentType.*
import com.mojang.brigadier.arguments.StringArgumentType.getString
import com.mojang.brigadier.arguments.StringArgumentType.word
import com.mojang.brigadier.builder.LiteralArgumentBuilder.literal
import com.mojang.brigadier.builder.RequiredArgumentBuilder.argument
import com.velocitypowered.api.command.BrigadierCommand
import com.velocitypowered.api.command.CommandManager
import com.velocitypowered.api.command.CommandSource
import me.adrianed.clientcatcher.ClientCatcher
import me.adrianed.clientcatcher.asMiniMessage
import io.github._4drian3d.clientcatcher.ClientCatcher
import io.github._4drian3d.clientcatcher.asMiniMessage
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder
import kotlin.jvm.optionals.getOrNull

fun register(manager: CommandManager, plugin: ClientCatcher) {
val command = BrigadierCommand(literal<CommandSource>("clientcatcher")
Expand Down Expand Up @@ -67,31 +69,29 @@ fun register(manager: CommandManager, plugin: ClientCatcher) {
playerArgument()
.executes { ctx ->
val name = getString(ctx, "player")
plugin.proxyServer.getPlayer(name)
.ifPresentOrElse({ player ->
ctx.source.sendMessage(
with(plugin.messages.command.mods) {
if (player.modInfo.isPresent) found.asMiniMessage(
Placeholder.unparsed("player", player.username),
Placeholder.unparsed("mods",
player.modInfo.get().mods.joinToString(", ") { "${it.id}:${it.version}" })
)
else notFound.asMiniMessage(
Placeholder.unparsed(
"player",
player.username
)
plugin.proxyServer.getPlayer(name).getOrNull()?.let { player ->
ctx.source.sendMessage(
with(plugin.messages.command.mods) {
if (player.modInfo.isPresent) found.asMiniMessage(
Placeholder.unparsed("player", player.username),
Placeholder.unparsed("mods",
player.modInfo.get().mods.joinToString(", ") { "${it.id}:${it.version}" })
)
else notFound.asMiniMessage(
Placeholder.unparsed(
"player",
player.username
)
}
)

}, {
ctx.source.sendMessage(
plugin.messages.command.unknownPlayer.asMiniMessage(
Placeholder.unparsed("name", name)
)
}
)
} ?: {
ctx.source.sendMessage(
plugin.messages.command.unknownPlayer.asMiniMessage(
Placeholder.unparsed("name", name)
)
})
)
}
Command.SINGLE_SUCCESS
}
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.adrianed.clientcatcher.configuration
package io.github._4drian3d.clientcatcher.configuration

import org.spongepowered.configurate.objectmapping.ConfigSerializable
import org.spongepowered.configurate.objectmapping.meta.Comment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.adrianed.clientcatcher.configuration
package io.github._4drian3d.clientcatcher.configuration

import org.spongepowered.configurate.hocon.HoconConfigurationLoader
import org.spongepowered.configurate.kotlin.dataClassFieldDiscoverer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.adrianed.clientcatcher.configuration
package io.github._4drian3d.clientcatcher.configuration

import org.spongepowered.configurate.objectmapping.ConfigSerializable
import org.spongepowered.configurate.objectmapping.meta.Comment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.adrianed.clientcatcher.event
package io.github._4drian3d.clientcatcher.event

import com.velocitypowered.api.proxy.Player

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.adrianed.clientcatcher.event
package io.github._4drian3d.clientcatcher.event

import com.velocitypowered.api.util.ModInfo
import com.velocitypowered.api.proxy.Player
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package me.adrianed.clientcatcher.listener
package io.github._4drian3d.clientcatcher.listener

import com.velocitypowered.api.event.Continuation
import com.velocitypowered.api.event.Subscribe
import com.velocitypowered.api.event.player.PlayerClientBrandEvent
import me.adrianed.clientcatcher.ClientCatcher
import me.adrianed.clientcatcher.asMiniMessage
import me.adrianed.clientcatcher.event.BlockedClientEvent
import me.adrianed.clientcatcher.objects.CatcherCommandSource
import io.github._4drian3d.clientcatcher.ClientCatcher
import io.github._4drian3d.clientcatcher.asMiniMessage
import io.github._4drian3d.clientcatcher.event.BlockedClientEvent
import io.github._4drian3d.clientcatcher.objects.CatcherCommandSource
import net.kyori.adventure.permission.PermissionChecker
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package me.adrianed.clientcatcher.listener
package io.github._4drian3d.clientcatcher.listener

import com.velocitypowered.api.event.Continuation
import com.velocitypowered.api.event.Subscribe
import com.velocitypowered.api.event.player.PlayerModInfoEvent
import me.adrianed.clientcatcher.ClientCatcher
import me.adrianed.clientcatcher.asMiniMessage
import me.adrianed.clientcatcher.event.BlockedModEvent
import me.adrianed.clientcatcher.objects.CatcherCommandSource
import io.github._4drian3d.clientcatcher.ClientCatcher
import io.github._4drian3d.clientcatcher.asMiniMessage
import io.github._4drian3d.clientcatcher.event.BlockedModEvent
import io.github._4drian3d.clientcatcher.objects.CatcherCommandSource
import net.kyori.adventure.permission.PermissionChecker
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.adrianed.clientcatcher.objects
package io.github._4drian3d.clientcatcher.objects

import com.velocitypowered.api.command.CommandSource
import com.velocitypowered.api.permission.Tristate
Expand Down

0 comments on commit 45346e5

Please sign in to comment.