diff --git a/build.gradle.kts b/build.gradle.kts index 8a17028..1da4cb8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } group = "com.github.shynixn" -version = "1.13.0" +version = "1.14.0" repositories { mavenLocal() @@ -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") } @@ -207,7 +207,7 @@ tasks.register("languageFile") { implContents.add("") implContents.add("class MCTennisLanguageImpl : MCTennisLanguage {") implContents.add(" override val names: List\n" + - " get() = listOf(\"en_us\", \"es_es\", \"zh_cn\")") + " get() = listOf(\"en_us\")") for (i in 0 until lines.size) { val key = lines[i] diff --git a/docs/wiki/docs/sign.md b/docs/wiki/docs/sign.md new file mode 100644 index 0000000..95c1f7d --- /dev/null +++ b/docs/wiki/docs/sign.md @@ -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 diff --git a/docs/wiki/mkdocs.yml b/docs/wiki/mkdocs.yml index b57a225..abf08a3 100644 --- a/docs/wiki/mkdocs.yml +++ b/docs/wiki/mkdocs.yml @@ -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 diff --git a/src/main/kotlin/com/github/shynixn/mctennis/MCTennisLanguageImpl.kt b/src/main/kotlin/com/github/shynixn/mctennis/MCTennisLanguageImpl.kt index 269718e..bb8575e 100644 --- a/src/main/kotlin/com/github/shynixn/mctennis/MCTennisLanguageImpl.kt +++ b/src/main/kotlin/com/github/shynixn/mctennis/MCTennisLanguageImpl.kt @@ -5,7 +5,7 @@ import com.github.shynixn.mctennis.contract.MCTennisLanguage class MCTennisLanguageImpl : MCTennisLanguage { override val names: List - 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.") diff --git a/src/main/kotlin/com/github/shynixn/mctennis/MCTennisPlugin.kt b/src/main/kotlin/com/github/shynixn/mctennis/MCTennisPlugin.kt index f14198e..7c8eb02 100644 --- a/src/main/kotlin/com/github/shynixn/mctennis/MCTennisPlugin.kt +++ b/src/main/kotlin/com/github/shynixn/mctennis/MCTennisPlugin.kt @@ -111,12 +111,12 @@ class MCTennisPlugin : JavaPlugin() { // Service dependencies Bukkit.getServicesManager().register( TennisBallFactory::class.java, - module.getService(), + module.getService(), this, ServicePriority.Normal ) Bukkit.getServicesManager() - .register(GameService::class.java, module.getService(), this, ServicePriority.Normal) + .register(GameService::class.java, module.getService(), this, ServicePriority.Normal) val plugin = this plugin.launch { diff --git a/src/main/kotlin/com/github/shynixn/mctennis/impl/TennisGameImpl.kt b/src/main/kotlin/com/github/shynixn/mctennis/impl/TennisGameImpl.kt index 152c9df..9162617 100644 --- a/src/main/kotlin/com/github/shynixn/mctennis/impl/TennisGameImpl.kt +++ b/src/main/kotlin/com/github/shynixn/mctennis/impl/TennisGameImpl.kt @@ -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 @@ -346,7 +349,7 @@ class TennisGameImpl( } if (!arena.isEnabled) { - sendMessageToPlayers(getPlayers(),language.gameCancelledMessage) + sendMessageToPlayers(getPlayers(), language.gameCancelledMessage) dispose() return } @@ -749,9 +752,13 @@ class TennisGameImpl( } } - private fun sendMessageToPlayers(players: List, languageItem: LanguageItem, vararg params: Any) { + private fun sendMessageToPlayers(players: List, languageItem: LanguageItem, param: Any? = null) { for (player in players) { - player.sendPluginMessage(languageItem, params) + if (param != null) { + player.sendPluginMessage(languageItem, param) + } else { + player.sendPluginMessage(languageItem) + } } } } diff --git a/src/main/resources/plugin-legacy.yml b/src/main/resources/plugin-legacy.yml index 6b240f3..cc7d8ec 100644 --- a/src/main/resources/plugin-legacy.yml +++ b/src/main/resources/plugin-legacy.yml @@ -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 diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 830e172..8be0ed7 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -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 @@ -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