Skip to content

Commit

Permalink
#74 Updated to release version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shynixn committed Jan 24, 2025
1 parent 943fbc7 commit 9c3342c
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 15 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.13.0"
version = "1.14.0"

repositories {
mavenLocal()
Expand All @@ -30,7 +30,7 @@ dependencies {

// Custom dependencies
implementation("com.github.shynixn.mcutils:common:2025.3")
implementation("com.github.shynixn.mcutils:packet:2025.2")
implementation("com.github.shynixn.mcutils:packet:2025.3")
implementation("com.github.shynixn.mcutils:sign:2025.1")
}

Expand Down Expand Up @@ -207,7 +207,7 @@ tasks.register("languageFile") {
implContents.add("")
implContents.add("class MCTennisLanguageImpl : MCTennisLanguage {")
implContents.add(" override val names: List<String>\n" +
" get() = listOf(\"en_us\", \"es_es\", \"zh_cn\")")
" get() = listOf(\"en_us\")")

for (i in 0 until lines.size) {
val key = lines[i]
Expand Down
31 changes: 31 additions & 0 deletions docs/wiki/docs/sign.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Signs

This page explains how to create signs for joining and leave.

### Create a join sign

* Place a new sign in your world
* Execute the following command:

```
/mctennis sign game1 join
```

* Rightclick on a sign
* This sign simply executes the ``/mctennis join`` command on behalf of the player. You can create team join signs by searching for the created sign in your ``game1.yml`` and editing the command to e.g. ``/mctennis join red``

### Create a leave sign

* Place a new sign in your world
* Execute the following command:

```
/mctennis sign game1 leave
```

* Rightclick on a sign
* This sign simply executes the ``/mctennis leave`` command on behalf of the player.

### Removing a sign

* Simply destroy the sign with your hand
1 change: 1 addition & 0 deletions docs/wiki/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ nav:
- Permission: permission.md
- Creating the game: game.md
- Interactions: interaction.md
- Signs: sign.md
- Bedrock: bedrock.md
- Commands: commands.md
- PlaceHolders: placeholders.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.github.shynixn.mctennis.contract.MCTennisLanguage

class MCTennisLanguageImpl : MCTennisLanguage {
override val names: List<String>
get() = listOf("en_us", "es_es", "zh_cn")
get() = listOf("en_us")
override var gameStartingMessage = LanguageItem("[&9MCTennis&f] Game is starting in %1$1d seconds.")

override var gameStartCancelledMessage = LanguageItem("[&9MCTennis&f] Game start has been cancelled.")
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/github/shynixn/mctennis/MCTennisPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ class MCTennisPlugin : JavaPlugin() {
// Service dependencies
Bukkit.getServicesManager().register(
TennisBallFactory::class.java,
module.getService(),
module.getService<TennisBallFactory>(),
this,
ServicePriority.Normal
)
Bukkit.getServicesManager()
.register(GameService::class.java, module.getService(), this, ServicePriority.Normal)
.register(GameService::class.java, module.getService<GameService>(), this, ServicePriority.Normal)

val plugin = this
plugin.launch {
Expand Down
15 changes: 11 additions & 4 deletions src/main/kotlin/com/github/shynixn/mctennis/impl/TennisGameImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import com.github.shynixn.mccoroutine.bukkit.launch
import com.github.shynixn.mccoroutine.bukkit.minecraftDispatcher
import com.github.shynixn.mccoroutine.bukkit.ticks
import com.github.shynixn.mctennis.MCTennisPlugin
import com.github.shynixn.mctennis.contract.*
import com.github.shynixn.mctennis.contract.MCTennisLanguage
import com.github.shynixn.mctennis.contract.TennisBall
import com.github.shynixn.mctennis.contract.TennisBallFactory
import com.github.shynixn.mctennis.contract.TennisGame
import com.github.shynixn.mctennis.entity.PlayerData
import com.github.shynixn.mctennis.entity.TeamMetadata
import com.github.shynixn.mctennis.entity.TennisArena
Expand Down Expand Up @@ -346,7 +349,7 @@ class TennisGameImpl(
}

if (!arena.isEnabled) {
sendMessageToPlayers(getPlayers(),language.gameCancelledMessage)
sendMessageToPlayers(getPlayers(), language.gameCancelledMessage)
dispose()
return
}
Expand Down Expand Up @@ -749,9 +752,13 @@ class TennisGameImpl(
}
}

private fun sendMessageToPlayers(players: List<Player>, languageItem: LanguageItem, vararg params: Any) {
private fun sendMessageToPlayers(players: List<Player>, languageItem: LanguageItem, param: Any? = null) {
for (player in players) {
player.sendPluginMessage(languageItem, params)
if (param != null) {
player.sendPluginMessage(languageItem, param)
} else {
player.sendPluginMessage(languageItem)
}
}
}
}
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.13.0
version: 1.14.0
author: Shynixn
website: https://www.spigotmc.org/members/shynixn.63455/
main: com.github.shynixn.mctennis.MCTennisPlugin
Expand Down
5 changes: 1 addition & 4 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: MCTennis
version: 1.13.0
version: 1.14.0
author: Shynixn
website: https://www.spigotmc.org/members/shynixn.63455/
main: com.github.shynixn.mctennis.MCTennisPlugin
Expand All @@ -8,8 +8,5 @@ api-version: 1.13
libraries:
- com.github.shynixn.mccoroutine:mccoroutine-bukkit-api:2.20.0
- com.github.shynixn.mccoroutine:mccoroutine-bukkit-core:2.20.0
- com.google.inject:guice:7.0.0
- com.google.code.gson:gson:2.10.1
- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.25
- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3
- aopalliance:aopalliance:1.0

0 comments on commit 9c3342c

Please sign in to comment.