Skip to content

Commit

Permalink
Add Party subcommand (faux placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoDog896 committed Dec 11, 2021
1 parent 9609919 commit a80e8f5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/main/kotlin/world/cepi/crews/Crews.kt
Expand Up @@ -2,6 +2,7 @@ package world.cepi.crews

import net.minestom.server.extensions.Extension;
import world.cepi.crews.commands.CrewCommand
import world.cepi.crews.commands.PartyFauxCommand
import world.cepi.crews.events.DropHandler
import world.cepi.kstom.event.listenOnly

Expand All @@ -10,6 +11,7 @@ class Crews : Extension() {
override fun initialize() {

CrewCommand.register()
PartyFauxCommand.register()

eventNode.listenOnly(DropHandler::drop)
eventNode.listenOnly(DropHandler::pickup)
Expand Down
11 changes: 9 additions & 2 deletions src/main/kotlin/world/cepi/crews/commands/CrewCommand.kt
Expand Up @@ -4,6 +4,7 @@ import net.kyori.adventure.text.Component
import net.kyori.adventure.text.event.ClickEvent
import net.kyori.adventure.text.event.HoverEvent
import net.kyori.adventure.text.format.NamedTextColor
import net.minestom.server.entity.Player
import world.cepi.crews.CrewManager
import world.cepi.crews.crew
import world.cepi.crews.data.Crew
Expand All @@ -25,17 +26,23 @@ object CrewCommand : Kommand({

val user = ArgumentPlayer("user")

syntax(create) {
fun createCrew(player: Player) {
if (CrewManager.hasCrew(player)) {
player.sendFormattedTranslatableMessage("crews", "in")
return@syntax
return
}

Crew(player)

player.sendFormattedTranslatableMessage("crews", "create")
}

default { createCrew(player) }

syntax(create) {
createCrew(player)
}

syntax(invite, user) {

if (!CrewManager.hasCrew(player)) {
Expand Down
10 changes: 10 additions & 0 deletions src/main/kotlin/world/cepi/crews/commands/PartyFauxCommand.kt
@@ -0,0 +1,10 @@
package world.cepi.crews.commands

import world.cepi.kepi.messages.sendFormattedTranslatableMessage
import world.cepi.kstom.command.kommand.Kommand

object PartyFauxCommand : Kommand({
default {
sender.sendFormattedTranslatableMessage("crews", "party.default")
}
}, "party")

0 comments on commit a80e8f5

Please sign in to comment.