From 95c5370b1a0b049b3b6528b747e8e18f914eeec8 Mon Sep 17 00:00:00 2001 From: Shynixn Date: Fri, 29 Nov 2024 19:10:41 +0100 Subject: [PATCH] #575,#574 Added spam click protection and new language file format. --- build.gradle.kts | 99 +++-- docs/wiki/docs/permission.md | 18 +- .../BlockBallDependencyInjectionModule.kt | 7 +- .../blockball/BlockBallLanguageImpl.kt | 368 ++++++------------ .../shynixn/blockball/BlockBallPlugin.kt | 25 +- .../blockball/contract/BlockBallLanguage.kt | 339 ---------------- .../shynixn/blockball/contract/Language.kt | 190 +++++++++ .../blockball/entity/SoccerBallSettings.kt | 8 +- .../impl/SoccerBallCrossPlatformProxy.kt | 25 ++ .../shynixn/blockball/impl/SoccerGameImpl.kt | 53 +-- .../blockball/impl/SoccerHubGameImpl.kt | 5 +- .../blockball/impl/SoccerMiniGameImpl.kt | 3 +- .../blockball/impl/SoccerRefereeGameImpl.kt | 14 +- .../BlockBallCommandExecutor.kt | 202 +++++----- .../blockball/impl/listener/GameListener.kt | 6 +- .../DependencyPlaceHolderServiceImpl.kt | 8 +- .../blockball/impl/service/GameServiceImpl.kt | 7 +- .../service/HubGameForcefieldServiceImpl.kt | 15 +- .../impl/service/PlaceHolderServiceImpl.kt | 13 +- src/main/resources/arena_sample.yml | 6 +- src/main/resources/lang/en_us.properties | 112 ------ src/main/resources/lang/en_us.yml | 308 +++++++++++++++ src/main/resources/lang/es_es.properties | 90 ----- src/main/resources/lang/es_es.yml | 242 ++++++++++++ 24 files changed, 1120 insertions(+), 1043 deletions(-) delete mode 100644 src/main/java/com/github/shynixn/blockball/contract/BlockBallLanguage.kt create mode 100644 src/main/java/com/github/shynixn/blockball/contract/Language.kt delete mode 100644 src/main/resources/lang/en_us.properties create mode 100644 src/main/resources/lang/en_us.yml delete mode 100644 src/main/resources/lang/es_es.properties create mode 100644 src/main/resources/lang/es_es.yml diff --git a/build.gradle.kts b/build.gradle.kts index 4a339aaee..1d0f86096 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -41,8 +41,8 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2") // Custom dependencies - implementation("com.github.shynixn.mcutils:common:2024.25") - implementation("com.github.shynixn.mcutils:packet:2024.47") + implementation("com.github.shynixn.mcutils:common:2024.38") + implementation("com.github.shynixn.mcutils:packet:2024.49") implementation("com.github.shynixn.mcutils:database:2024.8") implementation("com.github.shynixn.mcutils:sign:2024.3") implementation("com.github.shynixn.mcutils:guice:2024.2") @@ -208,57 +208,70 @@ tasks.register("pluginJarLegacy", ShadowJar::class.java) { tasks.register("languageFile") { val kotlinSrcFolder = project.sourceSets.toList()[0].allJava.srcDirs.first { e -> e.endsWith("java") } + val contractFile = kotlinSrcFolder.resolve("com/github/shynixn/blockball/contract/Language.kt") + val resourceFile = kotlinSrcFolder.parentFile.resolve("resources").resolve("lang").resolve("en_us.yml") + val lines = resourceFile.readLines() - // Contract file - var languageKotlinFile = kotlinSrcFolder.resolve("com/github/shynixn/blockball/contract/BlockBallLanguage.kt") - var resourceFile = kotlinSrcFolder.parentFile.resolve("resources").resolve("lang").resolve("en_us.properties") - var bundle = FileInputStream(resourceFile).use { stream -> - PropertyResourceBundle(stream) - } - - var contents = ArrayList() - contents.add("package com.github.shynixn.blockball.contract") - contents.add("") - contents.add("interface BlockBallLanguage {") - for (key in bundle.keys) { - val value = bundle.getString(key) - contents.add(" /** $value **/") - contents.add(" var ${key} : String") - contents.add("") + val contractContents = ArrayList() + contractContents.add("package com.github.shynixn.blockball.contract") + contractContents.add("") + contractContents.add("import com.github.shynixn.mcutils.common.language.LanguageItem") + contractContents.add("import com.github.shynixn.mcutils.common.language.LanguageProvider") + contractContents.add("") + contractContents.add("interface Language : LanguageProvider {") + for (key in lines) { + if (key.toCharArray()[0].isLetter()) { + contractContents.add(" var ${key} LanguageItem") + contractContents.add("") + } } - contents.removeLast() - contents.add("}") + contractContents.removeLast() + contractContents.add("}") - languageKotlinFile.printWriter().use { out -> - for (line in contents) { + contractFile.printWriter().use { out -> + for (line in contractContents) { out.println(line) } } - // Impl File - languageKotlinFile = kotlinSrcFolder.resolve("com/github/shynixn/blockball/BlockBallLanguageImpl.kt") - resourceFile = kotlinSrcFolder.parentFile.resolve("resources").resolve("lang").resolve("en_us.properties") - bundle = FileInputStream(resourceFile).use { stream -> - PropertyResourceBundle(stream) - } + val implFile = kotlinSrcFolder.resolve("com/github/shynixn/blockball/BlockBallLanguageImpl.kt") + val implContents = ArrayList() + implContents.add("package com.github.shynixn.blockball") + implContents.add("") + implContents.add("import com.github.shynixn.mcutils.common.language.LanguageItem") + implContents.add("import com.github.shynixn.mcutils.common.language.LanguageProviderImpl") + implContents.add("import com.github.shynixn.blockball.contract.Language") + implContents.add("") + implContents.add("class BlockBallLanguageImpl : Language, LanguageProviderImpl() {") + implContents.add(" override val names: List\n" + + " get() = listOf(\"en_us\", \"es_es\")") - contents = ArrayList() - contents.add("package com.github.shynixn.blockball") - contents.add("") - contents.add("import com.github.shynixn.blockball.contract.BlockBallLanguage") - contents.add("") - contents.add("object BlockBallLanguageImpl : BlockBallLanguage {") - for (key in bundle.keys) { - val value = bundle.getString(key) - contents.add(" /** $value **/") - contents.add(" override var ${key} : String = \"$value\"") - contents.add("") + for (i in 0 until lines.size) { + val key = lines[i] + + if (key.toCharArray()[0].isLetter()) { + var text = "" + println(">" + lines[i]) + + println("_") + var j = i + while (true){ + if(lines[j].contains("text:")){ + text = lines[j] + break + } + j++ + } + + implContents.add(" override var ${key.replace(":","")} = LanguageItem(${text.replace(" text: ","")})") + implContents.add("") + } } - contents.removeLast() - contents.add("}") + implContents.removeLast() + implContents.add("}") - languageKotlinFile.printWriter().use { out -> - for (line in contents) { + implFile.printWriter().use { out -> + for (line in implContents) { out.println(line) } } diff --git a/docs/wiki/docs/permission.md b/docs/wiki/docs/permission.md index 875b5bf31..7d3d0b499 100644 --- a/docs/wiki/docs/permission.md +++ b/docs/wiki/docs/permission.md @@ -18,12 +18,12 @@ The following permissions are available in BlockBall. ### All Permissions -| Permission | Level | Description | -|--------------------------|------------|------------------------------------------------------------------------------------------------------| -| blockball.command | User | Allows to use the /blockball command. | -| blockball.join.* | User | Allows to join all games. The **blockball.command** permission is also required. | -| blockball.join.[name] | User | Allows to join a specific game. The **blockball.command** permission is also required. | -| blockball.command.staff | Admin/User | Allows to execute commands while ingame. This permission will be replaced in the future. | -| blockball.game.inventory | Admin/User | Allows open and click in inventories while ingame. This permission will be replaced in the future. | -| blockball.edit | Admin | Allows to create, edit and delete games. | -| blockball.referee.join | Admin | Allows to manipulate games using /blockball referee commands | +| Permission | Level | Description | +|---------------------------|------------|------------------------------------------------------------------------------------------------------| +| blockball.command | User | Allows to use the /blockball command. | +| blockball.join.* | User | Allows to join all games. The **blockball.command** permission is also required. | +| blockball.join.[name] | User | Allows to join a specific game. The **blockball.command** permission is also required. | +| blockball.command.staff | Admin/User | Allows to execute commands while ingame. This permission will be replaced in the future. | +| blockball.game.inventory | Admin/User | Allows open and click in inventories while ingame. This permission will be replaced in the future. | +| blockball.edit | Admin | Allows to create, edit and delete games. | +| blockball.referee.join | Admin | Allows to manipulate games using /blockball referee commands | diff --git a/src/main/java/com/github/shynixn/blockball/BlockBallDependencyInjectionModule.kt b/src/main/java/com/github/shynixn/blockball/BlockBallDependencyInjectionModule.kt index 783fbbdbf..2aa6ba8ca 100644 --- a/src/main/java/com/github/shynixn/blockball/BlockBallDependencyInjectionModule.kt +++ b/src/main/java/com/github/shynixn/blockball/BlockBallDependencyInjectionModule.kt @@ -42,7 +42,8 @@ import org.bukkit.plugin.Plugin import java.util.logging.Level class BlockBallDependencyInjectionModule( - private val plugin: BlockBallPlugin + private val plugin: BlockBallPlugin, + private val language: Language ) : DependencyInjectionModule() { companion object { val areLegacyVersionsIncluded: Boolean by lazy { @@ -60,6 +61,7 @@ class BlockBallDependencyInjectionModule( */ override fun configure() { addService(plugin) + addService(language) // Repositories val arenaRepository = YamlFileRepositoryImpl(plugin, "arena", @@ -84,9 +86,8 @@ class BlockBallDependencyInjectionModule( ) addService>(playerDataRepository) addService>(playerDataRepository) - addService(BlockBallLanguageImpl) addService { - SignServiceImpl(plugin, getService(), BlockBallLanguageImpl.noPermissionMessage) + SignServiceImpl(plugin, getService(),language.noPermissionMessage.text) } // Services diff --git a/src/main/java/com/github/shynixn/blockball/BlockBallLanguageImpl.kt b/src/main/java/com/github/shynixn/blockball/BlockBallLanguageImpl.kt index f68c8d9db..fcee20ae4 100644 --- a/src/main/java/com/github/shynixn/blockball/BlockBallLanguageImpl.kt +++ b/src/main/java/com/github/shynixn/blockball/BlockBallLanguageImpl.kt @@ -1,341 +1,217 @@ package com.github.shynixn.blockball -import com.github.shynixn.blockball.contract.BlockBallLanguage +import com.github.shynixn.mcutils.common.language.LanguageItem +import com.github.shynixn.mcutils.common.language.LanguageProviderImpl +import com.github.shynixn.blockball.contract.Language -object BlockBallLanguageImpl : BlockBallLanguage { - /** &cTeam Red **/ - override var winRedTitle : String = "&cTeam Red" +class BlockBallLanguageImpl : Language, LanguageProviderImpl() { + override val names: List + get() = listOf("en_us", "es_es") + override var gameAlreadyExistsMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&c Game %1$1s already exists.") - /** &0&l[&f&lBlockBall&0&l]&7 Successfully joined team blue. **/ - override var joinTeamBlueMessage : String = "&0&l[&f&lBlockBall&0&l]&7 Successfully joined team blue." + override var commandUsage = + LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Use /blockball help to see more info about the plugin.") - /** &0&l[&f&lBlockBall&0&l]&7 Players can no longer kick the ball. **/ - override var refereeBallDisabled : String = "&0&l[&f&lBlockBall&0&l]&7 Players can no longer kick the ball." + override var commandDescription = LanguageItem("All commands for the BlockBall plugin.") - /** Waiting for the referee to resume the game... **/ - override var whistleTimeOutReferee : String = "Waiting for the referee to resume the game..." + override var maxLength20Characters = + LanguageItem("&0&l[&f&lBlockBall&0&l]&c The text length has to be less than 20 characters.") - /** &0&l[&f&lBlockBall&0&l]&c This selection type is not known. **/ - override var selectionTypeDoesNotExistMessage : String = "&0&l[&f&lBlockBall&0&l]&c This selection type is not known." + override var gameDoesNotExistMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&c Game %1$1s does not exist.") - /** &0&l[&f&lBlockBall&0&l]&7 Successfully joined team referee. **/ - override var joinTeamRefereeMessage : String = "&0&l[&f&lBlockBall&0&l]&7 Successfully joined team referee." + override var teamDoesNotExistMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&c Team %1$1s does not exist.") - /** &0&l[&f&lBlockBall&0&l]&7 Reloaded game %1$1s. **/ - override var reloadedGameMessage : String = "&0&l[&f&lBlockBall&0&l]&7 Reloaded game %1$1s." + override var gameTypeNotExistMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&c GameType %1$1s does not exist.") - /** &0&l[&f&lBlockBall&0&l]&7 A sign was added to the game. **/ - override var addedSignMessage : String = "&0&l[&f&lBlockBall&0&l]&7 A sign was added to the game." + override var selectionTypeDoesNotExistMessage = + LanguageItem("&0&l[&f&lBlockBall&0&l]&c This selection type is not known.") - /** &9Team Blue &ahas won the match **/ - override var winBlueSubTitle : String = "&9Team Blue &ahas won the match" + override var signTypeDoesNotExistMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&c This sign type is not known.") - /** Execute &a/blockball referee startgame &fto start the lobby timer. **/ - override var waitingForRefereeToStartHint : String = "Execute &a/blockball referee startgame &fto start the lobby timer." + override var noPermissionForGameMessage = + LanguageItem("&0&l[&f&lBlockBall&0&l]&c You do not have permission to join game %1$1s.") - /** &0&l[&f&lBlockBall&0&l]&7 Left the game. **/ - override var leftGameMessage : String = "&0&l[&f&lBlockBall&0&l]&7 Left the game." + override var noPermissionMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&c You do not have permission.") - /** &0&l[&f&lBlockBall&0&l]&7 Reloaded all games. **/ - override var reloadedAllGamesMessage : String = "&0&l[&f&lBlockBall&0&l]&7 Reloaded all games." + override var commandSenderHasToBePlayer = + LanguageItem("&0&l[&f&lBlockBall&0&l]&c The command sender has to be a player!") - /** &0&l[&f&lBlockBall&0&l]&7 **/ - override var joinSignLine1 : String = "&0&l[&f&lBlockBall&0&l]&7" + override var gameCreatedMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Created game %1$1s.") - /** %blockball_game_stateDisplayName% **/ - override var joinSignLine2 : String = "%blockball_game_stateDisplayName%" + override var deletedGameMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Deleted game %1$1s.") - /** &1Running **/ - override var gameStatusRunning : String = "&1Running" + override var gameIsFullMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&c Game is already full.") - /** Creates a new arena for a BlockBall game. **/ - override var commandCreateToolTip : String = "Creates a new arena for a BlockBall game." + override var joinTeamRedMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Successfully joined team red.") - /** &0&l[&f&lBlockBall&0&l]&c You do not have permission to join game %1$1s. **/ - override var noPermissionForGameMessage : String = "&0&l[&f&lBlockBall&0&l]&c You do not have permission to join game %1$1s." + override var joinTeamBlueMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Successfully joined team blue.") - /** &0&l[&f&lBlockBall&0&l]&7 Use /blockball help to see more info about the plugin. **/ - override var commandUsage : String = "&0&l[&f&lBlockBall&0&l]&7 Use /blockball help to see more info about the plugin." + override var leftGameMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Left the game.") - /** Transitions the game to the final period. Executing this command again stops it. **/ - override var commandRefereeStopGameToolTip : String = "Transitions the game to the final period. Executing this command again stops it." + override var selectionSetMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Selection %1$1s was set.") - /** %blockball_game_players%/%blockball_game_maxPlayers% **/ - override var joinSignLine3 : String = "%blockball_game_players%/%blockball_game_maxPlayers%" + override var enabledArenaMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Game enable state was set to %1$1s.") - /** **/ - override var joinSignLine4 : String = "" + override var reloadedAllGamesMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Reloaded all games.") - /** &c%blockball_game_redScore% : &9%blockball_game_blueScore% **/ - override var scoreRedTitle : String = "&c%blockball_game_redScore% : &9%blockball_game_blueScore%" + override var reloadedGameMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Reloaded game %1$1s.") - /** &0&l[&f&lBlockBall&0&l]&7 Players can kick the ball now. **/ - override var refereeBallEnabled : String = "&0&l[&f&lBlockBall&0&l]&7 Players can kick the ball now." + override var updatedInventoryMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Updated inventory of game.") - /** Transitions to the next configured period. **/ - override var commandRefereeNextPeriodToolTip : String = "Transitions to the next configured period." + override var updatedArmorMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Updated armor of game.") - /** Updates a location selection of a part of the arena. **/ - override var commandSelectionToolTip : String = "Updates a location selection of a part of the arena." + override var gameRuleChangedMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Updated a gamerule.") - /** Copies the armor inventory of the player executing the command. This copy will be applied to players when they join a game. **/ - override var commandArmorToolTip : String = "Copies the armor inventory of the player executing the command. This copy will be applied to players when they join a game." + override var rightClickOnSignMessage = + LanguageItem("&0&l[&f&lBlockBall&0&l]&7 RightClick on a sign to convert it into a game sign.") - /** &0&l[&f&lBlockBall&0&l]&7 **/ - override var leaveSignLine1 : String = "&0&l[&f&lBlockBall&0&l]&7" + override var addedSignMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 A sign was added to the game.") - /** &fLeave **/ - override var leaveSignLine2 : String = "&fLeave" + override var noLeftClickSelectionMessage = + LanguageItem("&0&l[&f&lBlockBall&0&l]&c You need to select a location using the BlockBall axe with left click.") - /** %blockball_game_players%/%blockball_game_maxPlayers% **/ - override var leaveSignLine3 : String = "%blockball_game_players%/%blockball_game_maxPlayers%" + override var noRightClickSelectionMessage = + LanguageItem("&0&l[&f&lBlockBall&0&l]&c You need to select a location using the BlockBall axe with right click.") - /** **/ - override var leaveSignLine4 : String = "" + override var toggleHighlightMessage = + LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Toggled highlighting the important areas.") - /** &0&l[&f&lBlockBall&0&l]&7 &cFailed to reload arena %1$1s. Recommended action: &e%2$1s **/ - override var failedToReloadMessage : String = "&0&l[&f&lBlockBall&0&l]&7 &cFailed to reload arena %1$1s. Recommended action: &e%2$1s" + override var axeReceivedMessage = + LanguageItem("&0&l[&f&lBlockBall&0&l]&7 The BlockBall axe has been added to your inventory.") - /** 20 **/ - override var winBlueFadeIn : String = "20" + override var bossBarMessage = + LanguageItem("&cTeam Red %blockball_game_redScore% : &9%blockball_game_blueScore% Team Blue") - /** Enables the player to add a specific sign by right-clicking any sign. You can remove signs by simply breaking the block. **/ - override var commandSignToolTip : String = "Enables the player to add a specific sign by right-clicking any sign. You can remove signs by simply breaking the block." + override var hologramMessage = + LanguageItem("&cTeam Red %blockball_game_redScore% : &9Team Blue %blockball_game_blueScore%") - /** &0&l[&f&lBlockBall&0&l]&c GameType %1$1s does not exist. **/ - override var gameTypeNotExistMessage : String = "&0&l[&f&lBlockBall&0&l]&c GameType %1$1s does not exist." + override var scoreRed = LanguageItem("&c%blockball_game_redScore% : &9%blockball_game_blueScore%") - /** All commands for the BlockBall plugin. **/ - override var commandDescription : String = "All commands for the BlockBall plugin." + override var scoreBlue = LanguageItem("&9%blockball_game_blueScore% : &c%blockball_game_redScore%") - /** &0&l[&f&lBlockBall&0&l]&c You do not have permission. **/ - override var noPermissionMessage : String = "&0&l[&f&lBlockBall&0&l]&c You do not have permission." + override var winRed = LanguageItem("&cTeam Red") - /** &0&l[&f&lBlockBall&0&l]&7 The BlockBall axe has been added to your inventory. **/ - override var axeReceivedMessage : String = "&0&l[&f&lBlockBall&0&l]&7 The BlockBall axe has been added to your inventory." + override var winBlue = LanguageItem("&9Team Blue") - /** &cTeam Red &ahas won the match **/ - override var winRedSubTitle : String = "&cTeam Red &ahas won the match" + override var winDraw = LanguageItem("&fDraw") - /** &0&l[&f&lBlockBall&0&l]&7 Click on the team to join the match. **/ - override var hubGameJoinHeader : String = "&0&l[&f&lBlockBall&0&l]&7 Click on the team to join the match." + override var gameStatusJoinAble = LanguageItem("&aJoin") - /** &0&l[&f&lBlockBall&0&l]&c The text length has to be less than 20 characters. **/ - override var maxLength20Characters : String = "&0&l[&f&lBlockBall&0&l]&c The text length has to be less than 20 characters." + override var gameStatusDisabled = LanguageItem("&4Disabled") - /** &cTeam Red %blockball_game_redScore% : &9%blockball_game_blueScore% Team Blue **/ - override var bossBarMessage : String = "&cTeam Red %blockball_game_redScore% : &9%blockball_game_blueScore% Team Blue" + override var gameStatusRunning = LanguageItem("&1Running") - /** %1$1s scored for &9Team Blue. **/ - override var scoreBlueSubTitle : String = "%1$1s scored for &9Team Blue." + override var hubGameJoinHeader = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Click on the team to join the match.") - /** Gives you the BlockBall selection axe. **/ - override var commandAxeToolTip : String = "Gives you the BlockBall selection axe." + override var hubGameJoinRed = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 &c[Team Red]") - /** Lets the player executing the command join the game. The optional team argument allows to directly join a specific team. If the team is full, the other team will be chosen. If no team is specified, a random team will be selected. **/ - override var commandJoinToolTip : String = "Lets the player executing the command join the game. The optional team argument allows to directly join a specific team. If the team is full, the other team will be chosen. If no team is specified, a random team will be selected." + override var hubGameJoinBlue = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 &9[Team Blue]") - /** &0&l[&f&lBlockBall&0&l]&c Game %1$1s does not exist. **/ - override var gameDoesNotExistMessage : String = "&0&l[&f&lBlockBall&0&l]&c Game %1$1s does not exist." + override var commandCreateToolTip = LanguageItem("Creates a new arena for a BlockBall game.") - /** Evaluated placeholder: %1$1s **/ - override var commandPlaceHolderMessage : String = "Evaluated placeholder: %1$1s" + override var commandDeleteToolTip = LanguageItem("Deletes a BlockBall game.") - /** &0&l[&f&lBlockBall&0&l]&7 &9[Team Blue] **/ - override var hubGameJoinBlue : String = "&0&l[&f&lBlockBall&0&l]&7 &9[Team Blue]" + override var commandListToolTip = LanguageItem("Lists all games you have created.") - /** &9Team Blue **/ - override var winBlueTitle : String = "&9Team Blue" + override var commandToggleToolTip = + LanguageItem("Enables or disables your game. If a game is disabled, nobody can join.") - /** Toggles highlighting the important areas of your arena. **/ - override var commandHighlightToolTip : String = "Toggles highlighting the important areas of your arena." + override var commandJoinToolTip = + LanguageItem("Lets the player executing the command join the game. The optional team argument allows to directly join a specific team. If the team is full, the other team will be chosen. If no team is specified, a random team will be selected.") - /** Sets a selected location for your arena. **/ - override var commandSelectToolTip : String = "Sets a selected location for your arena." + override var commandLeaveToolTip = LanguageItem("Lets the player executing the command leave the game.") - /** &0&l[&f&lBlockBall&0&l]&7 Selection %1$1s was set. **/ - override var selectionSetMessage : String = "&0&l[&f&lBlockBall&0&l]&7 Selection %1$1s was set." + override var commandSelectionToolTip = LanguageItem("Updates a location selection of a part of the arena.") - /** Team Red **/ - override var teamRedDisplayName : String = "Team Red" + override var commandInventoryToolTip = + LanguageItem("Copies the inventory of the player executing the command. This copy will be applied to players when they join a game.") - /** Sets a gamerule in BlockBall. **/ - override var commandGameRuleToolTip : String = "Sets a gamerule in BlockBall." + override var commandArmorToolTip = + LanguageItem("Copies the armor inventory of the player executing the command. This copy will be applied to players when they join a game.") - /** &4Disabled **/ - override var gameStatusDisabled : String = "&4Disabled" + override var commandSignToolTip = + LanguageItem("Enables the player to add a specific sign by right-clicking any sign. You can remove signs by simply breaking the block.") - /** This period has ended. Execute &a/blockball referee nextperiod. **/ - override var nextPeriodRefereeHint : String = "This period has ended. Execute &a/blockball referee nextperiod." + override var commandReloadToolTip = LanguageItem("Allows to reload all games or a specific single one.") - /** &aThe game has ended in a draw **/ - override var winDrawSubTitle : String = "&aThe game has ended in a draw" + override var commandAxeToolTip = LanguageItem("Gives you the BlockBall selection axe.") - /** 20 **/ - override var winDrawFadeIn : String = "20" + override var commandHighlightToolTip = LanguageItem("Toggles highlighting the important areas of your arena.") - /** Lists all games you have created. **/ - override var commandListToolTip : String = "Lists all games you have created." + override var commandSelectToolTip = LanguageItem("Sets a selected location for your arena.") - /** &fDraw **/ - override var winDrawTitle : String = "&fDraw" + override var commandGameRuleToolTip = LanguageItem("Sets a gamerule in BlockBall.") - /** &0&l[&f&lBlockBall&0&l]&c This game is not a game where you can use a referee. Convert the game to a referee game first. **/ - override var gameIsNotARefereeGame : String = "&0&l[&f&lBlockBall&0&l]&c This game is not a game where you can use a referee. Convert the game to a referee game first." + override var joinSignLine1 = LanguageItem("&0&l[&f&lBlockBall&0&l]&7") - /** 60 **/ - override var scoreBlueStay : String = "60" + override var joinSignLine2 = LanguageItem("%blockball_game_stateDisplayName%") - /** Team Blue **/ - override var teamBlueDisplayName : String = "Team Blue" + override var joinSignLine3 = LanguageItem("%blockball_game_players%/%blockball_game_maxPlayers%") - /** Resumes the game and sets the ball interactable. **/ - override var commandRefereeWhistleResumeToolTip : String = "Resumes the game and sets the ball interactable." + override var joinSignLine4 = LanguageItem("") - /** %1$1s scored for &cTeam Red. **/ - override var scoreRedSubTitle : String = "%1$1s scored for &cTeam Red." + override var leaveSignLine1 = LanguageItem("&0&l[&f&lBlockBall&0&l]&7") - /** &9%blockball_game_blueScore% : &c%blockball_game_redScore% **/ - override var scoreBlueTitle : String = "&9%blockball_game_blueScore% : &c%blockball_game_redScore%" + override var leaveSignLine2 = LanguageItem("&fLeave") - /** &0&l[&f&lBlockBall&0&l]&c Game %1$1s already exists. **/ - override var gameAlreadyExistsMessage : String = "&0&l[&f&lBlockBall&0&l]&c Game %1$1s already exists." + override var leaveSignLine3 = LanguageItem("%blockball_game_players%/%blockball_game_maxPlayers%") - /** &0&l[&f&lBlockBall&0&l]&c Team %1$1s does not exist. **/ - override var teamDoesNotExistMessage : String = "&0&l[&f&lBlockBall&0&l]&c Team %1$1s does not exist." + override var leaveSignLine4 = LanguageItem("") - /** This period has ended. You are now in overtime. **/ - override var nextPeriodReferee : String = "This period has ended. You are now in overtime." + override var failedToReloadMessage = + LanguageItem("&0&l[&f&lBlockBall&0&l]&7 &cFailed to reload arena %1$1s. Recommended action: &e%2$1s") - /** You can resume the match by executing &a/blockball referee whistleresume. **/ - override var whistleTimeOutRefereeHint : String = "You can resume the match by executing &a/blockball referee whistleresume." + override var teamRedDisplayName = LanguageItem("Team Red") - /** 20 **/ - override var scoreRedFadeIn : String = "20" + override var teamBlueDisplayName = LanguageItem("Team Blue") - /** Stops the game and sets the ball inactive. **/ - override var commandRefereeWhistleStopToolTip : String = "Stops the game and sets the ball inactive." + override var gameIsNotARefereeGame = + LanguageItem("&0&l[&f&lBlockBall&0&l]&c This game is not a game where you can use a referee. Convert the game to a referee game first.") - /** &0&l[&f&lBlockBall&0&l]&7 You have stopped the game and transitioned to the last configured period. **/ - override var refereeStoppedGame : String = "&0&l[&f&lBlockBall&0&l]&7 You have stopped the game and transitioned to the last configured period." + override var gameTypeRefereeOnlyForPatreons = + LanguageItem("&0&l[&f&lBlockBall&0&l]&c The game type where you can have a referee requires the premium version of BlockBall. Obtainable via https://www.patreon.com/Shynixn.") - /** Resolves a given placeholder. **/ - override var commandPlaceHolderToolTip : String = "Resolves a given placeholder." + override var joinTeamRefereeMessage = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Successfully joined team referee.") - /** &0&l[&f&lBlockBall&0&l]&7 Updated armor of game. **/ - override var updatedArmorMessage : String = "&0&l[&f&lBlockBall&0&l]&7 Updated armor of game." + override var waitingForRefereeToStart = LanguageItem("Waiting for the referee to start the game...") - /** 20 **/ - override var winBlueFadeOut : String = "20" + override var waitingForRefereeToStartHint = + LanguageItem("Execute &a/blockball referee startgame &fto start the lobby timer.") - /** Teleports the ball to the position of the referee. **/ - override var commandRefereeSetBallToolTip : String = "Teleports the ball to the position of the referee." + override var nextPeriodReferee = LanguageItem("This period has ended. You are now in overtime.") - /** &0&l[&f&lBlockBall&0&l]&7 RightClick on a sign to convert it into a game sign. **/ - override var rightClickOnSignMessage : String = "&0&l[&f&lBlockBall&0&l]&7 RightClick on a sign to convert it into a game sign." + override var nextPeriodRefereeHint = LanguageItem("This period has ended. Execute &a/blockball referee nextperiod.") - /** Deletes a BlockBall game. **/ - override var commandDeleteToolTip : String = "Deletes a BlockBall game." + override var whistleTimeOutReferee = LanguageItem("Waiting for the referee to resume the game...") - /** Waiting for the referee to start the game... **/ - override var waitingForRefereeToStart : String = "Waiting for the referee to start the game..." + override var whistleTimeOutRefereeHint = + LanguageItem("You can resume the match by executing &a/blockball referee whistleresume.") - /** &0&l[&f&lBlockBall&0&l]&7 &c[Team Red] **/ - override var hubGameJoinRed : String = "&0&l[&f&lBlockBall&0&l]&7 &c[Team Red]" + override var refereeStartedGame = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 You have started the game.") - /** 20 **/ - override var winRedFadeIn : String = "20" + override var refereeStoppedGame = + LanguageItem("&0&l[&f&lBlockBall&0&l]&7 You have stopped the game and transitioned to the last configured period.") - /** 60 **/ - override var winBlueStay : String = "60" + override var refereeBallEnabled = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Players can kick the ball now.") - /** &0&l[&f&lBlockBall&0&l]&7 Created game %1$1s. **/ - override var gameCreatedMessage : String = "&0&l[&f&lBlockBall&0&l]&7 Created game %1$1s." + override var refereeBallDisabled = LanguageItem("&0&l[&f&lBlockBall&0&l]&7 Players can no longer kick the ball.") - /** 20 **/ - override var winDrawFadeOut : String = "20" + override var commandRefereeStartGameToolTip = LanguageItem("Starts the game.") - /** 20 **/ - override var scoreRedFadeOut : String = "20" + override var commandRefereeStopGameToolTip = + LanguageItem("Transitions the game to the final period. Executing this command again stops it.") - /** 20 **/ - override var scoreBlueFadeOut : String = "20" + override var commandRefereeWhistleResumeToolTip = LanguageItem("Resumes the game and sets the ball interactable.") - /** Lets the player executing the command leave the game. **/ - override var commandLeaveToolTip : String = "Lets the player executing the command leave the game." + override var commandRefereeWhistleStopToolTip = LanguageItem("Stops the game and sets the ball inactive.") - /** Freezes the countdown and sets the ball inactive. **/ - override var commandRefereeFreezeTimeToolTip : String = "Freezes the countdown and sets the ball inactive." + override var commandRefereeFreezeTimeToolTip = LanguageItem("Freezes the countdown and sets the ball inactive.") - /** 60 **/ - override var winRedStay : String = "60" + override var commandRefereeSetBallToolTip = LanguageItem("Teleports the ball to the position of the referee.") - /** &0&l[&f&lBlockBall&0&l]&7 Updated a gamerule. **/ - override var gameRuleChangedMessage : String = "&0&l[&f&lBlockBall&0&l]&7 Updated a gamerule." + override var commandRefereeNextPeriodToolTip = LanguageItem("Transitions to the next configured period.") - /** 60 **/ - override var scoreRedStay : String = "60" + override var commandPlaceHolderToolTip = LanguageItem("Resolves a given placeholder.") - /** Copies the inventory of the player executing the command. This copy will be applied to players when they join a game. **/ - override var commandInventoryToolTip : String = "Copies the inventory of the player executing the command. This copy will be applied to players when they join a game." - - /** Enables or disables your game. If a game is disabled, nobody can join. **/ - override var commandToggleToolTip : String = "Enables or disables your game. If a game is disabled, nobody can join." - - /** &0&l[&f&lBlockBall&0&l]&7 Toggled highlighting the important areas. **/ - override var toggleHighlightMessage : String = "&0&l[&f&lBlockBall&0&l]&7 Toggled highlighting the important areas." - - /** &0&l[&f&lBlockBall&0&l]&c The game type where you can have a referee requires the premium version of BlockBall. Obtainable via https://www.patreon.com/Shynixn. **/ - override var gameTypeRefereeOnlyForPatreons : String = "&0&l[&f&lBlockBall&0&l]&c The game type where you can have a referee requires the premium version of BlockBall. Obtainable via https://www.patreon.com/Shynixn." - - /** &0&l[&f&lBlockBall&0&l]&7 Game enable state was set to %1$1s. **/ - override var enabledArenaMessage : String = "&0&l[&f&lBlockBall&0&l]&7 Game enable state was set to %1$1s." - - /** &0&l[&f&lBlockBall&0&l]&c This sign type is not known. **/ - override var signTypeDoesNotExistMessage : String = "&0&l[&f&lBlockBall&0&l]&c This sign type is not known." - - /** &0&l[&f&lBlockBall&0&l]&7 Successfully joined team red. **/ - override var joinTeamRedMessage : String = "&0&l[&f&lBlockBall&0&l]&7 Successfully joined team red." - - /** &aJoin **/ - override var gameStatusJoinAble : String = "&aJoin" - - /** &0&l[&f&lBlockBall&0&l]&7 Deleted game %1$1s. **/ - override var deletedGameMessage : String = "&0&l[&f&lBlockBall&0&l]&7 Deleted game %1$1s." - - /** &0&l[&f&lBlockBall&0&l]&c Game is already full. **/ - override var gameIsFullMessage : String = "&0&l[&f&lBlockBall&0&l]&c Game is already full." - - /** Starts the game. **/ - override var commandRefereeStartGameToolTip : String = "Starts the game." - - /** 60 **/ - override var winDrawStay : String = "60" - - /** Allows to reload all games or a specific single one. **/ - override var commandReloadToolTip : String = "Allows to reload all games or a specific single one." - - /** &cTeam Red %blockball_game_redScore% : &9Team Blue %blockball_game_blueScore% **/ - override var hologramMessage : String = "&cTeam Red %blockball_game_redScore% : &9Team Blue %blockball_game_blueScore%" - - /** &0&l[&f&lBlockBall&0&l]&c You need to select a location using the BlockBall axe with left click. **/ - override var noLeftClickSelectionMessage : String = "&0&l[&f&lBlockBall&0&l]&c You need to select a location using the BlockBall axe with left click." - - /** &0&l[&f&lBlockBall&0&l]&7 Updated inventory of game. **/ - override var updatedInventoryMessage : String = "&0&l[&f&lBlockBall&0&l]&7 Updated inventory of game." - - /** &0&l[&f&lBlockBall&0&l]&c You need to select a location using the BlockBall axe with right click. **/ - override var noRightClickSelectionMessage : String = "&0&l[&f&lBlockBall&0&l]&c You need to select a location using the BlockBall axe with right click." - - /** 20 **/ - override var scoreBlueFadeIn : String = "20" - - /** &0&l[&f&lBlockBall&0&l]&c The command sender has to be a player! **/ - override var commandSenderHasToBePlayer : String = "&0&l[&f&lBlockBall&0&l]&c The command sender has to be a player!" - - /** 20 **/ - override var winRedFadeOut : String = "20" - - /** &0&l[&f&lBlockBall&0&l]&7 You have started the game. **/ - override var refereeStartedGame : String = "&0&l[&f&lBlockBall&0&l]&7 You have started the game." + override var commandPlaceHolderMessage = LanguageItem("Evaluated placeholder: %1$1s") } diff --git a/src/main/java/com/github/shynixn/blockball/BlockBallPlugin.kt b/src/main/java/com/github/shynixn/blockball/BlockBallPlugin.kt index 48f34fc2e..d966aebe5 100644 --- a/src/main/java/com/github/shynixn/blockball/BlockBallPlugin.kt +++ b/src/main/java/com/github/shynixn/blockball/BlockBallPlugin.kt @@ -13,7 +13,7 @@ import com.github.shynixn.mccoroutine.bukkit.launch import com.github.shynixn.mcutils.common.ChatColor import com.github.shynixn.mcutils.common.ConfigurationService import com.github.shynixn.mcutils.common.Version -import com.github.shynixn.mcutils.common.reloadTranslation +import com.github.shynixn.mcutils.common.language.reloadTranslation import com.github.shynixn.mcutils.common.repository.Repository import com.github.shynixn.mcutils.common.selection.AreaSelectionService import com.github.shynixn.mcutils.database.api.CachePlayerRepository @@ -21,6 +21,7 @@ import com.github.shynixn.mcutils.database.api.PlayerDataRepository import com.github.shynixn.mcutils.guice.DependencyInjectionModule import com.github.shynixn.mcutils.packet.api.PacketInType import com.github.shynixn.mcutils.packet.api.PacketService +import com.github.shynixn.mcutils.packet.impl.service.ChatMessageServiceImpl import com.github.shynixn.mcutils.sign.SignService import kotlinx.coroutines.runBlocking import org.bstats.bukkit.Metrics @@ -91,8 +92,23 @@ class BlockBallPlugin : JavaPlugin() { logger.log(Level.INFO, "Loaded NMS version ${Version.serverVersion}.") + // Load Language + val language = BlockBallLanguageImpl() + language.chatMessageService = ChatMessageServiceImpl(this) + language.placeHolderFun = + { text, player -> + val placeHolderService = module.getService() + if (player != null) { + placeHolderService.resolvePlaceHolder(player, text, hashMapOf()) + } else { + text + } + } + reloadTranslation(language,BlockBallLanguageImpl::class.java) + logger.log(Level.INFO, "Loaded language file.") + // Guice - this.module = BlockBallDependencyInjectionModule(this).build() + this.module = BlockBallDependencyInjectionModule(this, language).build() this.reloadConfig() // Register Packet @@ -126,11 +142,6 @@ class BlockBallPlugin : JavaPlugin() { Metrics(plugin, bstatsPluginId) } - // Load Language - val language = configurationService.findValue("language") - plugin.reloadTranslation(language, BlockBallLanguageImpl::class.java, "en_us", "es_es") - logger.log(Level.INFO, "Loaded language file $language.properties.") - // Load Games val gameService = module.getService() try { diff --git a/src/main/java/com/github/shynixn/blockball/contract/BlockBallLanguage.kt b/src/main/java/com/github/shynixn/blockball/contract/BlockBallLanguage.kt deleted file mode 100644 index 60bf2bc02..000000000 --- a/src/main/java/com/github/shynixn/blockball/contract/BlockBallLanguage.kt +++ /dev/null @@ -1,339 +0,0 @@ -package com.github.shynixn.blockball.contract - -interface BlockBallLanguage { - /** &cTeam Red **/ - var winRedTitle : String - - /** &0&l[&f&lBlockBall&0&l]&7 Successfully joined team blue. **/ - var joinTeamBlueMessage : String - - /** &0&l[&f&lBlockBall&0&l]&7 Players can no longer kick the ball. **/ - var refereeBallDisabled : String - - /** Waiting for the referee to resume the game... **/ - var whistleTimeOutReferee : String - - /** &0&l[&f&lBlockBall&0&l]&c This selection type is not known. **/ - var selectionTypeDoesNotExistMessage : String - - /** &0&l[&f&lBlockBall&0&l]&7 Successfully joined team referee. **/ - var joinTeamRefereeMessage : String - - /** &0&l[&f&lBlockBall&0&l]&7 Reloaded game %1$1s. **/ - var reloadedGameMessage : String - - /** &0&l[&f&lBlockBall&0&l]&7 A sign was added to the game. **/ - var addedSignMessage : String - - /** &9Team Blue &ahas won the match **/ - var winBlueSubTitle : String - - /** Execute &a/blockball referee startgame &fto start the lobby timer. **/ - var waitingForRefereeToStartHint : String - - /** &0&l[&f&lBlockBall&0&l]&7 Left the game. **/ - var leftGameMessage : String - - /** &0&l[&f&lBlockBall&0&l]&7 Reloaded all games. **/ - var reloadedAllGamesMessage : String - - /** &0&l[&f&lBlockBall&0&l]&7 **/ - var joinSignLine1 : String - - /** %blockball_game_stateDisplayName% **/ - var joinSignLine2 : String - - /** &1Running **/ - var gameStatusRunning : String - - /** Creates a new arena for a BlockBall game. **/ - var commandCreateToolTip : String - - /** &0&l[&f&lBlockBall&0&l]&c You do not have permission to join game %1$1s. **/ - var noPermissionForGameMessage : String - - /** &0&l[&f&lBlockBall&0&l]&7 Use /blockball help to see more info about the plugin. **/ - var commandUsage : String - - /** Transitions the game to the final period. Executing this command again stops it. **/ - var commandRefereeStopGameToolTip : String - - /** %blockball_game_players%/%blockball_game_maxPlayers% **/ - var joinSignLine3 : String - - /** **/ - var joinSignLine4 : String - - /** &c%blockball_game_redScore% : &9%blockball_game_blueScore% **/ - var scoreRedTitle : String - - /** &0&l[&f&lBlockBall&0&l]&7 Players can kick the ball now. **/ - var refereeBallEnabled : String - - /** Transitions to the next configured period. **/ - var commandRefereeNextPeriodToolTip : String - - /** Updates a location selection of a part of the arena. **/ - var commandSelectionToolTip : String - - /** Copies the armor inventory of the player executing the command. This copy will be applied to players when they join a game. **/ - var commandArmorToolTip : String - - /** &0&l[&f&lBlockBall&0&l]&7 **/ - var leaveSignLine1 : String - - /** &fLeave **/ - var leaveSignLine2 : String - - /** %blockball_game_players%/%blockball_game_maxPlayers% **/ - var leaveSignLine3 : String - - /** **/ - var leaveSignLine4 : String - - /** &0&l[&f&lBlockBall&0&l]&7 &cFailed to reload arena %1$1s. Recommended action: &e%2$1s **/ - var failedToReloadMessage : String - - /** 20 **/ - var winBlueFadeIn : String - - /** Enables the player to add a specific sign by right-clicking any sign. You can remove signs by simply breaking the block. **/ - var commandSignToolTip : String - - /** &0&l[&f&lBlockBall&0&l]&c GameType %1$1s does not exist. **/ - var gameTypeNotExistMessage : String - - /** All commands for the BlockBall plugin. **/ - var commandDescription : String - - /** &0&l[&f&lBlockBall&0&l]&c You do not have permission. **/ - var noPermissionMessage : String - - /** &0&l[&f&lBlockBall&0&l]&7 The BlockBall axe has been added to your inventory. **/ - var axeReceivedMessage : String - - /** &cTeam Red &ahas won the match **/ - var winRedSubTitle : String - - /** &0&l[&f&lBlockBall&0&l]&7 Click on the team to join the match. **/ - var hubGameJoinHeader : String - - /** &0&l[&f&lBlockBall&0&l]&c The text length has to be less than 20 characters. **/ - var maxLength20Characters : String - - /** &cTeam Red %blockball_game_redScore% : &9%blockball_game_blueScore% Team Blue **/ - var bossBarMessage : String - - /** %1$1s scored for &9Team Blue. **/ - var scoreBlueSubTitle : String - - /** Gives you the BlockBall selection axe. **/ - var commandAxeToolTip : String - - /** Lets the player executing the command join the game. The optional team argument allows to directly join a specific team. If the team is full, the other team will be chosen. If no team is specified, a random team will be selected. **/ - var commandJoinToolTip : String - - /** &0&l[&f&lBlockBall&0&l]&c Game %1$1s does not exist. **/ - var gameDoesNotExistMessage : String - - /** Evaluated placeholder: %1$1s **/ - var commandPlaceHolderMessage : String - - /** &0&l[&f&lBlockBall&0&l]&7 &9[Team Blue] **/ - var hubGameJoinBlue : String - - /** &9Team Blue **/ - var winBlueTitle : String - - /** Toggles highlighting the important areas of your arena. **/ - var commandHighlightToolTip : String - - /** Sets a selected location for your arena. **/ - var commandSelectToolTip : String - - /** &0&l[&f&lBlockBall&0&l]&7 Selection %1$1s was set. **/ - var selectionSetMessage : String - - /** Team Red **/ - var teamRedDisplayName : String - - /** Sets a gamerule in BlockBall. **/ - var commandGameRuleToolTip : String - - /** &4Disabled **/ - var gameStatusDisabled : String - - /** This period has ended. Execute &a/blockball referee nextperiod. **/ - var nextPeriodRefereeHint : String - - /** &aThe game has ended in a draw **/ - var winDrawSubTitle : String - - /** 20 **/ - var winDrawFadeIn : String - - /** Lists all games you have created. **/ - var commandListToolTip : String - - /** &fDraw **/ - var winDrawTitle : String - - /** &0&l[&f&lBlockBall&0&l]&c This game is not a game where you can use a referee. Convert the game to a referee game first. **/ - var gameIsNotARefereeGame : String - - /** 60 **/ - var scoreBlueStay : String - - /** Team Blue **/ - var teamBlueDisplayName : String - - /** Resumes the game and sets the ball interactable. **/ - var commandRefereeWhistleResumeToolTip : String - - /** %1$1s scored for &cTeam Red. **/ - var scoreRedSubTitle : String - - /** &9%blockball_game_blueScore% : &c%blockball_game_redScore% **/ - var scoreBlueTitle : String - - /** &0&l[&f&lBlockBall&0&l]&c Game %1$1s already exists. **/ - var gameAlreadyExistsMessage : String - - /** &0&l[&f&lBlockBall&0&l]&c Team %1$1s does not exist. **/ - var teamDoesNotExistMessage : String - - /** This period has ended. You are now in overtime. **/ - var nextPeriodReferee : String - - /** You can resume the match by executing &a/blockball referee whistleresume. **/ - var whistleTimeOutRefereeHint : String - - /** 20 **/ - var scoreRedFadeIn : String - - /** Stops the game and sets the ball inactive. **/ - var commandRefereeWhistleStopToolTip : String - - /** &0&l[&f&lBlockBall&0&l]&7 You have stopped the game and transitioned to the last configured period. **/ - var refereeStoppedGame : String - - /** Resolves a given placeholder. **/ - var commandPlaceHolderToolTip : String - - /** &0&l[&f&lBlockBall&0&l]&7 Updated armor of game. **/ - var updatedArmorMessage : String - - /** 20 **/ - var winBlueFadeOut : String - - /** Teleports the ball to the position of the referee. **/ - var commandRefereeSetBallToolTip : String - - /** &0&l[&f&lBlockBall&0&l]&7 RightClick on a sign to convert it into a game sign. **/ - var rightClickOnSignMessage : String - - /** Deletes a BlockBall game. **/ - var commandDeleteToolTip : String - - /** Waiting for the referee to start the game... **/ - var waitingForRefereeToStart : String - - /** &0&l[&f&lBlockBall&0&l]&7 &c[Team Red] **/ - var hubGameJoinRed : String - - /** 20 **/ - var winRedFadeIn : String - - /** 60 **/ - var winBlueStay : String - - /** &0&l[&f&lBlockBall&0&l]&7 Created game %1$1s. **/ - var gameCreatedMessage : String - - /** 20 **/ - var winDrawFadeOut : String - - /** 20 **/ - var scoreRedFadeOut : String - - /** 20 **/ - var scoreBlueFadeOut : String - - /** Lets the player executing the command leave the game. **/ - var commandLeaveToolTip : String - - /** Freezes the countdown and sets the ball inactive. **/ - var commandRefereeFreezeTimeToolTip : String - - /** 60 **/ - var winRedStay : String - - /** &0&l[&f&lBlockBall&0&l]&7 Updated a gamerule. **/ - var gameRuleChangedMessage : String - - /** 60 **/ - var scoreRedStay : String - - /** Copies the inventory of the player executing the command. This copy will be applied to players when they join a game. **/ - var commandInventoryToolTip : String - - /** Enables or disables your game. If a game is disabled, nobody can join. **/ - var commandToggleToolTip : String - - /** &0&l[&f&lBlockBall&0&l]&7 Toggled highlighting the important areas. **/ - var toggleHighlightMessage : String - - /** &0&l[&f&lBlockBall&0&l]&c The game type where you can have a referee requires the premium version of BlockBall. Obtainable via https://www.patreon.com/Shynixn. **/ - var gameTypeRefereeOnlyForPatreons : String - - /** &0&l[&f&lBlockBall&0&l]&7 Game enable state was set to %1$1s. **/ - var enabledArenaMessage : String - - /** &0&l[&f&lBlockBall&0&l]&c This sign type is not known. **/ - var signTypeDoesNotExistMessage : String - - /** &0&l[&f&lBlockBall&0&l]&7 Successfully joined team red. **/ - var joinTeamRedMessage : String - - /** &aJoin **/ - var gameStatusJoinAble : String - - /** &0&l[&f&lBlockBall&0&l]&7 Deleted game %1$1s. **/ - var deletedGameMessage : String - - /** &0&l[&f&lBlockBall&0&l]&c Game is already full. **/ - var gameIsFullMessage : String - - /** Starts the game. **/ - var commandRefereeStartGameToolTip : String - - /** 60 **/ - var winDrawStay : String - - /** Allows to reload all games or a specific single one. **/ - var commandReloadToolTip : String - - /** &cTeam Red %blockball_game_redScore% : &9Team Blue %blockball_game_blueScore% **/ - var hologramMessage : String - - /** &0&l[&f&lBlockBall&0&l]&c You need to select a location using the BlockBall axe with left click. **/ - var noLeftClickSelectionMessage : String - - /** &0&l[&f&lBlockBall&0&l]&7 Updated inventory of game. **/ - var updatedInventoryMessage : String - - /** &0&l[&f&lBlockBall&0&l]&c You need to select a location using the BlockBall axe with right click. **/ - var noRightClickSelectionMessage : String - - /** 20 **/ - var scoreBlueFadeIn : String - - /** &0&l[&f&lBlockBall&0&l]&c The command sender has to be a player! **/ - var commandSenderHasToBePlayer : String - - /** 20 **/ - var winRedFadeOut : String - - /** &0&l[&f&lBlockBall&0&l]&7 You have started the game. **/ - var refereeStartedGame : String -} diff --git a/src/main/java/com/github/shynixn/blockball/contract/Language.kt b/src/main/java/com/github/shynixn/blockball/contract/Language.kt new file mode 100644 index 000000000..19f643564 --- /dev/null +++ b/src/main/java/com/github/shynixn/blockball/contract/Language.kt @@ -0,0 +1,190 @@ +package com.github.shynixn.blockball.contract + +import com.github.shynixn.mcutils.common.language.LanguageItem +import com.github.shynixn.mcutils.common.language.LanguageProvider + +interface Language : LanguageProvider { + var gameAlreadyExistsMessage: LanguageItem + + var commandUsage: LanguageItem + + var commandDescription: LanguageItem + + var maxLength20Characters: LanguageItem + + var gameDoesNotExistMessage: LanguageItem + + var teamDoesNotExistMessage: LanguageItem + + var gameTypeNotExistMessage: LanguageItem + + var selectionTypeDoesNotExistMessage: LanguageItem + + var signTypeDoesNotExistMessage: LanguageItem + + var noPermissionForGameMessage: LanguageItem + + var noPermissionMessage: LanguageItem + + var commandSenderHasToBePlayer: LanguageItem + + var gameCreatedMessage: LanguageItem + + var deletedGameMessage: LanguageItem + + var gameIsFullMessage: LanguageItem + + var joinTeamRedMessage: LanguageItem + + var joinTeamBlueMessage: LanguageItem + + var leftGameMessage: LanguageItem + + var selectionSetMessage: LanguageItem + + var enabledArenaMessage: LanguageItem + + var reloadedAllGamesMessage: LanguageItem + + var reloadedGameMessage: LanguageItem + + var updatedInventoryMessage: LanguageItem + + var updatedArmorMessage: LanguageItem + + var gameRuleChangedMessage: LanguageItem + + var rightClickOnSignMessage: LanguageItem + + var addedSignMessage: LanguageItem + + var noLeftClickSelectionMessage: LanguageItem + + var noRightClickSelectionMessage: LanguageItem + + var toggleHighlightMessage: LanguageItem + + var axeReceivedMessage: LanguageItem + + var bossBarMessage: LanguageItem + + var hologramMessage: LanguageItem + + var scoreRed: LanguageItem + + var scoreBlue: LanguageItem + + var winRed: LanguageItem + + var winBlue: LanguageItem + + var winDraw: LanguageItem + + var gameStatusJoinAble: LanguageItem + + var gameStatusDisabled: LanguageItem + + var gameStatusRunning: LanguageItem + + var hubGameJoinHeader: LanguageItem + + var hubGameJoinRed: LanguageItem + + var hubGameJoinBlue: LanguageItem + + var commandCreateToolTip: LanguageItem + + var commandDeleteToolTip: LanguageItem + + var commandListToolTip: LanguageItem + + var commandToggleToolTip: LanguageItem + + var commandJoinToolTip: LanguageItem + + var commandLeaveToolTip: LanguageItem + + var commandSelectionToolTip: LanguageItem + + var commandInventoryToolTip: LanguageItem + + var commandArmorToolTip: LanguageItem + + var commandSignToolTip: LanguageItem + + var commandReloadToolTip: LanguageItem + + var commandAxeToolTip: LanguageItem + + var commandHighlightToolTip: LanguageItem + + var commandSelectToolTip: LanguageItem + + var commandGameRuleToolTip: LanguageItem + + var joinSignLine1: LanguageItem + + var joinSignLine2: LanguageItem + + var joinSignLine3: LanguageItem + + var joinSignLine4: LanguageItem + + var leaveSignLine1: LanguageItem + + var leaveSignLine2: LanguageItem + + var leaveSignLine3: LanguageItem + + var leaveSignLine4: LanguageItem + + var failedToReloadMessage: LanguageItem + + var teamRedDisplayName: LanguageItem + + var teamBlueDisplayName: LanguageItem + + var gameIsNotARefereeGame: LanguageItem + + var gameTypeRefereeOnlyForPatreons: LanguageItem + + var joinTeamRefereeMessage: LanguageItem + + var waitingForRefereeToStart: LanguageItem + + var waitingForRefereeToStartHint: LanguageItem + + var nextPeriodReferee: LanguageItem + + var nextPeriodRefereeHint: LanguageItem + + var whistleTimeOutReferee: LanguageItem + + var whistleTimeOutRefereeHint: LanguageItem + + var refereeStartedGame: LanguageItem + + var refereeStoppedGame: LanguageItem + + var refereeBallEnabled: LanguageItem + + var refereeBallDisabled: LanguageItem + + var commandRefereeStartGameToolTip: LanguageItem + + var commandRefereeStopGameToolTip: LanguageItem + + var commandRefereeWhistleResumeToolTip: LanguageItem + + var commandRefereeWhistleStopToolTip: LanguageItem + + var commandRefereeFreezeTimeToolTip: LanguageItem + + var commandRefereeSetBallToolTip: LanguageItem + + var commandRefereeNextPeriodToolTip: LanguageItem + + var commandPlaceHolderToolTip: LanguageItem + + var commandPlaceHolderMessage: LanguageItem +} diff --git a/src/main/java/com/github/shynixn/blockball/entity/SoccerBallSettings.kt b/src/main/java/com/github/shynixn/blockball/entity/SoccerBallSettings.kt index f5caf6544..18c9bf0fe 100644 --- a/src/main/java/com/github/shynixn/blockball/entity/SoccerBallSettings.kt +++ b/src/main/java/com/github/shynixn/blockball/entity/SoccerBallSettings.kt @@ -16,8 +16,10 @@ class SoccerBallSettings { var item: Item = Item().also { it.typeName = "PLAYER_HEAD,397" it.durability = "3" - it.skinBase64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHBzOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzhlNGE3MGI3YmJjZDdhOGMzMjJkNTIyNTIwNDkxYTI3ZWE2YjgzZDYwZWNmOTYxZDJiNGVmYmJmOWY2MDVkIn19fQ==" + it.skinBase64 = + "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHBzOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzhlNGE3MGI3YmJjZDdhOGMzMjJkNTIyNTIwNDkxYTI3ZWE2YjgzZDYwZWNmOTYxZDJiNGVmYmJmOWY2MDVkIn19fQ==" } + /** * If set to true, the slime is visible instead of the ball. */ @@ -45,6 +47,10 @@ class SoccerBallSettings { */ var interactionCoolDown: Int = 20 + /** + * Amount of cooldown per player. + */ + var interactionCoolDownPerPlayerMs: Int = 20 /** Should the ball rotate? */ var rotating: Boolean = true diff --git a/src/main/java/com/github/shynixn/blockball/impl/SoccerBallCrossPlatformProxy.kt b/src/main/java/com/github/shynixn/blockball/impl/SoccerBallCrossPlatformProxy.kt index 0c1999f2d..575a35065 100644 --- a/src/main/java/com/github/shynixn/blockball/impl/SoccerBallCrossPlatformProxy.kt +++ b/src/main/java/com/github/shynixn/blockball/impl/SoccerBallCrossPlatformProxy.kt @@ -22,6 +22,8 @@ class SoccerBallCrossPlatformProxy( private val ballHitBoxEntity: BallHitboxEntity, private val plugin: Plugin ) : SoccerBall { + private val playerInteractionCoolDown = HashMap() + private var allPlayerTracker: AllPlayerTracker = AllPlayerTracker( { ballHitBoxEntity.position @@ -119,6 +121,10 @@ class SoccerBallCrossPlatformProxy( return } + if (isInCoolDown(player)) { + return + } + ballHitBoxEntity.kickPlayer(player, meta.movementModifier.shotVelocity, false) } @@ -133,6 +139,10 @@ class SoccerBallCrossPlatformProxy( return } + if (isInCoolDown(player)) { + return + } + ballHitBoxEntity.kickPlayer(player, meta.movementModifier.passVelocity, true) } @@ -153,6 +163,7 @@ class SoccerBallCrossPlatformProxy( isDead = true allPlayerTracker.dispose() + playerInteractionCoolDown.clear() } /** @@ -171,4 +182,18 @@ class SoccerBallCrossPlatformProxy( plugin.logger.log(Level.SEVERE, "Entity ticking exception", e) } } + + private fun isInCoolDown(player: Player): Boolean { + val currentMilliSeconds = System.currentTimeMillis() + val timeStampOfLastHit = playerInteractionCoolDown[player] + + if (timeStampOfLastHit != null) { + if (currentMilliSeconds - timeStampOfLastHit < meta.interactionCoolDownPerPlayerMs) { + return true + } + } + + playerInteractionCoolDown[player] = currentMilliSeconds + return false + } } diff --git a/src/main/java/com/github/shynixn/blockball/impl/SoccerGameImpl.kt b/src/main/java/com/github/shynixn/blockball/impl/SoccerGameImpl.kt index aa81f9ae7..fbd5d38e5 100644 --- a/src/main/java/com/github/shynixn/blockball/impl/SoccerGameImpl.kt +++ b/src/main/java/com/github/shynixn/blockball/impl/SoccerGameImpl.kt @@ -10,7 +10,6 @@ import com.github.shynixn.blockball.event.GameLeaveEvent import com.github.shynixn.mccoroutine.bukkit.launch import com.github.shynixn.mccoroutine.bukkit.ticks import com.github.shynixn.mcutils.common.* -import com.github.shynixn.mcutils.common.chat.ChatMessageService import com.github.shynixn.mcutils.common.command.CommandMeta import com.github.shynixn.mcutils.common.command.CommandService import com.github.shynixn.mcutils.database.api.PlayerDataRepository @@ -35,9 +34,8 @@ abstract class SoccerGameImpl( private val bossBarService: BossBarService, private val scoreboardService: ScoreboardService, private val soccerBallFactory: SoccerBallFactory, - private val chatMessageService: ChatMessageService, private val commandService: CommandService, - private val language: BlockBallLanguage, + private val language: Language, private val playerDataRepository: PlayerDataRepository ) : SoccerGame { /** @@ -353,23 +351,9 @@ abstract class SoccerGameImpl( for (player in players) { if (team == Team.RED) { - chatMessageService.sendTitleMessage( - player, - placeHolderService.replacePlaceHolders(language.winRedTitle, player, this), - placeHolderService.replacePlaceHolders(language.winRedSubTitle, player, this), - language.winRedFadeIn.toIntOrNull() ?: 20, - language.winRedStay.toIntOrNull() ?: 20, - language.winRedFadeOut.toIntOrNull() ?: 20, - ) + language.sendMessage(language.winRed, player) } else if (team == Team.BLUE) { - chatMessageService.sendTitleMessage( - player, - placeHolderService.replacePlaceHolders(language.winBlueTitle, player, this), - placeHolderService.replacePlaceHolders(language.winBlueSubTitle, player, this), - language.winBlueFadeIn.toIntOrNull() ?: 20, - language.winBlueStay.toIntOrNull() ?: 20, - language.winBlueFadeOut.toIntOrNull() ?: 20, - ) + language.sendMessage(language.winBlue, player) } } @@ -655,14 +639,7 @@ abstract class SoccerGameImpl( players.addAll(getPlayers()) for (player in players) { - chatMessageService.sendTitleMessage( - player, - placeHolderService.replacePlaceHolders(language.winDrawTitle, player, this), - placeHolderService.replacePlaceHolders(language.winDrawSubTitle, player, this), - language.winDrawFadeIn.toIntOrNull() ?: 20, - language.winDrawStay.toIntOrNull() ?: 60, - language.winDrawFadeOut.toIntOrNull() ?: 20, - ) + language.sendMessage(language.winDraw, player) } } @@ -775,29 +752,11 @@ abstract class SoccerGameImpl( if (team == Team.RED) { for (player in players) { - chatMessageService.sendTitleMessage( - player, - placeHolderService.replacePlaceHolders(language.scoreRedTitle, player, this, scoreTeamMeta), - placeHolderService.replacePlaceHolders( - language.scoreRedSubTitle.format(interactionEntity.name), player, this, scoreTeamMeta - ), - language.scoreRedFadeIn.toIntOrNull() ?: 20, - language.scoreRedStay.toIntOrNull() ?: 60, - language.scoreRedFadeOut.toIntOrNull() ?: 20 - ) + language.sendMessage(language.scoreRed, player) } } else { for (player in players) { - chatMessageService.sendTitleMessage( - player, - placeHolderService.replacePlaceHolders(language.scoreBlueTitle, player, this, scoreTeamMeta), - placeHolderService.replacePlaceHolders( - language.scoreBlueSubTitle.format(interactionEntity.name), player, this, scoreTeamMeta - ), - language.scoreBlueFadeIn.toIntOrNull() ?: 20, - language.scoreBlueStay.toIntOrNull() ?: 60, - language.scoreBlueFadeOut.toIntOrNull() ?: 20 - ) + language.sendMessage(language.scoreBlue, player) } } diff --git a/src/main/java/com/github/shynixn/blockball/impl/SoccerHubGameImpl.kt b/src/main/java/com/github/shynixn/blockball/impl/SoccerHubGameImpl.kt index 416aa29dc..3ab45c2a2 100644 --- a/src/main/java/com/github/shynixn/blockball/impl/SoccerHubGameImpl.kt +++ b/src/main/java/com/github/shynixn/blockball/impl/SoccerHubGameImpl.kt @@ -5,7 +5,6 @@ import com.github.shynixn.blockball.entity.PlayerInformation import com.github.shynixn.blockball.entity.SoccerArena import com.github.shynixn.blockball.enumeration.GameState import com.github.shynixn.blockball.enumeration.Team -import com.github.shynixn.mcutils.common.chat.ChatMessageService import com.github.shynixn.mcutils.common.command.CommandService import com.github.shynixn.mcutils.database.api.PlayerDataRepository import com.github.shynixn.mcutils.packet.api.PacketService @@ -19,11 +18,10 @@ class SoccerHubGameImpl( plugin: Plugin, placeHolderService: PlaceHolderService, private val bossBarService: BossBarService, - language: BlockBallLanguage, + language: Language, packetService: PacketService, scoreboardService: ScoreboardService, soccerBallFactory: SoccerBallFactory, - chatMessageService: ChatMessageService, commandService: CommandService ) : SoccerGameImpl( arena, @@ -33,7 +31,6 @@ class SoccerHubGameImpl( bossBarService, scoreboardService, soccerBallFactory, - chatMessageService, commandService, language, playerDataRepository 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 312ac632b..56f074f9d 100644 --- a/src/main/java/com/github/shynixn/blockball/impl/SoccerMiniGameImpl.kt +++ b/src/main/java/com/github/shynixn/blockball/impl/SoccerMiniGameImpl.kt @@ -28,7 +28,7 @@ open class SoccerMiniGameImpl constructor( private val bossBarService: BossBarService, private val chatMessageService: ChatMessageService, private val soundService: SoundService, - language: BlockBallLanguage, + language: Language, packetService: PacketService, scoreboardService: ScoreboardService, commandService: CommandService, @@ -41,7 +41,6 @@ open class SoccerMiniGameImpl constructor( bossBarService, scoreboardService, soccerBallFactory, - chatMessageService, commandService, language, playerDataRepository diff --git a/src/main/java/com/github/shynixn/blockball/impl/SoccerRefereeGameImpl.kt b/src/main/java/com/github/shynixn/blockball/impl/SoccerRefereeGameImpl.kt index 0bfc0ad68..b70b1cd0f 100644 --- a/src/main/java/com/github/shynixn/blockball/impl/SoccerRefereeGameImpl.kt +++ b/src/main/java/com/github/shynixn/blockball/impl/SoccerRefereeGameImpl.kt @@ -17,12 +17,12 @@ import org.bukkit.plugin.Plugin class SoccerRefereeGameImpl constructor( arena: SoccerArena, playerDataRepository: PlayerDataRepository, - private val plugin: Plugin, + plugin: Plugin, private val placeHolderService: PlaceHolderService, - private val bossBarService: BossBarService, + bossBarService: BossBarService, private val chatMessageService: ChatMessageService, private val soundService: SoundService, - private val language: BlockBallLanguage, + private val language: Language, packetService: PacketService, scoreboardService: ScoreboardService, commandService: CommandService, @@ -108,7 +108,7 @@ class SoccerRefereeGameImpl constructor( if (ticks >= 20) { // Display the message. if (!playing && !lobbyCountDownActive) { - sendBroadcastMessage(language.waitingForRefereeToStart, language.waitingForRefereeToStartHint) + sendBroadcastMessage(language.waitingForRefereeToStart.text, language.waitingForRefereeToStartHint.text) } if (lobbyCountDownActive) { @@ -151,7 +151,7 @@ class SoccerRefereeGameImpl constructor( if (playing) { if (matchTimeIndex != -1) { if (ball != null && !ball!!.isInteractable) { - sendBroadcastMessage(language.whistleTimeOutReferee, language.whistleTimeOutRefereeHint) + sendBroadcastMessage(language.whistleTimeOutReferee.text, language.whistleTimeOutRefereeHint.text) } if (!isTimerBlockerEnabled) { @@ -164,7 +164,7 @@ class SoccerRefereeGameImpl constructor( ingamePlayersStorage.filter { e -> e.value.team != Team.REFEREE }.forEach { p -> chatMessageService.sendActionBarMessage( p.key, placeHolderService.replacePlaceHolders( - language.nextPeriodReferee, p.key, this + language.nextPeriodReferee.text, p.key, this ) ) } @@ -173,7 +173,7 @@ class SoccerRefereeGameImpl constructor( refereeTeam.forEach { p -> chatMessageService.sendActionBarMessage( p, placeHolderService.replacePlaceHolders( - language.nextPeriodRefereeHint, p, this + language.nextPeriodRefereeHint.text, p, this ) ) } diff --git a/src/main/java/com/github/shynixn/blockball/impl/commandexecutor/BlockBallCommandExecutor.kt b/src/main/java/com/github/shynixn/blockball/impl/commandexecutor/BlockBallCommandExecutor.kt index 4de1bc00d..880e2cfdb 100644 --- a/src/main/java/com/github/shynixn/blockball/impl/commandexecutor/BlockBallCommandExecutor.kt +++ b/src/main/java/com/github/shynixn/blockball/impl/commandexecutor/BlockBallCommandExecutor.kt @@ -2,10 +2,7 @@ package com.github.shynixn.blockball.impl.commandexecutor import com.github.shynixn.blockball.BlockBallDependencyInjectionModule import com.github.shynixn.blockball.BlockBallLanguageImpl -import com.github.shynixn.blockball.contract.BlockBallLanguage -import com.github.shynixn.blockball.contract.GameService -import com.github.shynixn.blockball.contract.PlaceHolderService -import com.github.shynixn.blockball.contract.SoccerRefereeGame +import com.github.shynixn.blockball.contract.* import com.github.shynixn.blockball.entity.SoccerArena import com.github.shynixn.blockball.entity.TeamMeta import com.github.shynixn.blockball.enumeration.* @@ -17,6 +14,7 @@ import com.github.shynixn.mcutils.common.command.CommandBuilder import com.github.shynixn.mcutils.common.command.CommandMeta import com.github.shynixn.mcutils.common.command.CommandType import com.github.shynixn.mcutils.common.command.Validator +import com.github.shynixn.mcutils.common.language.reloadTranslation import com.github.shynixn.mcutils.common.repository.CacheRepository import com.github.shynixn.mcutils.common.selection.AreaHighlight import com.github.shynixn.mcutils.common.selection.AreaSelectionService @@ -39,8 +37,7 @@ class BlockBallCommandExecutor @Inject constructor( private val arenaRepository: CacheRepository, private val gameService: GameService, private val plugin: Plugin, - private val configurationService: ConfigurationService, - private val language: BlockBallLanguage, + private val language: Language, private val signService: SignService, private val selectionService: AreaSelectionService, private val placeHolderService: PlaceHolderService, @@ -81,7 +78,7 @@ class BlockBallCommandExecutor @Inject constructor( } override suspend fun message(sender: CommandSender, prevArgs: List, openArgs: List): String { - return language.maxLength20Characters + return language.maxLength20Characters.text } } private val gameMustNotExistValidator = object : Validator { @@ -93,7 +90,7 @@ class BlockBallCommandExecutor @Inject constructor( } override suspend fun message(sender: CommandSender, prevArgs: List, openArgs: List): String { - return language.gameAlreadyExistsMessage.format(openArgs[0]) + return language.gameAlreadyExistsMessage.text.format(openArgs[0]) } } private val gameMustExistValidator = object : Validator { @@ -105,7 +102,7 @@ class BlockBallCommandExecutor @Inject constructor( } override suspend fun message(sender: CommandSender, prevArgs: List, openArgs: List): String { - return language.gameDoesNotExistMessage.format(openArgs[0]) + return language.gameDoesNotExistMessage.text.format(openArgs[0]) } } private val teamValidator = object : Validator { @@ -120,7 +117,7 @@ class BlockBallCommandExecutor @Inject constructor( } override suspend fun message(sender: CommandSender, prevArgs: List, openArgs: List): String { - return language.teamDoesNotExistMessage.format(openArgs[0]) + return language.teamDoesNotExistMessage.text.format(openArgs[0]) } } @@ -145,7 +142,7 @@ class BlockBallCommandExecutor @Inject constructor( } override suspend fun message(sender: CommandSender, prevArgs: List, openArgs: List): String { - return language.teamDoesNotExistMessage.format(openArgs[0]) + return language.teamDoesNotExistMessage.text.format(openArgs[0]) } } @@ -157,7 +154,7 @@ class BlockBallCommandExecutor @Inject constructor( } override suspend fun message(sender: CommandSender, prevArgs: List, openArgs: List): String { - return language.selectionTypeDoesNotExistMessage + return language.selectionTypeDoesNotExistMessage.text } } @@ -169,7 +166,7 @@ class BlockBallCommandExecutor @Inject constructor( } override suspend fun message(sender: CommandSender, prevArgs: List, openArgs: List): String { - return language.gameTypeNotExistMessage + return language.gameTypeNotExistMessage.text } } @@ -181,7 +178,7 @@ class BlockBallCommandExecutor @Inject constructor( } override suspend fun message(sender: CommandSender, prevArgs: List, openArgs: List): String { - return language.selectionTypeDoesNotExistMessage + return language.selectionTypeDoesNotExistMessage.text } } @@ -193,20 +190,20 @@ class BlockBallCommandExecutor @Inject constructor( } override suspend fun message(sender: CommandSender, prevArgs: List, openArgs: List): String { - return language.signTypeDoesNotExistMessage + return language.signTypeDoesNotExistMessage.text } } init { val mcCart = CommandBuilder(plugin, coroutineExecutor, "blockball", chatMessageService) { - usage(language.commandUsage.translateChatColors()) - description(language.commandDescription) + usage(language.commandUsage.text.translateChatColors()) + description(language.commandDescription.text) aliases(plugin.config.getStringList("commands.blockball.aliases")) permission(Permission.COMMAND) - permissionMessage(language.noPermissionMessage.translateChatColors()) + permissionMessage(language.noPermissionMessage.text.translateChatColors()) subCommand("create") { permission(Permission.EDIT_GAME) - toolTip { language.commandCreateToolTip } + toolTip { language.commandCreateToolTip.text } builder().argument("name").validator(maxLengthValidator).validator(maxLengthValidator) .validator(gameMustNotExistValidator).tabs { listOf("") }.argument("displayName") .validator(remainingStringValidator).tabs { listOf("") } @@ -214,51 +211,51 @@ class BlockBallCommandExecutor @Inject constructor( } subCommand("delete") { permission(Permission.EDIT_GAME) - toolTip { language.commandDeleteToolTip } + toolTip { language.commandDeleteToolTip.text } builder().argument("name").validator(gameMustExistValidator).tabs(arenaTabs) .execute { sender, arena -> deleteArena(sender, arena) } } subCommand("list") { permission(Permission.EDIT_GAME) - toolTip { language.commandListToolTip } + toolTip { language.commandListToolTip.text } builder().execute { sender -> listArena(sender) } } subCommand("toggle") { permission(Permission.EDIT_GAME) - toolTip { language.commandToggleToolTip } + toolTip { language.commandToggleToolTip.text } builder().argument("name").validator(gameMustExistValidator).tabs(arenaTabs) .execute { sender, arena -> toggleGame(sender, arena) } } subCommand("join") { noPermission() - toolTip { language.commandJoinToolTip } + toolTip { language.commandJoinToolTip.text } builder().argument("name").validator(gameMustExistValidator).tabs(arenaTabs) - .executePlayer({ language.commandSenderHasToBePlayer }) { sender, arena -> + .executePlayer({ language.commandSenderHasToBePlayer.text }) { sender, arena -> joinGame( sender, arena.name ) }.argument("team").validator(teamValidator).tabs(teamTabs) - .executePlayer({ language.commandSenderHasToBePlayer }) { sender, arena, team -> + .executePlayer({ language.commandSenderHasToBePlayer.text }) { sender, arena, team -> joinGame(sender, arena.name, team) } } subCommand("leave") { noPermission() - toolTip { language.commandLeaveToolTip } - builder().executePlayer({ language.commandSenderHasToBePlayer }) { sender -> leaveGame(sender) } + toolTip { language.commandLeaveToolTip.text } + builder().executePlayer({ language.commandSenderHasToBePlayer.text }) { sender -> leaveGame(sender) } } helpCommand() subCommand("axe") { permission(Permission.EDIT_GAME) - toolTip { language.commandAxeToolTip } - builder().executePlayer({ language.commandSenderHasToBePlayer }) { player -> + toolTip { language.commandAxeToolTip.text } + builder().executePlayer({ language.commandSenderHasToBePlayer.text }) { player -> selectionService.addSelectionItemToInventory(player) - player.sendMessage(language.axeReceivedMessage) + language.sendMessage(language.axeReceivedMessage, player) } } subCommand("select") { permission(Permission.EDIT_GAME) - toolTip { language.commandSelectToolTip } + toolTip { language.commandSelectToolTip.text } builder().argument("name").validator(gameMustExistValidator).tabs(arenaTabs).argument("type") .validator(selectionTypeValidator).tabs { SelectionType.values().map { e -> @@ -266,13 +263,13 @@ class BlockBallCommandExecutor @Inject constructor( Locale.ENGLISH ) } - }.executePlayer({ language.commandSenderHasToBePlayer }) { player, arena, locationType -> + }.executePlayer({ language.commandSenderHasToBePlayer.text }) { player, arena, locationType -> setSelection(player, arena, locationType) } } subCommand("location") { permission(Permission.EDIT_GAME) - toolTip { language.commandSelectToolTip } + toolTip { language.commandSelectToolTip.text } builder().argument("name").validator(gameMustExistValidator).tabs(arenaTabs).argument("type") .validator(locationTypeValidator).tabs { LocationType.values().map { e -> @@ -280,15 +277,15 @@ class BlockBallCommandExecutor @Inject constructor( Locale.ENGLISH ) } - }.executePlayer({ language.commandSenderHasToBePlayer }) { player, arena, locationType -> + }.executePlayer({ language.commandSenderHasToBePlayer.text }) { player, arena, locationType -> setLocation(player, arena, locationType) } } subCommand("gamerule") { permission(Permission.EDIT_GAME) - toolTip { language.commandGameRuleToolTip } + toolTip { language.commandGameRuleToolTip.text } subCommand("gameType") { - toolTip { language.commandGameRuleToolTip } + toolTip { language.commandGameRuleToolTip.text } permission(Permission.EDIT_GAME) builder().argument("name").validator(gameMustExistValidator).tabs(arenaTabs).argument("value") .validator(gameTypeValidator).tabs { @@ -299,50 +296,50 @@ class BlockBallCommandExecutor @Inject constructor( } }.execute { sender, arena, gameType -> if (gameType == GameType.REFEREEGAME && !BlockBallDependencyInjectionModule.areLegacyVersionsIncluded) { - sender.sendMessage(language.gameTypeRefereeOnlyForPatreons) + language.sendMessage(language.gameTypeRefereeOnlyForPatreons, sender) return@execute } arena.gameType = gameType arenaRepository.save(arena) - sender.sendMessage(language.gameRuleChangedMessage) + language.sendMessage(language.gameRuleChangedMessage, sender) reloadArena(sender, arena) } } } subCommand("highlight") { permission(Permission.EDIT_GAME) - toolTip { language.commandHighlightToolTip } + toolTip { language.commandHighlightToolTip.text } builder().argument("name").validator(gameMustExistValidator).tabs(arenaTabs) - .executePlayer({ language.commandSenderHasToBePlayer }) { player, arena -> + .executePlayer({ language.commandSenderHasToBePlayer.text }) { player, arena -> setHighlights(player, arena) - player.sendMessage(language.toggleHighlightMessage) + language.sendMessage(language.toggleHighlightMessage, player) } } subCommand("inventory") { permission(Permission.EDIT_GAME) - toolTip { language.commandInventoryToolTip } + toolTip { language.commandInventoryToolTip.text } builder().argument("name").validator(gameMustExistValidator).tabs(arenaTabs).argument("team") .validator(teamMetaValidator).tabs(teamTabs) - .executePlayer({ language.commandSenderHasToBePlayer }) { player, arena, meta -> + .executePlayer({ language.commandSenderHasToBePlayer.text }) { player, arena, meta -> setInventory(player, arena, meta) } } subCommand("armor") { permission(Permission.EDIT_GAME) - toolTip { language.commandArmorToolTip } + toolTip { language.commandArmorToolTip.text } builder().argument("name").validator(gameMustExistValidator).tabs(arenaTabs).argument("team") .validator(teamMetaValidator).tabs(teamTabs) - .executePlayer({ language.commandSenderHasToBePlayer }) { player, arena, meta -> + .executePlayer({ language.commandSenderHasToBePlayer.text }) { player, arena, meta -> setArmor(player, arena, meta) } } subCommand("sign") { permission(Permission.EDIT_GAME) - toolTip { language.commandSignToolTip } + toolTip { language.commandSignToolTip.text } builder().argument("name").validator(gameMustExistValidator).tabs(arenaTabs).argument("type") .validator(signTypeValidator).tabs { listOf("join", "leave") } - .executePlayer({ language.commandSenderHasToBePlayer }) { player, arena, signType -> + .executePlayer({ language.commandSenderHasToBePlayer.text }) { player, arena, signType -> setSign(player, arena, signType) } } @@ -350,68 +347,68 @@ class BlockBallCommandExecutor @Inject constructor( permission(Permission.REFEREE_JOIN) subCommand("startgame") { permission(Permission.REFEREE_JOIN) - toolTip { language.commandRefereeStartGameToolTip } - builder().executePlayer({ language.commandSenderHasToBePlayer }) { player -> + toolTip { language.commandRefereeStartGameToolTip.text } + builder().executePlayer({ language.commandSenderHasToBePlayer.text }) { player -> startGameReferee(player) } } subCommand("stopgame") { permission(Permission.REFEREE_JOIN) - toolTip { language.commandRefereeStopGameToolTip } - builder().executePlayer({ language.commandSenderHasToBePlayer }) { player -> + toolTip { language.commandRefereeStopGameToolTip.text } + builder().executePlayer({ language.commandSenderHasToBePlayer.text }) { player -> stopGameReferee(player) } } subCommand("setball") { permission(Permission.REFEREE_JOIN) - toolTip { language.commandRefereeSetBallToolTip } - builder().executePlayer({ language.commandSenderHasToBePlayer }) { player -> + toolTip { language.commandRefereeSetBallToolTip.text } + builder().executePlayer({ language.commandSenderHasToBePlayer.text }) { player -> setBallToPlayerLocation(player) } } subCommand("whistleresume") { permission(Permission.REFEREE_JOIN) - toolTip { language.commandRefereeWhistleResumeToolTip } - builder().executePlayer({ language.commandSenderHasToBePlayer }) { player -> + toolTip { language.commandRefereeWhistleResumeToolTip.text } + builder().executePlayer({ language.commandSenderHasToBePlayer.text }) { player -> whistleRefereeResume(player) } } subCommand("whistlestop") { permission(Permission.REFEREE_JOIN) - toolTip { language.commandRefereeWhistleStopToolTip } - builder().executePlayer({ language.commandSenderHasToBePlayer }) { player -> + toolTip { language.commandRefereeWhistleStopToolTip.text } + builder().executePlayer({ language.commandSenderHasToBePlayer.text }) { player -> whistleRefereeStop(player) } } subCommand("freezetime") { permission(Permission.REFEREE_JOIN) - toolTip { language.commandRefereeFreezeTimeToolTip } - builder().executePlayer({ language.commandSenderHasToBePlayer }) { player -> + toolTip { language.commandRefereeFreezeTimeToolTip.text } + builder().executePlayer({ language.commandSenderHasToBePlayer.text }) { player -> freezeTimeReferee(player) } } subCommand("nextperiod") { permission(Permission.REFEREE_JOIN) - toolTip { language.commandRefereeNextPeriodToolTip } - builder().executePlayer({ language.commandSenderHasToBePlayer }) { player -> + toolTip { language.commandRefereeNextPeriodToolTip.text } + builder().executePlayer({ language.commandSenderHasToBePlayer.text }) { player -> nextPeriodReferee(player) } } } subCommand("placeholder") { permission(Permission.EDIT_GAME) - toolTip { language.commandPlaceHolderToolTip } + toolTip { language.commandPlaceHolderToolTip.text } builder().argument("placeholder").tabs { listOf("<>") }.execute { sender, placeHolder -> val evaluatedValue = placeHolderService.replacePlaceHolders(placeHolder) - sender.sendMessage(language.commandPlaceHolderMessage.format(evaluatedValue)) - }.executePlayer({ language.commandSenderHasToBePlayer }) { player, placeHolder -> + language.sendMessage(language.commandPlaceHolderMessage, sender, evaluatedValue) + }.executePlayer({ language.commandSenderHasToBePlayer.text }) { player, placeHolder -> val evaluatedValue = placeHolderService.replacePlaceHolders(placeHolder, player) - player.sendMessage(language.commandPlaceHolderMessage.format(evaluatedValue)) + language.sendMessage(language.commandPlaceHolderMessage, player, evaluatedValue) } } subCommand("reload") { permission(Permission.EDIT_GAME) - toolTip { language.commandReloadToolTip } + toolTip { language.commandReloadToolTip.text } builder().execute { sender -> reloadArena(sender, null) }.argument("name").validator(gameMustExistValidator).tabs(arenaTabs).execute { sender, arena -> @@ -435,7 +432,7 @@ class BlockBallCommandExecutor @Inject constructor( ball.isInteractable = false } - player.sendMessage(language.refereeBallDisabled) + language.sendMessage(language.refereeBallDisabled, player) } private fun whistleRefereeStop(player: Player) { @@ -446,7 +443,7 @@ class BlockBallCommandExecutor @Inject constructor( ball.isInteractable = false } - player.sendMessage(language.refereeBallDisabled) + language.sendMessage(language.refereeBallDisabled, player) } private fun whistleRefereeResume(player: Player) { @@ -461,7 +458,7 @@ class BlockBallCommandExecutor @Inject constructor( ball.isInteractable = true } - player.sendMessage(language.refereeBallEnabled) + language.sendMessage(language.refereeBallEnabled, player) } private fun nextPeriodReferee(player: Player) { @@ -482,7 +479,7 @@ class BlockBallCommandExecutor @Inject constructor( if (game is SoccerRefereeGame) { game.stopGame() - player.sendMessage(language.refereeStoppedGame) + language.sendMessage(language.refereeStoppedGame, player) } } @@ -492,7 +489,7 @@ class BlockBallCommandExecutor @Inject constructor( if (game is SoccerRefereeGame) { game.setLobbyCountdownActive(true) game.isTimerBlockerEnabled = true - player.sendMessage(language.refereeStartedGame) + language.sendMessage(language.refereeStartedGame, player) } } @@ -501,28 +498,28 @@ class BlockBallCommandExecutor @Inject constructor( arena.name = name arena.displayName = displayName arenaRepository.save(arena) - sender.sendMessage(language.gameCreatedMessage.format(name)) + language.sendMessage(language.gameCreatedMessage, sender, name) } private suspend fun deleteArena(sender: CommandSender, arena: SoccerArena) { arenaRepository.delete(arena) val runningGame = gameService.getAll().firstOrNull { e -> e.arena.name.equals(arena.name, true) } runningGame?.close() - sender.sendMessage(language.deletedGameMessage.format(arena.name)) + language.sendMessage(language.deletedGameMessage, sender, arena.name) } private suspend fun toggleGame(sender: CommandSender, arena: SoccerArena) { try { arena.enabled = !arena.enabled gameService.reload(arena) - sender.sendMessage(language.enabledArenaMessage.format(arena.enabled.toString())) + language.sendMessage(language.enabledArenaMessage, sender, arena.enabled.toString()) } catch (e: SoccerGameException) { arena.enabled = false - sender.sendMessage(language.failedToReloadMessage.format(e.arena.name, e.message)) + language.sendMessage(language.failedToReloadMessage, sender, e.arena.name, e.message!!) return } arenaRepository.save(arena) - sender.sendMessage(language.reloadedGameMessage.format(arena.name)) + language.sendMessage(language.reloadedGameMessage, sender, arena.name) } private suspend fun setInventory(player: Player, arena: SoccerArena, teamMetadata: TeamMeta) { @@ -532,7 +529,7 @@ class BlockBallCommandExecutor @Inject constructor( yamlConfiguration.saveToString() }.toTypedArray() arenaRepository.save(arena) - player.sendMessage(language.updatedInventoryMessage) + language.sendMessage(language.updatedInventoryMessage, player) } private suspend fun setArmor(player: Player, arena: SoccerArena, teamMeta: TeamMeta) { @@ -542,7 +539,7 @@ class BlockBallCommandExecutor @Inject constructor( yamlConfiguration.saveToString() }.toTypedArray() arenaRepository.save(arena) - player.sendMessage(language.updatedArmorMessage) + language.sendMessage(language.updatedArmorMessage, player) } private fun CommandBuilder.permission(permission: Permission) { @@ -617,7 +614,7 @@ class BlockBallCommandExecutor @Inject constructor( val game = gameService.getByName(name) if (game == null) { - player.sendMessage(language.gameDoesNotExistMessage.format(name)) + language.sendMessage(language.gameDoesNotExistMessage, player, name) return } @@ -627,18 +624,18 @@ class BlockBallCommandExecutor @Inject constructor( ) ) && !player.hasPermission(Permission.JOIN.permission.replace("[name]", "*")) ) { - player.sendMessage(language.noPermissionForGameMessage.format(game.arena.name)) + language.sendMessage(language.noPermissionForGameMessage, player, game.arena.name) return } if (team != null && team == Team.REFEREE) { if (game !is SoccerRefereeGame) { - player.sendMessage(language.gameIsNotARefereeGame) + language.sendMessage(language.gameIsNotARefereeGame, player) return } if (!player.hasPermission(Permission.REFEREE_JOIN.permission)) { - player.sendMessage(language.noPermissionForGameMessage.format(game.arena.name)) + language.sendMessage(language.noPermissionForGameMessage, player, game.arena.name) return } } @@ -654,16 +651,16 @@ class BlockBallCommandExecutor @Inject constructor( } if (joinResult == JoinResult.GAME_FULL || joinResult == JoinResult.GAME_ALREADY_RUNNING) { - player.sendMessage(language.gameIsFullMessage) + language.sendMessage(language.gameIsFullMessage, player) return } if (joinResult == JoinResult.SUCCESS_BLUE) { - player.sendMessage(language.joinTeamBlueMessage) + language.sendMessage(language.joinTeamBlueMessage, player) } else if (joinResult == JoinResult.SUCCESS_RED) { - player.sendMessage(language.joinTeamRedMessage) + language.sendMessage(language.joinTeamRedMessage, player) } else if (joinResult == JoinResult.SUCCESS_REFEREE) { - player.sendMessage(language.joinTeamRefereeMessage) + language.sendMessage(language.joinTeamRefereeMessage, player) } } @@ -678,7 +675,7 @@ class BlockBallCommandExecutor @Inject constructor( } if (leftGame) { - player.sendMessage(language.leftGameMessage) + language.sendMessage(language.leftGameMessage, player) } } @@ -702,7 +699,7 @@ class BlockBallCommandExecutor @Inject constructor( } arenaRepository.save(arena) - player.sendMessage(language.selectionSetMessage.format(locationType.name.lowercase())) + language.sendMessage(language.selectionSetMessage, player, locationType.name.lowercase()) } private suspend fun setSelection(player: Player, arena: SoccerArena, selectionType: SelectionType) { @@ -711,11 +708,11 @@ class BlockBallCommandExecutor @Inject constructor( if (selectionType == SelectionType.FIELD || selectionType == SelectionType.RED_GOAL || selectionType == SelectionType.BLUE_GOAL) { if (selectionLeft == null) { - player.sendMessage(language.noLeftClickSelectionMessage) + language.sendMessage(language.noLeftClickSelectionMessage, player) return } if (selectionRight == null) { - player.sendMessage(language.noRightClickSelectionMessage) + language.sendMessage(language.noRightClickSelectionMessage, player) return } @@ -736,7 +733,7 @@ class BlockBallCommandExecutor @Inject constructor( } arenaRepository.save(arena) - player.sendMessage(language.selectionSetMessage.format(selectionType.name.lowercase())) + language.sendMessage(language.selectionSetMessage, player, selectionType.name.lowercase()) } /** @@ -765,7 +762,7 @@ class BlockBallCommandExecutor @Inject constructor( private suspend fun setSign(sender: Player, arena: SoccerArena, signType: SignType) { if (signType == SignType.JOIN) { - sender.sendMessage(language.rightClickOnSignMessage) + language.sendMessage(language.rightClickOnSignMessage, sender) signService.addSignByRightClick(sender) { sign -> sign.let { it.line1 = "%blockball_lang_joinSignLine1%" @@ -787,11 +784,11 @@ class BlockBallCommandExecutor @Inject constructor( plugin.launch { arenaRepository.save(arena) gameService.reload(arena) - sender.sendMessage(language.addedSignMessage) + language.sendMessage(language.addedSignMessage, sender) } } } else if (signType == SignType.LEAVE) { - sender.sendMessage(language.rightClickOnSignMessage) + language.sendMessage(language.rightClickOnSignMessage, sender) signService.addSignByRightClick(sender) { sign -> sign.let { it.line1 = "%blockball_lang_leaveSignLine1%" @@ -813,7 +810,7 @@ class BlockBallCommandExecutor @Inject constructor( plugin.launch { arenaRepository.save(arena) gameService.reload(arena) - sender.sendMessage(language.addedSignMessage) + language.sendMessage(language.addedSignMessage, sender) } } } @@ -825,26 +822,25 @@ class BlockBallCommandExecutor @Inject constructor( arenaRepository.clearCache() } catch (e: SoccerGameException) { e.arena.enabled = false - sender.sendMessage(language.failedToReloadMessage.format(e.arena.name, e.message)) + language.sendMessage(language.failedToReloadMessage, sender, e.arena.name, e.message!!) return } if (arena == null) { plugin.reloadConfig() - val languageDef = configurationService.findValue("language") - plugin.reloadTranslation(languageDef, BlockBallLanguageImpl::class.java, "en_us", "es_es") - plugin.logger.log(Level.INFO, "Loaded language file $languageDef.properties.") + plugin.reloadTranslation(language, BlockBallLanguageImpl::class.java) + plugin.logger.log(Level.INFO, "Loaded language file.") try { arenaRepository.clearCache() gameService.reloadAll() } catch (e: SoccerGameException) { e.arena.enabled = false - sender.sendMessage(language.failedToReloadMessage.format(e.arena.name, e.message)) + language.sendMessage(language.failedToReloadMessage, sender, e.arena.name, e.message!!) return } - sender.sendMessage(language.reloadedAllGamesMessage) + language.sendMessage(language.reloadedAllGamesMessage, sender) return } @@ -852,10 +848,10 @@ class BlockBallCommandExecutor @Inject constructor( arenaRepository.clearCache() gameService.reload(arena) } catch (e: SoccerGameException) { - sender.sendMessage(language.failedToReloadMessage.format(e.arena.name, e.message)) + language.sendMessage(language.failedToReloadMessage, sender, e.arena.name, e.message!!) return } - sender.sendMessage(language.reloadedGameMessage.format(arena.name)) + language.sendMessage(language.reloadedGameMessage, sender, arena.name) return } diff --git a/src/main/java/com/github/shynixn/blockball/impl/listener/GameListener.kt b/src/main/java/com/github/shynixn/blockball/impl/listener/GameListener.kt index 1b3fec908..c146ac43e 100644 --- a/src/main/java/com/github/shynixn/blockball/impl/listener/GameListener.kt +++ b/src/main/java/com/github/shynixn/blockball/impl/listener/GameListener.kt @@ -46,14 +46,14 @@ class GameListener @Inject constructor( */ @EventHandler fun onPacketEvent(event: PacketAsyncEvent) { - if (event.packetType != PacketInType.USEENTITY) { + val packet = event.packet + + if (packet !is PacketInInteractEntity) { return } plugin.launch { val game = gameService.getByPlayer(event.player) ?: return@launch - - val packet = event.packet as PacketInInteractEntity val ball = soccerBallFactory.findBallByEntityId(packet.entityId) ?: return@launch if (game.ball != ball) { 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 fea602936..e5e56090b 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 @@ -2,10 +2,7 @@ package com.github.shynixn.blockball.impl.service -import com.github.shynixn.blockball.contract.SoccerGame -import com.github.shynixn.blockball.contract.GameService -import com.github.shynixn.blockball.contract.PlaceHolderService -import com.github.shynixn.blockball.contract.StatsService +import com.github.shynixn.blockball.contract.* import com.github.shynixn.blockball.entity.PlayerInformation import com.github.shynixn.blockball.entity.TeamMeta import com.github.shynixn.mcutils.database.api.CachePlayerRepository @@ -22,9 +19,10 @@ class DependencyPlaceHolderServiceImpl @Inject constructor( private val plugin: Plugin, private val gameService: GameService, private val statsService: StatsService, + private val language: Language, cachePlayerRepository: CachePlayerRepository, ) : PlaceholderExpansion(), PlaceHolderService { - private val placeHolderService = PlaceHolderServiceImpl(gameService, cachePlayerRepository, statsService) + private val placeHolderService = PlaceHolderServiceImpl(gameService, cachePlayerRepository, statsService, language) private var registered: Boolean = false init { 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 259ebf779..17c8be5bb 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 @@ -11,7 +11,6 @@ import com.github.shynixn.blockball.impl.SoccerHubGameImpl import com.github.shynixn.blockball.impl.SoccerMiniGameImpl import com.github.shynixn.blockball.impl.SoccerRefereeGameImpl import com.github.shynixn.blockball.impl.exception.SoccerGameException -import com.github.shynixn.mcutils.common.ConfigurationService import com.github.shynixn.mcutils.common.Vector3d import com.github.shynixn.mcutils.common.chat.ChatMessageService import com.github.shynixn.mcutils.common.command.CommandService @@ -31,7 +30,6 @@ import kotlin.math.min class GameServiceImpl @Inject constructor( private val arenaRepository: Repository, - private val configurationService: ConfigurationService, private val plugin: Plugin, private val playerDataRepository: PlayerDataRepository, private val placeHolderService: PlaceHolderService, @@ -42,7 +40,7 @@ class GameServiceImpl @Inject constructor( private val scoreboardService: ScoreboardService, private val commandService: CommandService, private val soccerBallFactory: SoccerBallFactory, - private val language: BlockBallLanguage, + private val language: Language, private val signService: SignService ) : GameService, Runnable { private val games = ArrayList() @@ -103,7 +101,6 @@ class GameServiceImpl @Inject constructor( packetService, scoreboardService, soccerBallFactory, - chatMessageService, commandService ) @@ -231,7 +228,7 @@ class GameServiceImpl @Inject constructor( if (arena.gameType == GameType.REFEREEGAME && !BlockBallDependencyInjectionModule.areLegacyVersionsIncluded) { throw SoccerGameException( arena, - language.gameTypeRefereeOnlyForPatreons + language.gameTypeRefereeOnlyForPatreons.text ) } if (arena.meta.ballMeta.spawnpoint == null) { diff --git a/src/main/java/com/github/shynixn/blockball/impl/service/HubGameForcefieldServiceImpl.kt b/src/main/java/com/github/shynixn/blockball/impl/service/HubGameForcefieldServiceImpl.kt index e024f3cab..a9b3f35d0 100644 --- a/src/main/java/com/github/shynixn/blockball/impl/service/HubGameForcefieldServiceImpl.kt +++ b/src/main/java/com/github/shynixn/blockball/impl/service/HubGameForcefieldServiceImpl.kt @@ -1,9 +1,6 @@ package com.github.shynixn.blockball.impl.service -import com.github.shynixn.blockball.contract.BlockBallLanguage -import com.github.shynixn.blockball.contract.GameService -import com.github.shynixn.blockball.contract.HubGameForcefieldService -import com.github.shynixn.blockball.contract.PlaceHolderService +import com.github.shynixn.blockball.contract.* import com.github.shynixn.blockball.entity.InteractionCache import com.github.shynixn.blockball.enumeration.GameType import com.github.shynixn.mcutils.common.chat.ChatMessageService @@ -21,7 +18,7 @@ import org.bukkit.entity.Player class HubGameForcefieldServiceImpl @Inject constructor( private val gameService: GameService, private val placeholderService: PlaceHolderService, - private val language: BlockBallLanguage, + private val language: Language, private val chatMessageService: ChatMessageService ) : HubGameForcefieldService { private val cache = HashMap() @@ -40,7 +37,7 @@ class HubGameForcefieldServiceImpl @Inject constructor( ) ) { gameInternal.leave(player) - player.sendMessage(language.leftGameMessage) + language.sendMessage(language.leftGameMessage, player) } return } @@ -81,7 +78,7 @@ class HubGameForcefieldServiceImpl @Inject constructor( it.components = mutableListOf( TextComponent().also { it.text = placeholderService.replacePlaceHolders( - language.hubGameJoinHeader, + language.hubGameJoinHeader.text, player, game, null, @@ -90,7 +87,7 @@ class HubGameForcefieldServiceImpl @Inject constructor( }, TextComponent().also { it.text = placeholderService.replacePlaceHolders( - language.hubGameJoinRed, + language.hubGameJoinRed.text, player, game, null, @@ -103,7 +100,7 @@ class HubGameForcefieldServiceImpl @Inject constructor( }, TextComponent().also { it.text = placeholderService.replacePlaceHolders( - language.hubGameJoinBlue, + language.hubGameJoinBlue.text, player, game, null, diff --git a/src/main/java/com/github/shynixn/blockball/impl/service/PlaceHolderServiceImpl.kt b/src/main/java/com/github/shynixn/blockball/impl/service/PlaceHolderServiceImpl.kt index 6e6241426..2c9b151fb 100644 --- a/src/main/java/com/github/shynixn/blockball/impl/service/PlaceHolderServiceImpl.kt +++ b/src/main/java/com/github/shynixn/blockball/impl/service/PlaceHolderServiceImpl.kt @@ -15,7 +15,8 @@ import org.bukkit.entity.Player class PlaceHolderServiceImpl @Inject constructor( private val gameService: GameService, private val playerDataRepository: CachePlayerRepository, - private val statsService: StatsService + private val statsService: StatsService, + private val language: Language ) : PlaceHolderService { private val gamePlayerHolderFunctions = HashMap String)>() private val teamPlaceHolderFunctions = HashMap String)>() @@ -65,9 +66,9 @@ class PlaceHolderServiceImpl @Inject constructor( val player = game.lastInteractedEntity if (player != null && player is Player) { if (game.redTeam.contains(player)) { - BlockBallLanguageImpl.teamRedDisplayName + language.teamRedDisplayName.text } else if (game.blueTeam.contains(player)) { - BlockBallLanguageImpl.teamBlueDisplayName + language.teamBlueDisplayName.text } else { "" } @@ -79,11 +80,11 @@ class PlaceHolderServiceImpl @Inject constructor( gamePlayerHolderFunctions[PlaceHolder.GAME_STATE] = { game -> game.status.name } gamePlayerHolderFunctions[PlaceHolder.GAME_STATE_DISPLAYNAME] = { game -> if (game.status == GameState.JOINABLE) { - BlockBallLanguageImpl.gameStatusJoinAble + language.gameStatusJoinAble.text } else if (game.status == GameState.DISABLED) { - BlockBallLanguageImpl.gameStatusDisabled + language.gameStatusDisabled.text } else { - BlockBallLanguageImpl.gameStatusRunning + language.gameStatusRunning.text } } gamePlayerHolderFunctions[PlaceHolder.GAME_REMAININGPLAYERS_TO_START] = { game -> diff --git a/src/main/resources/arena_sample.yml b/src/main/resources/arena_sample.yml index 396a53087..9f954d21b 100644 --- a/src/main/resources/arena_sample.yml +++ b/src/main/resources/arena_sample.yml @@ -218,10 +218,12 @@ meta: interactionHitBoxSize: 2.0 # The ball uses an invisible slime as a hitbox. You can increase this hitbox to make it easier to hit the ball. kickPassHitBoxSize: 5.0 - # Delay in ticks between each punch of the ball. + # The delay between interacting with the ball and the actual execution of the ball movement in ticks. kickPassDelay: 5 - # Delay in ticks between running into the ball. + # Cooldown in ticks how often the ball accepts new movement inputs e.g. clicks, running into. interactionCoolDown: 20 + # Cooldown in milliseconds how often a player can send movement inputs to the ball e.g. clicks, running into. + interactionCoolDownPerPlayerMs: 80 # Should the ball play a rotation animation. rotating: true # Should left clicks be enabled? diff --git a/src/main/resources/lang/en_us.properties b/src/main/resources/lang/en_us.properties deleted file mode 100644 index 2b477fd3f..000000000 --- a/src/main/resources/lang/en_us.properties +++ /dev/null @@ -1,112 +0,0 @@ -commandUsage=&0&l[&f&lBlockBall&0&l]&7 Use /blockball help to see more info about the plugin. -commandDescription=All commands for the BlockBall plugin. -gameAlreadyExistsMessage=&0&l[&f&lBlockBall&0&l]&c Game %1$1s already exists. -maxLength20Characters=&0&l[&f&lBlockBall&0&l]&c The text length has to be less than 20 characters. -gameDoesNotExistMessage=&0&l[&f&lBlockBall&0&l]&c Game %1$1s does not exist. -teamDoesNotExistMessage=&0&l[&f&lBlockBall&0&l]&c Team %1$1s does not exist. -gameTypeNotExistMessage=&0&l[&f&lBlockBall&0&l]&c GameType %1$1s does not exist. -selectionTypeDoesNotExistMessage=&0&l[&f&lBlockBall&0&l]&c This selection type is not known. -signTypeDoesNotExistMessage=&0&l[&f&lBlockBall&0&l]&c This sign type is not known. -noPermissionForGameMessage=&0&l[&f&lBlockBall&0&l]&c You do not have permission to join game %1$1s. -noPermissionMessage=&0&l[&f&lBlockBall&0&l]&c You do not have permission. -commandSenderHasToBePlayer=&0&l[&f&lBlockBall&0&l]&c The command sender has to be a player! -gameCreatedMessage=&0&l[&f&lBlockBall&0&l]&7 Created game %1$1s. -deletedGameMessage=&0&l[&f&lBlockBall&0&l]&7 Deleted game %1$1s. -gameIsFullMessage=&0&l[&f&lBlockBall&0&l]&c Game is already full. -joinTeamRedMessage=&0&l[&f&lBlockBall&0&l]&7 Successfully joined team red. -joinTeamBlueMessage=&0&l[&f&lBlockBall&0&l]&7 Successfully joined team blue. -leftGameMessage=&0&l[&f&lBlockBall&0&l]&7 Left the game. -selectionSetMessage=&0&l[&f&lBlockBall&0&l]&7 Selection %1$1s was set. -enabledArenaMessage=&0&l[&f&lBlockBall&0&l]&7 Game enable state was set to %1$1s. -reloadedAllGamesMessage=&0&l[&f&lBlockBall&0&l]&7 Reloaded all games. -reloadedGameMessage=&0&l[&f&lBlockBall&0&l]&7 Reloaded game %1$1s. -updatedInventoryMessage=&0&l[&f&lBlockBall&0&l]&7 Updated inventory of game. -updatedArmorMessage=&0&l[&f&lBlockBall&0&l]&7 Updated armor of game. -gameRuleChangedMessage=&0&l[&f&lBlockBall&0&l]&7 Updated a gamerule. -rightClickOnSignMessage=&0&l[&f&lBlockBall&0&l]&7 RightClick on a sign to convert it into a game sign. -addedSignMessage=&0&l[&f&lBlockBall&0&l]&7 A sign was added to the game. -noLeftClickSelectionMessage=&0&l[&f&lBlockBall&0&l]&c You need to select a location using the BlockBall axe with left click. -noRightClickSelectionMessage=&0&l[&f&lBlockBall&0&l]&c You need to select a location using the BlockBall axe with right click. -toggleHighlightMessage=&0&l[&f&lBlockBall&0&l]&7 Toggled highlighting the important areas. -axeReceivedMessage=&0&l[&f&lBlockBall&0&l]&7 The BlockBall axe has been added to your inventory. -bossBarMessage=&cTeam Red %blockball_game_redScore% : &9%blockball_game_blueScore% Team Blue -hologramMessage=&cTeam Red %blockball_game_redScore% : &9Team Blue %blockball_game_blueScore% -scoreRedTitle=&c%blockball_game_redScore% : &9%blockball_game_blueScore% -scoreRedSubTitle=%1$1s scored for &cTeam Red. -scoreRedFadeIn=20 -scoreRedStay=60 -scoreRedFadeOut=20 -scoreBlueTitle=&9%blockball_game_blueScore% : &c%blockball_game_redScore% -scoreBlueSubTitle=%1$1s scored for &9Team Blue. -scoreBlueFadeIn=20 -scoreBlueStay=60 -scoreBlueFadeOut=20 -winRedTitle=&cTeam Red -winRedSubTitle=&cTeam Red &ahas won the match -winRedFadeIn=20 -winRedStay=60 -winRedFadeOut=20 -winBlueTitle=&9Team Blue -winBlueSubTitle=&9Team Blue &ahas won the match -winBlueFadeIn=20 -winBlueStay=60 -winBlueFadeOut=20 -winDrawTitle=&fDraw -winDrawSubTitle=&aThe game has ended in a draw -winDrawFadeIn=20 -winDrawStay=60 -winDrawFadeOut=20 -gameStatusJoinAble=&aJoin -gameStatusDisabled=&4Disabled -gameStatusRunning=&1Running -hubGameJoinHeader=&0&l[&f&lBlockBall&0&l]&7 Click on the team to join the match. -hubGameJoinRed=&0&l[&f&lBlockBall&0&l]&7 &c[Team Red] -hubGameJoinBlue=&0&l[&f&lBlockBall&0&l]&7 &9[Team Blue] -commandCreateToolTip=Creates a new arena for a BlockBall game. -commandDeleteToolTip=Deletes a BlockBall game. -commandListToolTip=Lists all games you have created. -commandToggleToolTip=Enables or disables your game. If a game is disabled, nobody can join. -commandJoinToolTip=Lets the player executing the command join the game. The optional team argument allows to directly join a specific team. If the team is full, the other team will be chosen. If no team is specified, a random team will be selected. -commandLeaveToolTip=Lets the player executing the command leave the game. -commandSelectionToolTip=Updates a location selection of a part of the arena. -commandInventoryToolTip=Copies the inventory of the player executing the command. This copy will be applied to players when they join a game. -commandArmorToolTip=Copies the armor inventory of the player executing the command. This copy will be applied to players when they join a game. -commandSignToolTip=Enables the player to add a specific sign by right-clicking any sign. You can remove signs by simply breaking the block. -commandReloadToolTip=Allows to reload all games or a specific single one. -commandAxeToolTip=Gives you the BlockBall selection axe. -commandHighlightToolTip=Toggles highlighting the important areas of your arena. -commandSelectToolTip=Sets a selected location for your arena. -commandGameRuleToolTip=Sets a gamerule in BlockBall. -joinSignLine1=&0&l[&f&lBlockBall&0&l]&7 -joinSignLine2=%blockball_game_stateDisplayName% -joinSignLine3=%blockball_game_players%/%blockball_game_maxPlayers% -joinSignLine4= -leaveSignLine1=&0&l[&f&lBlockBall&0&l]&7 -leaveSignLine2=&fLeave -leaveSignLine3=%blockball_game_players%/%blockball_game_maxPlayers% -leaveSignLine4= -failedToReloadMessage=&0&l[&f&lBlockBall&0&l]&7 &cFailed to reload arena %1$1s. Recommended action: &e%2$1s -teamRedDisplayName=Team Red -teamBlueDisplayName=Team Blue -gameIsNotARefereeGame=&0&l[&f&lBlockBall&0&l]&c This game is not a game where you can use a referee. Convert the game to a referee game first. -gameTypeRefereeOnlyForPatreons=&0&l[&f&lBlockBall&0&l]&c The game type where you can have a referee requires the premium version of BlockBall. Obtainable via https://www.patreon.com/Shynixn. -joinTeamRefereeMessage=&0&l[&f&lBlockBall&0&l]&7 Successfully joined team referee. -waitingForRefereeToStart=Waiting for the referee to start the game... -waitingForRefereeToStartHint=Execute &a/blockball referee startgame &fto start the lobby timer. -nextPeriodReferee=This period has ended. You are now in overtime. -nextPeriodRefereeHint=This period has ended. Execute &a/blockball referee nextperiod. -whistleTimeOutReferee=Waiting for the referee to resume the game... -whistleTimeOutRefereeHint=You can resume the match by executing &a/blockball referee whistleresume. -refereeStartedGame=&0&l[&f&lBlockBall&0&l]&7 You have started the game. -refereeStoppedGame=&0&l[&f&lBlockBall&0&l]&7 You have stopped the game and transitioned to the last configured period. -refereeBallEnabled=&0&l[&f&lBlockBall&0&l]&7 Players can kick the ball now. -refereeBallDisabled=&0&l[&f&lBlockBall&0&l]&7 Players can no longer kick the ball. -commandRefereeStartGameToolTip=Starts the game. -commandRefereeStopGameToolTip=Transitions the game to the final period. Executing this command again stops it. -commandRefereeWhistleResumeToolTip=Resumes the game and sets the ball interactable. -commandRefereeWhistleStopToolTip=Stops the game and sets the ball inactive. -commandRefereeFreezeTimeToolTip=Freezes the countdown and sets the ball inactive. -commandRefereeSetBallToolTip=Teleports the ball to the position of the referee. -commandRefereeNextPeriodToolTip=Transitions to the next configured period. -commandPlaceHolderToolTip=Resolves a given placeholder. -commandPlaceHolderMessage=Evaluated placeholder: %1$1s diff --git a/src/main/resources/lang/en_us.yml b/src/main/resources/lang/en_us.yml new file mode 100644 index 000000000..489e0fe77 --- /dev/null +++ b/src/main/resources/lang/en_us.yml @@ -0,0 +1,308 @@ +# All language key identifiers. +gameAlreadyExistsMessage: + # Available types: "CHAT", "TITLE", "ACTIONBAR", "HIDDEN". + # Please notice that some messages do only support chat. + type: "CHAT" + # The primary text to be sent. + text: "&0&l[&f&lBlockBall&0&l]&c Game %1$1s already exists." + # Only available for type "TITLE". Adds a subTitle. + subTitle: "" + # Only available for type: "TITLE". Adds a fade in effect. + fadeInTicks: 20 + # Only available for type: "TITLE". Adds a stay effect. + stayTicks: 60 + # Only available for type: "TITLE". Adds a fade out effect. + fadeOutTicks: 20 +commandUsage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Use /blockball help to see more info about the plugin." +commandDescription: + type: "CHAT" + text: "All commands for the BlockBall plugin." +maxLength20Characters: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c The text length has to be less than 20 characters." +gameDoesNotExistMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c Game %1$1s does not exist." +teamDoesNotExistMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c Team %1$1s does not exist." +gameTypeNotExistMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c GameType %1$1s does not exist." +selectionTypeDoesNotExistMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c This selection type is not known." +signTypeDoesNotExistMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c This sign type is not known." +noPermissionForGameMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c You do not have permission to join game %1$1s." +noPermissionMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c You do not have permission." +commandSenderHasToBePlayer: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c The command sender has to be a player!" +gameCreatedMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Created game %1$1s." +deletedGameMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Deleted game %1$1s." +gameIsFullMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c Game is already full." +joinTeamRedMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Successfully joined team red." +joinTeamBlueMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Successfully joined team blue." +leftGameMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Left the game." +selectionSetMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Selection %1$1s was set." +enabledArenaMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Game enable state was set to %1$1s." +reloadedAllGamesMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Reloaded all games." +reloadedGameMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Reloaded game %1$1s." +updatedInventoryMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Updated inventory of game." +updatedArmorMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Updated armor of game." +gameRuleChangedMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Updated a gamerule." +rightClickOnSignMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 RightClick on a sign to convert it into a game sign." +addedSignMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 A sign was added to the game." +noLeftClickSelectionMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c You need to select a location using the BlockBall axe with left click." +noRightClickSelectionMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c You need to select a location using the BlockBall axe with right click." +toggleHighlightMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Toggled highlighting the important areas." +axeReceivedMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 The BlockBall axe has been added to your inventory." +bossBarMessage: + type: "BOSSBAR" + text: "&cTeam Red %blockball_game_redScore% : &9%blockball_game_blueScore% Team Blue" +hologramMessage: + type: "HOLOGRAM" + text: "&cTeam Red %blockball_game_redScore% : &9Team Blue %blockball_game_blueScore%" +scoreRed: + type: "TITLE" + text: "&c%blockball_game_redScore% : &9%blockball_game_blueScore%" + subTitle: "%1$1s scored for &cTeam Red." + fadeInTicks: 20 + stayTicks: 60 + fadeOutTicks: 20 +scoreBlue: + type: "TITLE" + text: "&9%blockball_game_blueScore% : &c%blockball_game_redScore%" + subTitle: "%1$1s scored for &9Team Blue." + fadeInTicks: 20 + stayTicks: 60 + fadeOutTicks: 20 +winRed: + type: "TITLE" + text: "&cTeam Red" + subTitle: "&cTeam Red &ahas won the match" + fadeInTicks: 20 + stayTicks: 60 + fadeOutTicks: 20 +winBlue: + type: "TITLE" + text: "&9Team Blue" + subTitle: "&9Team Blue &ahas won the match" + fadeInTicks: 20 + stayTicks: 60 + fadeOutTicks: 20 +winDraw: + type: "TITLE" + text: "&fDraw" + subTitle: "&aThe game has ended in a draw" + fadeInTicks: 20 + stayTicks: 60 + fadeOutTicks: 20 +gameStatusJoinAble: + type: "CHAT" + text: "&aJoin" +gameStatusDisabled: + type: "CHAT" + text: "&4Disabled" +gameStatusRunning: + type: "CHAT" + text: "&1Running" +hubGameJoinHeader: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Click on the team to join the match." +hubGameJoinRed: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 &c[Team Red]" +hubGameJoinBlue: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 &9[Team Blue]" +commandCreateToolTip: + type: "CHAT" + text: "Creates a new arena for a BlockBall game." +commandDeleteToolTip: + type: "CHAT" + text: "Deletes a BlockBall game." +commandListToolTip: + type: "CHAT" + text: "Lists all games you have created." +commandToggleToolTip: + type: "CHAT" + text: "Enables or disables your game. If a game is disabled, nobody can join." +commandJoinToolTip: + type: "CHAT" + text: "Lets the player executing the command join the game. The optional team argument allows to directly join a specific team. If the team is full, the other team will be chosen. If no team is specified, a random team will be selected." +commandLeaveToolTip: + type: "CHAT" + text: "Lets the player executing the command leave the game." +commandSelectionToolTip: + type: "CHAT" + text: "Updates a location selection of a part of the arena." +commandInventoryToolTip: + type: "CHAT" + text: "Copies the inventory of the player executing the command. This copy will be applied to players when they join a game." +commandArmorToolTip: + type: "CHAT" + text: "Copies the armor inventory of the player executing the command. This copy will be applied to players when they join a game." +commandSignToolTip: + type: "CHAT" + text: "Enables the player to add a specific sign by right-clicking any sign. You can remove signs by simply breaking the block." +commandReloadToolTip: + type: "CHAT" + text: "Allows to reload all games or a specific single one." +commandAxeToolTip: + type: "CHAT" + text: "Gives you the BlockBall selection axe." +commandHighlightToolTip: + type: "CHAT" + text: "Toggles highlighting the important areas of your arena." +commandSelectToolTip: + type: "CHAT" + text: "Sets a selected location for your arena." +commandGameRuleToolTip: + type: "CHAT" + text: "Sets a gamerule in BlockBall." +joinSignLine1: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7" +joinSignLine2: + type: "CHAT" + text: "%blockball_game_stateDisplayName%" +joinSignLine3: + type: "CHAT" + text: "%blockball_game_players%/%blockball_game_maxPlayers%" +joinSignLine4: + type: "CHAT" + text: "" +leaveSignLine1: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7" +leaveSignLine2: + type: "CHAT" + text: "&fLeave" +leaveSignLine3: + type: "CHAT" + text: "%blockball_game_players%/%blockball_game_maxPlayers%" +leaveSignLine4: + type: "CHAT" + text: "" +failedToReloadMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 &cFailed to reload arena %1$1s. Recommended action: &e%2$1s" +teamRedDisplayName: + type: "CHAT" + text: "Team Red" +teamBlueDisplayName: + type: "CHAT" + text: "Team Blue" +gameIsNotARefereeGame: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c This game is not a game where you can use a referee. Convert the game to a referee game first." +gameTypeRefereeOnlyForPatreons: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c The game type where you can have a referee requires the premium version of BlockBall. Obtainable via https://www.patreon.com/Shynixn." +joinTeamRefereeMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Successfully joined team referee." +waitingForRefereeToStart: + type: "CHAT" + text: "Waiting for the referee to start the game..." +waitingForRefereeToStartHint: + type: "CHAT" + text: "Execute &a/blockball referee startgame &fto start the lobby timer." +nextPeriodReferee: + type: "CHAT" + text: "This period has ended. You are now in overtime." +nextPeriodRefereeHint: + type: "CHAT" + text: "This period has ended. Execute &a/blockball referee nextperiod." +whistleTimeOutReferee: + type: "CHAT" + text: "Waiting for the referee to resume the game..." +whistleTimeOutRefereeHint: + type: "CHAT" + text: "You can resume the match by executing &a/blockball referee whistleresume." +refereeStartedGame: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 You have started the game." +refereeStoppedGame: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 You have stopped the game and transitioned to the last configured period." +refereeBallEnabled: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Players can kick the ball now." +refereeBallDisabled: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Players can no longer kick the ball." +commandRefereeStartGameToolTip: + type: "CHAT" + text: "Starts the game." +commandRefereeStopGameToolTip: + type: "CHAT" + text: "Transitions the game to the final period. Executing this command again stops it." +commandRefereeWhistleResumeToolTip: + type: "CHAT" + text: "Resumes the game and sets the ball interactable." +commandRefereeWhistleStopToolTip: + type: "CHAT" + text: "Stops the game and sets the ball inactive." +commandRefereeFreezeTimeToolTip: + type: "CHAT" + text: "Freezes the countdown and sets the ball inactive." +commandRefereeSetBallToolTip: + type: "CHAT" + text: "Teleports the ball to the position of the referee." +commandRefereeNextPeriodToolTip: + type: "CHAT" + text: "Transitions to the next configured period." +commandPlaceHolderToolTip: + type: "CHAT" + text: "Resolves a given placeholder." +commandPlaceHolderMessage: + type: "CHAT" + text: "Evaluated placeholder: %1$1s" diff --git a/src/main/resources/lang/es_es.properties b/src/main/resources/lang/es_es.properties deleted file mode 100644 index 06dfe4135..000000000 --- a/src/main/resources/lang/es_es.properties +++ /dev/null @@ -1,90 +0,0 @@ -commandUsage=&0&l[&f&lBlockBall&0&l]&7 Usa /blockball help para ver más información sobre el plugin. -commandDescription=Todos los comandos para el plugin BlockBall. -gameAlreadyExistsMessage=&0&l[&f&lBlockBall&0&l]&c El juego %1$1s ya existe. -maxLength20Characters=&0&l[&f&lBlockBall&0&l]&c La longitud del texto debe ser menor a 20 caracteres. -gameDoesNotExistMessage=&0&l[&f&lBlockBall&0&l]&c El juego %1$1s no existe. -teamDoesNotExistMessage=&0&l[&f&lBlockBall&0&l]&c El equipo %1$1s no existe. -gameTypeNotExistMessage=&0&l[&f&lBlockBall&0&l]&c El tipo de juego %1$1s no existe. -selectionTypeDoesNotExistMessage=&0&l[&f&lBlockBall&0&l]&c Este tipo de selección no es conocido. -signTypeDoesNotExistMessage=&0&l[&f&lBlockBall&0&l]&c Este tipo de cartel no es conocido. -noPermissionForGameMessage=&0&l[&f&lBlockBall&0&l]&c No tienes permiso para unirte al juego %1$1s. -noPermissionMessage=&0&l[&f&lBlockBall&0&l]&c No tienes permiso. -commandSenderHasToBePlayer=&0&l[&f&lBlockBall&0&l]&c ¡El remitente del comando debe ser un jugador! -gameCreatedMessage=&0&l[&f&lBlockBall&0&l]&7 Juego %1$1s creado. -deletedGameMessage=&0&l[&f&lBlockBall&0&l]&7 Juego %1$1s eliminado. -gameIsFullMessage=&0&l[&f&lBlockBall&0&l]&c El juego ya está lleno. -joinTeamRedMessage=&0&l[&f&lBlockBall&0&l]&7 Te has unido exitosamente al equipo rojo. -joinTeamBlueMessage=&0&l[&f&lBlockBall&0&l]&7 Te has unido exitosamente al equipo azul. -leftGameMessage=&0&l[&f&lBlockBall&0&l]&7 Has salido del juego. -selectionSetMessage=&0&l[&f&lBlockBall&0&l]&7 Selección %1$1s establecida. -enabledArenaMessage=&0&l[&f&lBlockBall&0&l]&7 El estado del juego se estableció en %1$1s. -reloadedAllGamesMessage=&0&l[&f&lBlockBall&0&l]&7 Todos los juegos han sido recargados. -reloadedGameMessage=&0&l[&f&lBlockBall&0&l]&7 El juego %1$1s ha sido recargado. -updatedInventoryMessage=&0&l[&f&lBlockBall&0&l]&7 Inventario del juego actualizado. -updatedArmorMessage=&0&l[&f&lBlockBall&0&l]&7 Armadura del juego actualizada. -gameRuleChangedMessage=&0&l[&f&lBlockBall&0&l]&7 Se ha actualizado una regla del juego. -rightClickOnSignMessage=&0&l[&f&lBlockBall&0&l]&7 Haz clic derecho en un cartel para convertirlo en un cartel de juego. -addedSignMessage=&0&l[&f&lBlockBall&0&l]&7 Se ha añadido un cartel al juego. -noLeftClickSelectionMessage=&0&l[&f&lBlockBall&0&l]&c ¡Necesitas seleccionar una ubicación usando el hacha de BlockBall con un clic izquierdo! -noRightClickSelectionMessage=&0&l[&f&lBlockBall&0&l]&c ¡Necesitas seleccionar una ubicación usando el hacha de BlockBall con un clic derecho! -toggleHighlightMessage=&0&l[&f&lBlockBall&0&l]&7 Resaltado de áreas importantes activado/desactivado. -axeReceivedMessage=&0&l[&f&lBlockBall&0&l]&7 El hacha de BlockBall ha sido añadida a tu inventario. -bossBarMessage=&cEquipo Rojo %blockball_game_redScore% : &9%blockball_game_blueScore% Equipo Azul -hologramMessage=&cEquipo Rojo %blockball_game_redScore% : &9Equipo Azul %blockball_game_blueScore% -scoreRedTitle=&c%blockball_game_redScore% : &9%blockball_game_blueScore% -scoreRedSubTitle=%1$1s anotó para el &cEquipo Rojo. -scoreRedFadeIn=20 -scoreRedStay=60 -scoreRedFadeOut=20 -scoreBlueTitle=&9%blockball_game_blueScore% : &c%blockball_game_redScore% -scoreBlueSubTitle=%1$1s anotó para el &9Equipo Azul. -scoreBlueFadeIn=20 -scoreBlueStay=60 -scoreBlueFadeOut=20 -winRedTitle=&cEquipo Rojo -winRedSubTitle=&cEl Equipo Rojo &aha ganado el partido -winRedFadeIn=20 -winRedStay=60 -winRedFadeOut=20 -winBlueTitle=&9Equipo Azul -winBlueSubTitle=&9El Equipo Azul &aha ganado el partido -winBlueFadeIn=20 -winBlueStay=60 -winBlueFadeOut=20 -winDrawTitle=&fEmpate -winDrawSubTitle=&aEl juego ha terminado en empate -winDrawFadeIn=20 -winDrawStay=60 -winDrawFadeOut=20 -gameStatusJoinAble=&aUnirse -gameStatusDisabled=&4Desactivado -gameStatusRunning=&1En Curso -hubGameJoinHeader=&0&l[&f&lBlockBall&0&l]&7 Haz clic en el equipo para unirte al partido. -hubGameJoinRed=&0&l[&f&lBlockBall&0&l]&7 &c[Equipo Rojo] -hubGameJoinBlue=&0&l[&f&lBlockBall&0&l]&7 &9[Equipo Azul] -commandCreateToolTip=Crea una nueva arena para un juego de BlockBall. -commandDeleteToolTip=Elimina un juego de BlockBall. -commandListToolTip=Lista todos los juegos que has creado. -commandToggleToolTip=Activa o desactiva tu juego. Si un juego está desactivado, nadie puede unirse. -commandJoinToolTip=Permite al jugador que ejecuta el comando unirse al juego. El argumento opcional del equipo permite unirse directamente a un equipo específico. Si el equipo está lleno, se elegirá el otro equipo. Si no se especifica un equipo, se seleccionará uno al azar. -commandLeaveToolTip=Permite al jugador que ejecuta el comando salir del juego. -commandSelectionToolTip=Actualiza una selección de ubicación de una parte de la arena. -commandInventoryToolTip=Copia el inventario del jugador que ejecuta el comando. Esta copia se aplicará a los jugadores cuando se unan a un juego. -commandArmorToolTip=Copia el inventario de armadura del jugador que ejecuta el comando. Esta copia se aplicará a los jugadores cuando se unan a un juego. -commandSignToolTip=Permite al jugador agregar un cartel específico haciendo clic derecho en cualquier cartel. Puedes eliminar carteles simplemente rompiendo el bloque. -commandReloadToolTip=Permite recargar todos los juegos o uno específico. -commandAxeToolTip=Te da el hacha de selección de BlockBall. -commandHighlightToolTip=Activa o desactiva el resaltado de las áreas importantes de tu arena. -commandSelectToolTip=Establece una ubicación seleccionada para tu arena. -commandGameRuleToolTip=Establece una regla del juego en BlockBall. -joinSignLine1=&0&l[&f&lBlockBall&0&l]&7 -joinSignLine2=%blockball_game_stateDisplayName% -joinSignLine3=%blockball_game_players%/%blockball_game_maxPlayers% -joinSignLine4= -leaveSignLine1=&0&l[&f&lBlockBall&0&l]&7 -leaveSignLine2=&fSalir -leaveSignLine3=%blockball_game_players%/%blockball_game_maxPlayers% -leaveSignLine4= -failedToReloadMessage=&0&l[&f&lBlockBall&0&l]&7 &cFailed to reload arena %1$1s. Recommended action: &e%2$1s -teamRedDisplayName=Team Red -teamBlueDisplayName=Team Blue diff --git a/src/main/resources/lang/es_es.yml b/src/main/resources/lang/es_es.yml new file mode 100644 index 000000000..c4ea621f3 --- /dev/null +++ b/src/main/resources/lang/es_es.yml @@ -0,0 +1,242 @@ +# All language key identifiers. +gameAlreadyExistsMessage: + # Available types: "CHAT", "TITLE", "ACTIONBAR", "HIDDEN". + # Please notice that some messages do only support chat. + type: "CHAT" + # The primary text to be sent. + text: "&0&l[&f&lBlockBall&0&l]&c El juego %1$1s ya existe." + # Only available for type "TITLE". Adds a subTitle. + subTitle: "" + # Only available for type: "TITLE". Adds a fade in effect. + fadeInTicks: 20 + # Only available for type: "TITLE". Adds a stay effect. + stayTicks: 60 + # Only available for type: "TITLE". Adds a fade out effect. + fadeOutTicks: 20 +commandUsage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Usa /blockball help para ver más información sobre el plugin." +commandDescription: + type: "CHAT" + text: "Todos los comandos para el plugin BlockBall." +maxLength20Characters: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c La longitud del texto debe ser menor a 20 caracteres." +gameDoesNotExistMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c El juego %1$1s no existe." +teamDoesNotExistMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c El equipo %1$1s no existe." +gameTypeNotExistMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c El tipo de juego %1$1s no existe." +selectionTypeDoesNotExistMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c Este tipo de selección no es conocido." +signTypeDoesNotExistMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c Este tipo de cartel no es conocido." +noPermissionForGameMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c No tienes permiso para unirte al juego %1$1s." +noPermissionMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c No tienes permiso." +commandSenderHasToBePlayer: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c ¡El remitente del comando debe ser un jugador!" +gameCreatedMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Juego %1$1s creado." +deletedGameMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Juego %1$1s eliminado." +gameIsFullMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c El juego ya está lleno." +joinTeamRedMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Te has unido exitosamente al equipo rojo." +joinTeamBlueMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Te has unido exitosamente al equipo azul." +leftGameMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Has salido del juego." +selectionSetMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Selección %1$1s establecida." +enabledArenaMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 El estado del juego se estableció en %1$1s." +reloadedAllGamesMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Todos los juegos han sido recargados." +reloadedGameMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 El juego %1$1s ha sido recargado." +updatedInventoryMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Inventario del juego actualizado." +updatedArmorMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Armadura del juego actualizada." +gameRuleChangedMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Se ha actualizado una regla del juego." +rightClickOnSignMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Haz clic derecho en un cartel para convertirlo en un cartel de juego." +addedSignMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Se ha añadido un cartel al juego." +noLeftClickSelectionMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c ¡Necesitas seleccionar una ubicación usando el hacha de BlockBall con un clic izquierdo!" +noRightClickSelectionMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&c ¡Necesitas seleccionar una ubicación usando el hacha de BlockBall con un clic derecho!" +toggleHighlightMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Resaltado de áreas importantes activado/desactivado." +axeReceivedMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 El hacha de BlockBall ha sido añadida a tu inventario." +bossBarMessage: + type: "CHAT" + text: "&cEquipo Rojo %blockball_game_redScore% : &9%blockball_game_blueScore% Equipo Azul" +hologramMessage: + type: "CHAT" + text: "&cEquipo Rojo %blockball_game_redScore% : &9Equipo Azul %blockball_game_blueScore%" +scoreRed: + type: "TITLE" + text: "&c%blockball_game_redScore% : &9%blockball_game_blueScore%" + subTitle: "%1$1s anotó para el &cEquipo Rojo." + fadeInTicks: 20 + stayTicks: 60 + fadeOutTicks: 20 +scoreBlue: + type: "TITLE" + text: "&9%blockball_game_blueScore% : &c%blockball_game_redScore%" + subTitle: "%1$1s anotó para el &9Equipo Azul." + fadeInTicks: 20 + stayTicks: 60 + fadeOutTicks: 20 +winRed: + type: "TITLE" + text: "&cEquipo Rojo" + subTitle: "&cEl Equipo Rojo &aha ganado el partido" + fadeInTicks: 20 + stayTicks: 60 + fadeOutTicks: 20 +winBlue: + type: "TITLE" + text: "&9Equipo Azul" + subTitle: "&9El Equipo Azul &aha ganado el partido" + fadeInTicks: 20 + stayTicks: 60 + fadeOutTicks: 20 +winDraw: + type: "TITLE" + text: "&fEmpate" + subTitle: "&aEl juego ha terminado en empate" + fadeInTicks: 20 + stayTicks: 60 + fadeOutTicks: 20 +gameStatusJoinAble: + type: "CHAT" + text: "&aUnirse" +gameStatusDisabled: + type: "CHAT" + text: "&4Desactivado" +gameStatusRunning: + type: "CHAT" + text: "&1En Curso" +hubGameJoinHeader: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 Haz clic en el equipo para unirte al partido." +hubGameJoinRed: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 &c[Equipo Rojo]" +hubGameJoinBlue: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 &9[Equipo Azul]" +commandCreateToolTip: + type: "CHAT" + text: "Crea una nueva arena para un juego de BlockBall." +commandDeleteToolTip: + type: "CHAT" + text: "Elimina un juego de BlockBall." +commandListToolTip: + type: "CHAT" + text: "Lista todos los juegos que has creado." +commandToggleToolTip: + type: "CHAT" + text: "Activa o desactiva tu juego. Si un juego está desactivado, nadie puede unirse." +commandJoinToolTip: + type: "CHAT" + text: "Permite al jugador que ejecuta el comando unirse al juego. El argumento opcional del equipo permite unirse directamente a un equipo específico. Si el equipo está lleno, se elegirá el otro equipo. Si no se especifica un equipo, se seleccionará uno al azar." +commandLeaveToolTip: + type: "CHAT" + text: "Permite al jugador que ejecuta el comando salir del juego." +commandSelectionToolTip: + type: "CHAT" + text: "Actualiza una selección de ubicación de una parte de la arena." +commandInventoryToolTip: + type: "CHAT" + text: "Copia el inventario del jugador que ejecuta el comando. Esta copia se aplicará a los jugadores cuando se unan a un juego." +commandArmorToolTip: + type: "CHAT" + text: "Copia el inventario de armadura del jugador que ejecuta el comando. Esta copia se aplicará a los jugadores cuando se unan a un juego." +commandSignToolTip: + type: "CHAT" + text: "Permite al jugador agregar un cartel específico haciendo clic derecho en cualquier cartel. Puedes eliminar carteles simplemente rompiendo el bloque." +commandReloadToolTip: + type: "CHAT" + text: "Permite recargar todos los juegos o uno específico." +commandAxeToolTip: + type: "CHAT" + text: "Te da el hacha de selección de BlockBall." +commandHighlightToolTip: + type: "CHAT" + text: "Activa o desactiva el resaltado de las áreas importantes de tu arena." +commandSelectToolTip: + type: "CHAT" + text: "Establece una ubicación seleccionada para tu arena." +commandGameRuleToolTip: + type: "CHAT" + text: "Establece una regla del juego en BlockBall." +joinSignLine1: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7" +joinSignLine2: + type: "CHAT" + text: "%blockball_game_stateDisplayName%" +joinSignLine3: + type: "CHAT" + text: "%blockball_game_players%/%blockball_game_maxPlayers%" +joinSignLine4: + type: "CHAT" + text: "" +leaveSignLine1: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7" +leaveSignLine2: + type: "CHAT" + text: "&fSalir" +leaveSignLine3: + type: "CHAT" + text: "%blockball_game_players%/%blockball_game_maxPlayers%" +leaveSignLine4: + type: "CHAT" + text: "" +failedToReloadMessage: + type: "CHAT" + text: "&0&l[&f&lBlockBall&0&l]&7 &cFailed to reload arena %1$1s. Recommended action: &e%2$1s" +teamRedDisplayName: + type: "CHAT" + text: "Team Red" +teamBlueDisplayName: + type: "CHAT" + text: "Team Blue"