Skip to content

Commit

Permalink
🆙 Updated Stracciatella
Browse files Browse the repository at this point in the history
  • Loading branch information
DasLixou committed May 22, 2022
1 parent c1980af commit 51a09fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ repositories {
}

dependencies {
compileOnly 'com.github.TeamSkyBeach:Stracciatella:6b9d8361f0'
compileOnly 'com.github.TeamSkyBeach:Stracciatella:83d5c9478d'

testImplementation 'com.github.TeamSkyBeach:Stracciatella:6b9d8361f0'
testImplementation 'com.github.TeamSkyBeach:Stracciatella:83d5c9478d'

testImplementation 'org.jetbrains.kotlin:kotlin-test'
}
Expand Down
9 changes: 7 additions & 2 deletions src/main/kotlin/cc/lixou/bedwarsextension/game/BedWarsGame.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import net.minestom.server.utils.time.TimeUnit
import world.cepi.kstom.Manager
import world.cepi.kstom.event.listenOnly


class BedWarsGame : Game() {

companion object {
Expand Down Expand Up @@ -66,7 +65,7 @@ class BedWarsGame : Game() {

var currentState: BedWarsGameState = BedWarsGameState.WAITING

override fun canJoin(newPlayers: Array<Player>): Boolean = (this.players.size + newPlayers.size) >= MAX_PLAYERS
override fun canJoin(newPlayers: Array<Player>): Boolean = (this.players.size + newPlayers.size) >= MAX_PLAYERS && currentState == BedWarsGameState.WAITING

override fun onJoin(joiningPlayer: Player) {
joiningPlayer.inventory.setItemStack(0, ItemStack.of(Material.WOODEN_SWORD))
Expand All @@ -76,4 +75,10 @@ class BedWarsGame : Game() {
leavingPlayer.sendMessage("bye bye")
}

override fun shouldClose(): Boolean = this.players.size == 0

override fun onClose() {

}

}

0 comments on commit 51a09fd

Please sign in to comment.