Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andyksaw committed Nov 29, 2024
1 parent 97eb2d9 commit a00e661
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private fun Module.core() {

factory {
ConfigCommand(
plugin = get(),
plugin = get<JavaPlugin>(),
remoteConfig = get(),
)
}
Expand Down Expand Up @@ -382,13 +382,13 @@ private fun Module.builds() {
private fun Module.building() {
factory {
NightVisionCommand(
plugin = get(),
plugin = get<JavaPlugin>(),
)
}

factory {
ItemNameCommand(
plugin = get(),
plugin = get<JavaPlugin>(),
eventBroadcaster = get(),
)
}
Expand All @@ -403,7 +403,7 @@ private fun Module.warps() {

factory {
WarpCommand(
plugin = get(),
plugin = get<JavaPlugin>(),
warpRepository = get(),
server = get(),
)
Expand All @@ -412,30 +412,30 @@ private fun Module.warps() {
factory {
WarpsCommand(
createCommand = WarpCreateCommand(
plugin = get(),
plugin = get<JavaPlugin>(),
warpRepository = get(),
server = get(),
),
deleteCommand = WarpDeleteCommand(
plugin = get(),
plugin = get<JavaPlugin>(),
warpRepository = get(),
server = get(),
),
listCommand = WarpListCommand(
plugin = get(),
plugin = get<JavaPlugin>(),
warpRepository = get(),
remoteConfig = get(),
),
moveCommand = WarpMoveCommand(
plugin = get(),
plugin = get<JavaPlugin>(),
warpRepository = get(),
),
reloadCommand = WarpReloadCommand(
plugin = get(),
plugin = get<JavaPlugin>(),
warpRepository = get(),
),
renameCommand = WarpRenameCommand(
plugin = get(),
plugin = get<JavaPlugin>(),
warpRepository = get(),
),
)
Expand Down Expand Up @@ -539,7 +539,7 @@ private fun Module.bans() {
private fun Module.invisFrames() {
factory {
InvisFrameCommand(
plugin = get(),
plugin = get<JavaPlugin>(),
spigotNamespace = get(),
)
}
Expand Down Expand Up @@ -622,13 +622,13 @@ private fun Module.chat() {
private fun Module.register() {
factory {
RegisterCommand(
plugin = get(),
plugin = get<JavaPlugin>(),
registerHttpService = get<PCBHttp>().register,
)
}
factory {
CodeCommand(
plugin = get(),
plugin = get<JavaPlugin>(),
registerHttpService = get<PCBHttp>().register,
)
}
Expand All @@ -651,7 +651,7 @@ private fun Module.telemetry() {
private fun Module.staffChat() {
factory {
StaffChatCommand(
plugin = get(),
plugin = get<JavaPlugin>(),
server = get(),
remoteConfig = get(),
)
Expand All @@ -673,7 +673,7 @@ private fun Module.groups() {

factory {
SyncCommand(
plugin = get(),
plugin = get<JavaPlugin>(),
eventBroadcaster = get(),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import com.projectcitybuild.pcbridge.paper.core.support.spigot.SpigotTimer
import com.projectcitybuild.pcbridge.paper.architecture.listeners.ExceptionListener
import com.projectcitybuild.pcbridge.paper.core.support.brigadier.extensions.register
import com.projectcitybuild.pcbridge.webserver.HttpServer
import io.papermc.paper.plugin.lifecycle.event.LifecycleEventManager
import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents
import net.kyori.adventure.platform.bukkit.BukkitAudiences
import org.bukkit.plugin.java.JavaPlugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ import io.papermc.paper.command.brigadier.CommandSourceStack
* registered with Brigadier
*/
interface BrigadierCommand {
val description: String?
get() = null

fun buildLiteral(): LiteralCommandNode<CommandSourceStack>
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import com.projectcitybuild.pcbridge.paper.core.support.brigadier.BrigadierComma
import io.papermc.paper.command.brigadier.Commands

fun Commands.register(vararg commands: BrigadierCommand) = commands.forEach {
register(it.buildLiteral())
register(it.buildLiteral(), it.description)
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class ItemNameCommand(
private val plugin: Plugin,
private val eventBroadcaster: SpigotEventBroadcaster,
) : BrigadierCommand {
override val description: String = "Renames the item currently in your primary hand"

override fun buildLiteral(): LiteralCommandNode<CommandSourceStack> {
return Commands.literal("itemname")
.requiresPermission(PermissionNode.BUILDING_ITEM_RENAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import org.bukkit.potion.PotionEffectType
class NightVisionCommand(
private val plugin: Plugin,
) : BrigadierCommand {
override val description: String = "Toggles night-vision mode"

override fun buildLiteral(): LiteralCommandNode<CommandSourceStack> {
return Commands.literal("nv")
.requiresPermission(PermissionNode.BUILDING_NIGHT_VISION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class BuildVoteCommand(
miniMessage.deserialize("<green>You voted for ${build.name}</green>")
)
plugin.server.broadcast(
miniMessage.deserialize("<gray><pink>❤</pink> ${player.name} voted for build \"<white><click:run_command:'/build ${build.name}'><hover:show_text:'Click to teleport'>${build.name}</hover></click></white>\"</gray>")
miniMessage.deserialize("<gray><red>❤</red> ${player.name} voted for build \"<white><click:run_command:'/build ${build.name}'><hover:show_text:'Click to teleport'>${build.name}</hover></click></white>\"</gray>")
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class WarpCommand(
private val warpRepository: WarpRepository,
private val server: Server,
) : BrigadierCommand {
override val description: String = "Teleports to a warp"

override fun buildLiteral(): LiteralCommandNode<CommandSourceStack> {
return Commands.literal("warp")
.requiresPermission(PermissionNode.WARP_TELEPORT)
Expand Down
2 changes: 1 addition & 1 deletion pcbridge-paper/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ main: com.projectcitybuild.pcbridge.paper.Plugin
website: https://github.com/projectcitybuild/PCBridge
author: Andy
version: 6.4.0
api-version: 1.20
api-version: 1.21.1

softdepend:
- LuckPerms
Expand Down

0 comments on commit a00e661

Please sign in to comment.