From fdd2e01ad3a2117b8a1058c3d27ccfe1540631da Mon Sep 17 00:00:00 2001 From: Shynixn Date: Tue, 17 Sep 2024 18:03:48 +0200 Subject: [PATCH] #552 Fixed ball spawning in minigame lobbies. --- build.gradle.kts | 6 +++--- .../com/github/shynixn/blockball/impl/SoccerMiniGameImpl.kt | 1 + .../impl/service/DependencyPlaceHolderServiceImpl.kt | 6 ++++-- .../shynixn/blockball/impl/service/GameServiceImpl.kt | 4 +++- src/main/resources/plugin-legacy.yml | 2 +- src/main/resources/plugin.yml | 2 +- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 070d0cc15..2fe093323 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } group = "com.github.shynixn" -version = "7.3.0" +version = "7.3.1" repositories { mavenLocal() @@ -26,7 +26,7 @@ tasks.register("printVersion") { dependencies { // Compile Only - compileOnly("me.clip:placeholderapi:2.9.2") + compileOnly("me.clip:placeholderapi:2.11.6") compileOnly("org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT") // Library dependencies with legacy compatibility, we can use more up-to-date version in the plugin.yml @@ -42,7 +42,7 @@ dependencies { // Custom dependencies implementation("com.github.shynixn.mcutils:common:2024.23") - implementation("com.github.shynixn.mcutils:packet:2024.33") + implementation("com.github.shynixn.mcutils:packet:2024.38") implementation("com.github.shynixn.mcutils:database:2024.2") implementation("com.github.shynixn.mcutils:sign:2024.3") implementation("com.github.shynixn.mcutils:guice:2024.2") diff --git a/src/main/java/com/github/shynixn/blockball/impl/SoccerMiniGameImpl.kt b/src/main/java/com/github/shynixn/blockball/impl/SoccerMiniGameImpl.kt index 756eb1585..9caf9d52c 100644 --- a/src/main/java/com/github/shynixn/blockball/impl/SoccerMiniGameImpl.kt +++ b/src/main/java/com/github/shynixn/blockball/impl/SoccerMiniGameImpl.kt @@ -156,6 +156,7 @@ class SoccerMiniGameImpl constructor( playing = true status = GameState.RUNNING matchTimeIndex = -1 + ballEnabled = true switchToNextMatchTime() } } diff --git a/src/main/java/com/github/shynixn/blockball/impl/service/DependencyPlaceHolderServiceImpl.kt b/src/main/java/com/github/shynixn/blockball/impl/service/DependencyPlaceHolderServiceImpl.kt index 17bf4c59c..82c3285cd 100644 --- a/src/main/java/com/github/shynixn/blockball/impl/service/DependencyPlaceHolderServiceImpl.kt +++ b/src/main/java/com/github/shynixn/blockball/impl/service/DependencyPlaceHolderServiceImpl.kt @@ -1,3 +1,5 @@ +@file:Suppress("UselessCallOnNotNull") + package com.github.shynixn.blockball.impl.service import com.github.shynixn.blockball.contract.SoccerGame @@ -58,8 +60,8 @@ class DependencyPlaceHolderServiceImpl @Inject constructor( return "blockball" } - override fun onPlaceholderRequest(player: Player?, params: String?): String? { - if (params == null) { + override fun onPlaceholderRequest(player: Player?, params: String): String? { + if (params.isNullOrBlank()) { return null } diff --git a/src/main/java/com/github/shynixn/blockball/impl/service/GameServiceImpl.kt b/src/main/java/com/github/shynixn/blockball/impl/service/GameServiceImpl.kt index 8f3dcc16d..b167770cc 100644 --- a/src/main/java/com/github/shynixn/blockball/impl/service/GameServiceImpl.kt +++ b/src/main/java/com/github/shynixn/blockball/impl/service/GameServiceImpl.kt @@ -118,7 +118,9 @@ class GameServiceImpl @Inject constructor( scoreboardService, commandService, soccerBallFactory - ) + ).also { + it.ballEnabled = false + } } games.add(game) diff --git a/src/main/resources/plugin-legacy.yml b/src/main/resources/plugin-legacy.yml index 1ac5deb7b..43f6b2cb5 100644 --- a/src/main/resources/plugin-legacy.yml +++ b/src/main/resources/plugin-legacy.yml @@ -1,5 +1,5 @@ name: BlockBall -version: 7.3.0 +version: 7.3.1 author: Shynixn website: https://www.spigotmc.org/members/shynixn.63455/ main: com.github.shynixn.blockball.BlockBallPlugin diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 70d56fff5..281a1018e 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: BlockBall -version: 7.3.0 +version: 7.3.1 author: Shynixn website: https://www.spigotmc.org/members/shynixn.63455/ main: com.github.shynixn.blockball.BlockBallPlugin