Skip to content

Commit

Permalink
Bump Minestom
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoDog896 committed May 26, 2022
1 parent bd5645c commit 00a5a40
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ dependencies {
compileOnly(kotlin("reflect"))

// Compile Minestom into project
compileOnly("com.github.Minestom:Minestom:4ee5cbe424")
compileOnly("com.github.Minestom", "Minestom", "7867313290")

// Get KStom
compileOnly("com.github.Project-Cepi:KStom:f962764331")
compileOnly("com.github.Project-Cepi:KStom:82f7000079")

// import kotlinx serialization
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3")

// Add Kepi
compileOnly("com.github.Project-Cepi:Kepi:c31304d5dd")
Expand Down
26 changes: 13 additions & 13 deletions src/main/kotlin/world/cepi/orchestra/command/PlayCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object PlayCommand : Kommand({

val songName = ArgumentType.Word("songName")

syntax(play, songName).onlyPlayers {
syntax(play, songName) {
val file = Orchestra.folderDir.resolve("${context[songName]}.nbs")
if (file.exists()) {

Expand All @@ -46,52 +46,52 @@ object PlayCommand : Kommand({
} else {
player.sendFormattedTranslatableMessage("orchestra", "none", Component.text(context[songName], NamedTextColor.BLUE))
}
}
}.onlyPlayers()

syntax(stop).onlyPlayers {
syntax(stop) {

val song = GlobalSongPlayerManager.remove(player)

if (song == null) {
player.sendFormattedTranslatableMessage("orchestra", "play.none")
return@onlyPlayers
return@syntax
}

song.stop()

player.stopSound(SoundStop.source(Sound.Source.VOICE))

player.sendFormattedTranslatableMessage("orchestra", "stop", Component.text(song.header.name, NamedTextColor.BLUE))
}
}.onlyPlayers()

syntax(pause).onlyPlayers {
syntax(pause) {

val song = GlobalSongPlayerManager[player]

if (song == null) {
player.sendFormattedTranslatableMessage("orchestra", "play.none")
return@onlyPlayers
return@syntax
}

song.stop()

player.sendFormattedTranslatableMessage("orchestra", "pause", Component.text(song.header.name, NamedTextColor.BLUE))
}
}.onlyPlayers()

syntax(resume).onlyPlayers {
syntax(resume) {
val song = GlobalSongPlayerManager[player]

if (song == null) {
player.sendFormattedTranslatableMessage("orchestra", "play.none")
return@onlyPlayers
return@syntax
}

song.resume()

player.sendFormattedTranslatableMessage("orchestra", "resume", Component.text(song.header.name, NamedTextColor.BLUE))
}
}.onlyPlayers()

syntax(tempoLiteral, tempo).onlyPlayers {
syntax(tempoLiteral, tempo) {
GlobalSongPlayerManager[player]?.tempo = !tempo
}
}.onlyPlayers()
}, "orchestra")

0 comments on commit 00a5a40

Please sign in to comment.