Skip to content

Commit

Permalink
Merge pull request #520 from Shynixn/development
Browse files Browse the repository at this point in the history
Merge changes to master --release
  • Loading branch information
Shynixn authored Jul 7, 2024
2 parents 97cdca3 + cdf0d5f commit 99efe0c
Show file tree
Hide file tree
Showing 80 changed files with 2,397 additions and 3,500 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# These are supported funding model platforms
patreon: Shynixn
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 = "6.45.1"
version = "6.46.0"

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

// Custom dependencies
implementation("com.github.shynixn.mcutils:common:2024.19")
implementation("com.github.shynixn.mcutils:packet:2024.29")
implementation("com.github.shynixn.mcutils:packet:2024.30")
implementation("com.github.shynixn.mcutils:database:2024.2")
implementation("com.github.shynixn.mcutils:sign:2024.2")
implementation("com.github.shynixn.mcutils:guice:2024.2")
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
# built documents.
#
# The short X.Y version.
version = '6.45.1'
version = '6.46.0'
# The full version, including alpha/beta/rc tags.
release = '6.45.1'
release = '6.46.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
1 change: 0 additions & 1 deletion docs/source/customizing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ The articles in this section deal with customizing and changing your created Gam
signs
effects
abilities
rewards
spectating
placeholders
misc
81 changes: 0 additions & 81 deletions docs/source/customizing/rewards.rst

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import com.fasterxml.jackson.core.type.TypeReference
import com.github.shynixn.blockball.contract.*
import com.github.shynixn.blockball.entity.Arena
import com.github.shynixn.blockball.entity.PlayerInformation
import com.github.shynixn.blockball.enumeration.PluginDependency
import com.github.shynixn.blockball.impl.service.*
import com.github.shynixn.mccoroutine.bukkit.launch
import com.github.shynixn.mcutils.common.ConfigurationService
import com.github.shynixn.mcutils.common.ConfigurationServiceImpl
import com.github.shynixn.mcutils.common.CoroutineExecutor
import com.github.shynixn.mcutils.common.chat.ChatMessageService
import com.github.shynixn.mcutils.common.item.ItemService
import com.github.shynixn.mcutils.common.repository.CacheRepository
Expand Down Expand Up @@ -77,30 +78,31 @@ class BlockBallDependencyInjectionModule(

// Services
addService<CommandService, CommandServiceImpl>()
addService<com.github.shynixn.mcutils.common.command.CommandService>(
com.github.shynixn.mcutils.common.command.CommandServiceImpl(
object : CoroutineExecutor {
override fun execute(f: suspend () -> Unit) {
plugin.launch { f.invoke() }
}
})
)
addService<PacketService>(PacketServiceImpl(plugin))
addService<ScoreboardService, ScoreboardServiceImpl>()
addService<ConfigurationService>(ConfigurationServiceImpl(plugin))
addService<SoundService>(SoundServiceImpl(plugin))
addService<BossBarService, BossBarServiceImpl>()
addService<GameService, GameServiceImpl>()
addService<GameActionService, GameActionServiceImpl>()
addService<GameHubGameActionService, GameHubGameActionServiceImpl>()
addService<GameMiniGameActionService, GameMiniGameActionServiceImpl>()
addService<GameBungeeCordGameActionService, GameBungeeCordGameActionServiceImpl>()
addService<ItemService>(ItemServiceImpl())
addService<ChatMessageService>(ChatMessageServiceImpl(plugin))
addService<GameSoccerService, GameSoccerServiceImpl>()
addService<RightclickManageService, RightclickManageServiceImpl>()
addService<HubGameForcefieldService, HubGameForcefieldServiceImpl>()
addService<BallEntityService, BallEntityServiceImpl>()
addService<BlockSelectionService, BlockSelectionServiceImpl>()
addService<GameExecutionService, GameExecutionServiceImpl>()
addService<DependencyBossBarApiService, DependencyBossBarApiServiceImpl>()
addService<RayTracingService, RayTracingServiceImpl>()

if (Bukkit.getPluginManager().getPlugin(PluginDependency.PLACEHOLDERAPI.pluginName) != null) {
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
addService<PlaceHolderService, DependencyPlaceHolderServiceImpl>()
plugin.logger.log(Level.INFO, "Loaded dependency ${PluginDependency.PLACEHOLDERAPI.pluginName}.")
plugin.logger.log(Level.INFO, "Loaded dependency PlaceholderAPI.")
} else {
addService<PlaceHolderService, PlaceHolderServiceImpl>()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ object BlockBallLanguage {
/** &c%blockball_game_redScore% : &9%blockball_game_blueScore% **/
var teamRedScoreTitle : String = "&c%blockball_game_redScore% : &9%blockball_game_blueScore%"

/** &c%blockball_game_lastHitPlayerName% scored for Team Red **/
var teamRedScoreSubTitle : String = "&c%blockball_game_lastHitPlayerName% scored for Team Red"
/** &c%blockball_game_lastHitPlayerName% scored for %blockball_game_redName% **/
var teamRedScoreSubTitle : String = "&c%blockball_game_lastHitPlayerName% scored for %blockball_game_redName%"

/** Game is full! Do you want to spectate? **/
var spectateJoinHeader : String = "Game is full! Do you want to spectate?"
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/com/github/shynixn/blockball/BlockBallPlugin.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.github.shynixn.blockball

import com.github.shynixn.blockball.contract.CommandService
import com.github.shynixn.blockball.contract.GameActionService
import com.github.shynixn.blockball.contract.GameService
import com.github.shynixn.blockball.entity.PlayerInformation
import com.github.shynixn.blockball.impl.commandexecutor.*
Expand Down Expand Up @@ -93,12 +92,10 @@ class BlockBallPlugin : JavaPlugin() {
this.reloadConfig()

// Register Listeners
module.getService<GameActionService>().gameService = module.getService()
Bukkit.getPluginManager().registerEvents(module.getService<GameListener>(), this)
Bukkit.getPluginManager().registerEvents(module.getService<DoubleJumpListener>(), this)
Bukkit.getPluginManager().registerEvents(module.getService<HubgameListener>(), this)
Bukkit.getPluginManager().registerEvents(module.getService<MinigameListener>(), this)
Bukkit.getPluginManager().registerEvents(module.getService<BungeeCordgameListener>(), this)
Bukkit.getPluginManager().registerEvents(module.getService<BallListener>(), this)
Bukkit.getPluginManager().registerEvents(module.getService<BlockSelectionListener>(), this)

Expand Down
136 changes: 136 additions & 0 deletions src/main/java/com/github/shynixn/blockball/contract/BlockBallGame.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
package com.github.shynixn.blockball.contract

import com.github.shynixn.blockball.entity.Arena
import com.github.shynixn.blockball.entity.GameStorage
import com.github.shynixn.blockball.enumeration.GameState
import com.github.shynixn.blockball.enumeration.JoinResult
import com.github.shynixn.blockball.enumeration.LeaveResult
import com.github.shynixn.blockball.enumeration.Team
import org.bukkit.entity.Player

interface BlockBallGame {
/**
* Player who was the last one to hit the ball.
*/
var lastHitPlayer: Player?

/**
* Gets the arena.
*/
val arena: Arena

/**
* RedScore.
*/
var redScore: Int

/**
* Blue Score.
*/
var blueScore: Int

/**
* Marks the game for being closed and will automatically
* switch to close state once the resources are cleard.
*/
var closing: Boolean

/**
* Ingame scoreboard.
*/
var scoreboard: Any?

/**
* Ingame bossbar.
*/
var bossBar: Any?

/**
* Ingame holograms.
*/
val holograms: MutableList<HologramProxy>

/**
* All players which are already fix in team red.
*/
val redTeam: List<Player>

/**
* All players which are already fix in team blue.
*/
val blueTeam: List<Player>

/**
* Is the game closed.
*/
var closed: Boolean

/**
* Status.
*/
var status: GameState

/**
* Ball.
*/
var ball: Ball?

/**
* The last interacted entity with the ball. Can also be a non player.
*/
var lastInteractedEntity: Any?

/**
* Contains players which are in cooldown by doublejump.
*/
val doubleJumpCoolDownPlayers: MutableMap<Player, Int>

/**
* Storage.
*/
val ingamePlayersStorage: MutableMap<Player, GameStorage>

/**
* Ball bumper counter
*/
var ballBumperCounter: Int

/**
* Lets the given [player] leave join. Optional can the prefered
* [team] be specified but the team can still change because of arena settings.
* Does nothing if the player is already in a Game.
*/
fun join(player: Player, team: Team? = null): JoinResult

/**
* Leaves the given player.
*/
fun leave(player: Player): LeaveResult

/**
* Tick handle.
*/
fun handle(ticks: Int)

/**
* Lets the given [player] in the given [game] respawn at the specified spawnpoint.
*/
fun respawn(player: Player)

/**
* Applies death points.
*/
fun applyDeathPoints(player: Player)

/**
* Notifies that the ball is inside of the goal of the given team.
* This team has to be the default goal of the team. Mirroring
* is handled inside of the method.
*/
fun notifyBallInGoal(team: Team)

/**
* Closes the given game and all underlying resources.
*/
fun close()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.github.shynixn.blockball.contract

interface BlockBallHubGame : BlockBallGame {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.github.shynixn.blockball.contract

import org.bukkit.entity.Player

interface BlockBallMiniGame : BlockBallGame {
/**
* Actual game coutndown.
*/
var gameCountdown: Int

/**
* List of players which are spectating the game.
*/
val spectatorPlayers: List<Player>

/**
* Index of the current match time.
*/
var matchTimeIndex: Int

/**
* Actives the next match time. Closes the match if no match time is available.
*/
fun switchToNextMatchTime()

/**
* Lets the given [player] leave spectate the given [game].
* Does nothing if the player is already spectating a Game.
*/
fun spectate(player: Player)
}

This file was deleted.

Loading

0 comments on commit 99efe0c

Please sign in to comment.