Skip to content

Commit

Permalink
Merge pull request #572 from Shynixn/development
Browse files Browse the repository at this point in the history
Merge changes to master --release
  • Loading branch information
Shynixn authored Nov 8, 2024
2 parents efe1112 + 8cb1a8a commit 6c9d585
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 11 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = "com.github.shynixn"
version = "7.6.0"
version = "7.6.1"

repositories {
mavenLocal()
Expand Down Expand Up @@ -42,7 +42,7 @@ dependencies {

// Custom dependencies
implementation("com.github.shynixn.mcutils:common:2024.25")
implementation("com.github.shynixn.mcutils:packet:2024.41")
implementation("com.github.shynixn.mcutils:packet:2024.47")
implementation("com.github.shynixn.mcutils:database:2024.8")
implementation("com.github.shynixn.mcutils:sign:2024.3")
implementation("com.github.shynixn.mcutils:guice:2024.2")
Expand Down
7 changes: 6 additions & 1 deletion docs/wiki/docs/placeholders.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ The following placeholders are available in BlockBall and can also be used via P
| %blockball_game_maxPlayers% | Max amount of players who can join this game |
| %blockball_game_players% | Current amount of players in this game |
| %blockball_game_redScore% | Score of the red team |
| %blockball_game_redPlayers% | Amount of players who are currently in the red team |
| %blockball_game_redMaxPlayers% | Max amount of players who can join the red team |
| %blockball_game_blueScore% | Score of the blue team |
| %blockball_game_bluePlayers% | Amount of players who are currently in the blue team |
| %blockball_game_blueMaxPlayers% | Max amount of players who can join the blue team |
| %blockball_game_time% | Remaining time until the match ends |
| %blockball_game_lastHitPlayerName% | Name of the player who was the last one to hit the ball, returns an empty text if no one has hit the ball yet |
| %blockball_game_lastHitPlayerTeam% | DisplayName of the team of the player who was the last one to hit the ball. |
Expand All @@ -29,9 +33,10 @@ The following placeholders are available in BlockBall and can also be used via P
| Player Context Placeholders | Description |
|---------------------------------|----------------------------------------------------------------|
| %blockball_player_name% | Name of the player during a BlockBall event e.g. scoring goal |
| %blockball_player_team% | Name of the team the player is currently in: red, blue |
| %blockball_player_isInGame% | true if the player is in a game, false if not |
| %blockball_player_isInTeamRed% | true if the player is in a game and in team red, false if not |
| %blockball_player_isInTeamBlue% | true if the player is in a game and in team blue, false if not | |
| %blockball_player_isInTeamBlue% | true if the player is in a game and in team blue, false if not |

| Stats Placeholders (Patreon Only) | Description |
|------------------------------------------|-----------------------------------------------------------------------------------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ interface SoccerGame {
/**
* The last interacted entity with the ball. Can also be a non player.
*/
var lastInteractedEntity: Any?
var lastInteractedEntity: Player?

/**
* Marks the game for being closed and will automatically
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@ enum class PlaceHolder(

GAME_RED_SCORE("%blockball_game_redScore%"),

GAME_RED_PLAYER_AMOUNT("%blockball_game_redPlayers%"),

GAME_RED_PLAYER_MAXAMOUNT("%blockball_game_redMaxPlayers%"),

GAME_BLUE_SCORE("%blockball_game_blueScore%"),

GAME_BLUE_PLAYER_AMOUNT("%blockball_game_bluePlayers%"),

GAME_BLUE_PLAYER_MAXAMOUNT("%blockball_game_blueMaxPlayers%"),

GAME_TIME("%blockball_game_time%"),

GAME_LASTHITPLAYER_NAME("%blockball_game_lastHitPlayerName%"),
Expand All @@ -41,6 +49,8 @@ enum class PlaceHolder(

PLAYER_NAME("%blockball_player_name%"),

PLAYER_TEAM("%blockball_player_team%"),

PLAYER_IS_INGAME("%blockball_player_isInGame%"),

PLAYER_IS_IN_TEAM_RED("%blockball_player_isInTeamRed%"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class BallHitboxEntity(val entityId: Int, val spawnpoint: Vector3d, val game: So
}

val rayTraceResult =
rayTracingService.rayTraceMotion(position.toLocation().toVector3d(), motion.toVector().toVector3d())
rayTracingService.rayTraceMotion(position.toLocation().toVector3d(), motion.toVector().toVector3d(), false, true)

val rayTraceEvent = BallRayTraceEvent(
ball, rayTraceResult.hitBlock,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ abstract class SoccerGameImpl(
/**
* The last interacted entity with the ball. Can also be a non player.
*/
override var lastInteractedEntity: Any? = null
override var lastInteractedEntity: Player? = null

var mirroredGoals: Boolean = false

Expand Down Expand Up @@ -779,7 +779,7 @@ abstract class SoccerGameImpl(
player,
placeHolderService.replacePlaceHolders(language.scoreRedTitle, player, this, scoreTeamMeta),
placeHolderService.replacePlaceHolders(
language.scoreRedSubTitle.format(player.name), player, this, scoreTeamMeta
language.scoreRedSubTitle.format(interactionEntity.name), player, this, scoreTeamMeta
),
language.scoreRedFadeIn.toIntOrNull() ?: 20,
language.scoreRedStay.toIntOrNull() ?: 60,
Expand All @@ -792,7 +792,7 @@ abstract class SoccerGameImpl(
player,
placeHolderService.replacePlaceHolders(language.scoreBlueTitle, player, this, scoreTeamMeta),
placeHolderService.replacePlaceHolders(
language.scoreBlueSubTitle.format(player.name), player, this, scoreTeamMeta
language.scoreBlueSubTitle.format(interactionEntity.name), player, this, scoreTeamMeta
),
language.scoreBlueFadeIn.toIntOrNull() ?: 20,
language.scoreBlueStay.toIntOrNull() ?: 60,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ class PlaceHolderServiceImpl @Inject constructor(
gamePlayerHolderFunctions[PlaceHolder.GAME_SUM_CURRENTPLAYERS] =
{ game -> (game.ingamePlayersStorage.size).toString() }
gamePlayerHolderFunctions[PlaceHolder.GAME_RED_SCORE] = { game -> game.redScore.toString() }
gamePlayerHolderFunctions[PlaceHolder.GAME_RED_PLAYER_AMOUNT] = { game -> game.redTeam.size.toString() }
gamePlayerHolderFunctions[PlaceHolder.GAME_RED_PLAYER_MAXAMOUNT] = { game -> game.arena.meta.redTeamMeta.maxAmount.toString() }
gamePlayerHolderFunctions[PlaceHolder.GAME_BLUE_SCORE] = { game -> game.blueScore.toString() }
gamePlayerHolderFunctions[PlaceHolder.GAME_BLUE_PLAYER_AMOUNT] = { game -> game.blueTeam.size.toString() }
gamePlayerHolderFunctions[PlaceHolder.GAME_BLUE_PLAYER_MAXAMOUNT] = { game -> game.arena.meta.blueTeamMeta.maxAmount.toString()}
gamePlayerHolderFunctions[PlaceHolder.GAME_TIME] = { game ->
if (game is SoccerMiniGame) {
game.gameCountdown.toString()
Expand Down Expand Up @@ -102,6 +106,16 @@ class PlaceHolderServiceImpl @Inject constructor(
playerPlaceHolderFunctions[PlaceHolder.PLAYER_NAME] = { player ->
player.name
}
playerPlaceHolderFunctions[PlaceHolder.PLAYER_TEAM] = { player ->
val game = gameService.getByPlayer(player)
if (game?.blueTeam != null && game.blueTeam.contains(player)) {
"blue"
} else if (game?.redTeam != null && game.redTeam.contains(player)) {
"red"
} else {
""
}
}
playerPlaceHolderFunctions[PlaceHolder.PLAYER_IS_INGAME] = { player ->
val game = gameService.getByPlayer(player)
game?.ingamePlayersStorage?.containsKey(player).toString()
Expand Down Expand Up @@ -412,7 +426,10 @@ class PlaceHolderServiceImpl @Inject constructor(
val leaderBoard = statsService.getLeaderBoard()

if (leaderBoard != null) {
locatedPlaceHolders[evaluatedPlaceHolder] = leaderBoardPlaceholder.f.invoke(leaderBoard, parts[parts.size - 1].substringBefore("%").toInt()-1)
locatedPlaceHolders[evaluatedPlaceHolder] = leaderBoardPlaceholder.f.invoke(
leaderBoard,
parts[parts.size - 1].substringBefore("%").toInt() - 1
)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin-legacy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: BlockBall
version: 7.6.0
version: 7.6.1
author: Shynixn
website: https://www.spigotmc.org/members/shynixn.63455/
main: com.github.shynixn.blockball.BlockBallPlugin
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: BlockBall
version: 7.6.0
version: 7.6.1
author: Shynixn
website: https://www.spigotmc.org/members/shynixn.63455/
main: com.github.shynixn.blockball.BlockBallPlugin
Expand Down

0 comments on commit 6c9d585

Please sign in to comment.