Skip to content

Commit

Permalink
Merge pull request #34 from Shynixn/development
Browse files Browse the repository at this point in the history
Merge changes to master --release
  • Loading branch information
Shynixn authored Jul 22, 2024
2 parents c42a1ed + 64da14c commit 32a85f9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = "com.github.shynixn"
version = "1.6.0"
version = "1.6.1"

repositories {
mavenCentral()
Expand Down Expand Up @@ -40,8 +40,8 @@ dependencies {
// Custom dependencies
implementation("com.github.shynixn.mcutils:common:2024.19")
implementation("com.github.shynixn.mcutils:guice:2024.2")
implementation("com.github.shynixn.mcutils:packet:2024.30")
implementation("com.github.shynixn.mcutils:sign:2024.2")
implementation("com.github.shynixn.mcutils:packet:2024.32")
implementation("com.github.shynixn.mcutils:sign:2024.3")

// Test
testImplementation(kotlin("test"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MCTennisCommandExecutor @Inject constructor(
) {
private val fallBackPrefix: String =
org.bukkit.ChatColor.BLUE.toString() + "[MCTennis] " + org.bukkit.ChatColor.WHITE
private val arenaTabs: suspend (s : CommandSender) -> List<String> = {
private val arenaTabs: suspend (s: CommandSender) -> List<String> = {
arenaRepository.getAll().map { e -> e.name }
}
private val coroutineExecutor = object : CoroutineExecutor {
Expand Down Expand Up @@ -190,49 +190,49 @@ class MCTennisCommandExecutor @Inject constructor(
subCommand("join") {
noPermission()
builder().argument("name").validator(gameMustExistValidator).tabs(arenaTabs)
.executePlayer({MCTennisLanguage.commandSenderHasToBePlayer}) { sender, arena ->
.executePlayer({ MCTennisLanguage.commandSenderHasToBePlayer }) { sender, arena ->
joinGame(
sender, arena.name
)
}.argument("team").validator(teamValidator).tabs { listOf("red", "blue") }
.executePlayer({MCTennisLanguage.commandSenderHasToBePlayer}) { sender, arena, team ->
.executePlayer({ MCTennisLanguage.commandSenderHasToBePlayer }) { sender, arena, team ->
joinGame(sender, arena.name, team)
}
}
subCommand("leave") {
noPermission()
builder().executePlayer({MCTennisLanguage.commandSenderHasToBePlayer}) { sender -> leaveGame(sender) }
builder().executePlayer({ MCTennisLanguage.commandSenderHasToBePlayer }) { sender -> leaveGame(sender) }
}
helpCommand()
subCommand("location") {
permission(Permission.EDIT_GAME)
builder().argument("name").validator(gameMustExistValidator).tabs(arenaTabs)
.argument("type").validator(locationTypeValidator).tabs { LocationType.values().map { e -> e.id } }
.executePlayer({MCTennisLanguage.commandSenderHasToBePlayer}) { player, arena, locationType ->
.executePlayer({ MCTennisLanguage.commandSenderHasToBePlayer }) { player, arena, locationType ->
setLocation(player, arena, locationType)
}
}
subCommand("inventory") {
permission(Permission.EDIT_GAME)
builder().argument("name").validator(gameMustExistValidator).tabs(arenaTabs)
.argument("team").validator(teamMetaValidator).tabs { listOf("red", "blue") }
.executePlayer({MCTennisLanguage.commandSenderHasToBePlayer}) { player, arena, meta ->
.executePlayer({ MCTennisLanguage.commandSenderHasToBePlayer }) { player, arena, meta ->
setInventory(player, arena, meta)
}
}
subCommand("armor") {
permission(Permission.EDIT_GAME)
builder().argument("name").validator(gameMustExistValidator).tabs(arenaTabs)
.argument("team").validator(teamMetaValidator).tabs { listOf("red", "blue") }
.executePlayer({MCTennisLanguage.commandSenderHasToBePlayer}) { player, arena, meta ->
.executePlayer({ MCTennisLanguage.commandSenderHasToBePlayer }) { player, arena, meta ->
setArmor(player, arena, meta)
}
}
subCommand("sign") {
permission(Permission.EDIT_GAME)
builder().argument("name").validator(gameMustExistValidator).tabs(arenaTabs)
.argument("type").validator(signTypeValidator).tabs { listOf("join", "leave") }
.executePlayer({MCTennisLanguage.commandSenderHasToBePlayer}) { player, arena, signType ->
.executePlayer({ MCTennisLanguage.commandSenderHasToBePlayer }) { player, arena, signType ->
setSign(player, arena, signType)
}
}
Expand Down Expand Up @@ -351,7 +351,7 @@ class MCTennisCommandExecutor @Inject constructor(
return
}

if (!player.hasPermission("mctennis.join.${game.arena.name}")) {
if (!player.hasPermission("mctennis.join.${game.arena.name}") && !player.hasPermission("mctennis.join.*")) {
player.sendMessage(MCTennisLanguage.noPermissionForGameMessage.format(game.arena.name))
return
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin-legacy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: MCTennis
version: 1.6.0
version: 1.6.1
author: Shynixn
website: https://www.spigotmc.org/members/shynixn.63455/
main: com.github.shynixn.mctennis.MCTennisPlugin
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: MCTennis
version: 1.6.0
version: 1.6.1
author: Shynixn
website: https://www.spigotmc.org/members/shynixn.63455/
main: com.github.shynixn.mctennis.MCTennisPlugin
Expand Down

0 comments on commit 32a85f9

Please sign in to comment.