Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
powercasgamer committed Dec 2, 2023
1 parent 2308fd3 commit 0f93095
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 56 deletions.
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/common-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ tasks {
}

create("format") {

dependsOn("spotlessApply")
}

withType<JavaCompile>().configureEach {
Expand Down
28 changes: 0 additions & 28 deletions build-logic/src/main/kotlin/task/ReleaseTask.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
* This file is part of TimeTriggeredPerms, licensed under the MIT License.
*
* Copyright (c) 2023 powercas_gamer
* Copyright (c) 2023 contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package dev.mizule.timetriggeredperms.core.config

import org.spongepowered.configurate.kotlin.extensions.get
Expand Down Expand Up @@ -36,4 +60,4 @@ class ConfigManager {
return config
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
/*
* This file is part of TimeTriggeredPerms, licensed under the MIT License.
*
* Copyright (c) 2023 powercas_gamer
* Copyright (c) 2023 contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package dev.mizule.timetriggeredperms.velocity

import com.google.inject.Inject
import com.velocitypowered.api.event.PostOrder
import com.velocitypowered.api.event.Subscribe
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent
import com.velocitypowered.api.plugin.Dependency
import com.velocitypowered.api.plugin.Plugin
import com.velocitypowered.api.plugin.annotation.DataDirectory
import com.velocitypowered.api.proxy.ProxyServer
import dev.mizule.timetriggeredperms.core.TTPPlugin
import dev.mizule.timetriggeredperms.core.config.Config
import dev.mizule.timetriggeredperms.core.config.ConfigManager
import dev.mizule.timetriggeredperms.velocity.listener.LuckPermsListener
import org.bstats.velocity.Metrics
import org.slf4j.Logger
import xyz.jpenilla.gremlin.runtime.DependencyCache
import xyz.jpenilla.gremlin.runtime.DependencyResolver
import xyz.jpenilla.gremlin.runtime.DependencySet
import xyz.jpenilla.gremlin.runtime.platformsupport.VelocityClasspathAppender
import java.nio.file.Path


class TTP @Inject constructor(
logger: Logger,
val proxy: ProxyServer,
val dataPath: Path
private val logger: Logger,
private val proxy: ProxyServer,
private val dataPath: Path,
) : TTPPlugin<PluginLoader> {

private val configPath = dataPath.resolve("permissions.yml")
Expand All @@ -40,6 +52,6 @@ class TTP @Inject constructor(
}

override fun plugin(): PluginLoader {
return PluginLoader.instance;
return PluginLoader.instance
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ class LuckPermsListener(private val plugin: TTPPlugin<PluginLoader>) : AbstractL
val configNode = nodeConfig(permissionNode.permission)
val isUser = event.isUser

configNode.commands.forEach { command ->
val name = event.target.friendlyName
val uuid = if (isUser) (event.target as User).uniqueId.toString() else ""
val formattedCommand = command
.replace("%name%", name)
.replace("%uuid%", uuid)
.replace("%permission%", permissionNode.permission)

proxy.commandManager.executeAsync(proxy.consoleCommandSource, formattedCommand)
configNode.commands.forEach { command ->
val name = event.target.friendlyName
val uuid = if (isUser) (event.target as User).uniqueId.toString() else ""
val formattedCommand = command
.replace("%name%", name)
.replace("%uuid%", uuid)
.replace("%permission%", permissionNode.permission)

proxy.commandManager.executeAsync(proxy.consoleCommandSource, formattedCommand)
}
}

Expand Down

0 comments on commit 0f93095

Please sign in to comment.