Skip to content

Commit

Permalink
#497 Fixed rightclick not using pass velocity.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shynixn committed Apr 13, 2024
1 parent 8e83ac0 commit 658fbec
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class GameListener @Inject constructor(
return
}

if (packet.actionType == InteractionType.RIGHT_CLICK) {
if (packet.actionType == InteractionType.RIGHT_CLICK || packet.actionType == InteractionType.OTHER) {
ball.passByPlayer(event.player)
} else {
ball.kickByPlayer(event.player)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class HubGameForcefieldServiceImpl @Inject constructor(
private val chatMessageService: ChatMessageService
) : HubGameForcefieldService {
private val cache = HashMap<Player, InteractionCache>()

/**
* Checks and executes the forcefield actions if the given [player]
* is going to the given [location].
Expand Down Expand Up @@ -77,7 +78,15 @@ class HubGameForcefieldServiceImpl @Inject constructor(
val joinCommand = configurationService.findValue<String>("global-join.command")

val b =
ChatBuilder().text(placeholderService.replacePlaceHolders(game.arena.meta.hubLobbyMeta.joinMessage[0], player, game, null, null))
ChatBuilder().text(
placeholderService.replacePlaceHolders(
game.arena.meta.hubLobbyMeta.joinMessage[0],
player,
game,
null,
null
)
)
.nextLine()
.component(
placeholderService.replacePlaceHolders(
Expand All @@ -88,9 +97,12 @@ class HubGameForcefieldServiceImpl @Inject constructor(
)
)
.setClickAction(
ChatClickAction.RUN_COMMAND
,
"/" + joinCommand + " " + game.arena.name + "|" + game.arena.meta.redTeamMeta.displayName.stripChatColors()
ChatClickAction.RUN_COMMAND,
placeholderService.replacePlaceHolders(
"/" + joinCommand + " " + game.arena.name + "|" + game.arena.meta.redTeamMeta.displayName.stripChatColors(),
player,
game
)
)
.setHoverText(" ")
.builder().text(" ")
Expand All @@ -103,9 +115,12 @@ class HubGameForcefieldServiceImpl @Inject constructor(
)
)
.setClickAction(
ChatClickAction.RUN_COMMAND
,
"/" + joinCommand + " " + game.arena.name + "|" + game.arena.meta.blueTeamMeta.displayName.stripChatColors()
ChatClickAction.RUN_COMMAND,
placeholderService.replacePlaceHolders(
"/" + joinCommand + " " + game.arena.name + "|" + game.arena.meta.blueTeamMeta.displayName.stripChatColors(),
player,
game
)
)
.setHoverText(" ")
.builder()
Expand Down

0 comments on commit 658fbec

Please sign in to comment.