Skip to content

Commit

Permalink
Merge pull request #470 from Shynixn/development
Browse files Browse the repository at this point in the history
Merge changes to master --release
  • Loading branch information
Shynixn authored Oct 14, 2023
2 parents 8c624dc + a804b58 commit 9a31c70
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 129 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN ./gradlew build pluginJar --no-daemon
# 4. Launch a minecraft server with jdk17 and plugin
FROM amazoncorretto:17
# Change to the current plugin version present in build.gradle
ENV PLUGIN_VERSION=6.35.0
ENV PLUGIN_VERSION=6.36.0
# Change to the server version you want to test.
ENV SERVER_VERSION=spigot-1.18.jar
# Port of the Minecraft Server.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ enum class MenuCommand(val key: MenuPageKey, private val internalCommand: String
TEAM_NAME(MenuPageKey.TEAMMETA, "name"),
TEAM_PREFIX(MenuPageKey.TEAMMETA, "prefix"),
TEAM_SPAWNPOINT(MenuPageKey.TEAMMETA, "spawnpoint"),
TEAM_LOBBY(MenuPageKey.TEAMMETA, "lobby"),
TEAM_MINAMOUNT(MenuPageKey.TEAMMETA, "mina"),
TEAM_MAXAMOUNT(MenuPageKey.TEAMMETA, "maxa"),
TEAM_ARMOR(MenuPageKey.TEAMMETA, "armor"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,5 @@
package com.github.shynixn.blockball.api.persistence.entity

/**
* Created by Shynixn 2018.
* <p>
* Version 1.2
* <p>
* MIT License
* <p>
* Copyright (c) 2018 by Shynixn
* <p>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* <p>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
interface TeamMeta {

/** Goal properties of the team. */
Expand All @@ -35,6 +8,9 @@ interface TeamMeta {
/** Spawnpoint of the team inside of the arena. */
var spawnpoint: Position?

/** Optional lobby spawnpoint */
var lobbySpawnpoint: Position?

/** DisplayName of the team which gets used in the placeholder <red> or <blue>. */
var displayName: String

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: BlockBall
version: 6.35.0
version: 6.36.0
author: Shynixn
website: https://www.spigotmc.org/members/shynixn.63455/
main: com.github.shynixn.blockball.bukkit.BlockBallPlugin
Expand Down
3 changes: 1 addition & 2 deletions blockball-bukkit-plugin/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: BlockBall
version: 6.35.0
version: 6.36.0
author: Shynixn
website: https://www.spigotmc.org/members/shynixn.63455/
main: com.github.shynixn.blockball.bukkit.BlockBallPlugin
softdepend: [WorldEdit, BossBarAPI, PlaceholderAPI, Vault]
libraries:
- 'org.slf4j:slf4j-jdk14:1.7.25'
- 'com.zaxxer:HikariCP:3.2.0'
- 'com.google.inject:guice:5.0.1'
- 'commons-io:commons-io:2.6'
- 'com.google.code.gson:gson:2.8.6'
Expand Down
1 change: 0 additions & 1 deletion blockball-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ dependencies {

compileOnly("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
compileOnly("com.google.inject:guice:5.0.1")
compileOnly("com.zaxxer:HikariCP:3.2.0")
compileOnly("io.netty:netty-all:4.1.52.Final")

testImplementation("commons-io:commons-io:2.6")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,8 @@ import com.github.shynixn.blockball.api.persistence.entity.TeamMeta
import com.github.shynixn.blockball.core.logic.persistence.entity.ChatBuilderEntity
import com.google.inject.Inject

/**
* Created by Shynixn 2018.
* <p>
* Version 1.2
* <p>
* MIT License
* <p>
* Copyright (c) 2018 by Shynixn
* <p>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* <p>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
class TeamSettingsPage @Inject constructor(private val proxyService: ProxyService) : Page(TeamSettingsPage.ID, MainSettingsPage.ID) {
class TeamSettingsPage @Inject constructor(private val proxyService: ProxyService) :
Page(TeamSettingsPage.ID, MainSettingsPage.ID) {

companion object {
/** Id of the page. */
Expand All @@ -58,7 +32,12 @@ class TeamSettingsPage @Inject constructor(private val proxyService: ProxyServic
*
* @param cache cache
*/
override fun <P> execute(player: P, command: MenuCommand, cache: Array<Any?>, args: Array<String>): MenuCommandResult {
override fun <P> execute(
player: P,
command: MenuCommand,
cache: Array<Any?>,
args: Array<String>
): MenuCommandResult {
if (command == MenuCommand.TEAM_RED_CONFIGURE) {
cache[2] = 0
}
Expand All @@ -67,6 +46,9 @@ class TeamSettingsPage @Inject constructor(private val proxyService: ProxyServic
} else if (command == MenuCommand.TEAM_SPAWNPOINT) {
val teamMeta = getTeamMeta(cache)
teamMeta.spawnpoint = proxyService.toPosition(proxyService.getEntityLocation<Any, P>(player))
} else if (command == MenuCommand.TEAM_LOBBY) {
val teamMeta = getTeamMeta(cache)
teamMeta.lobbySpawnpoint = proxyService.toPosition(proxyService.getEntityLocation<Any, P>(player))
} else if (command == MenuCommand.TEAM_NAME) {
val teamMeta = getTeamMeta(cache)
val name = mergeArgs(2, args)
Expand Down Expand Up @@ -133,6 +115,11 @@ class TeamSettingsPage @Inject constructor(private val proxyService: ProxyServic
if (teamMeta.spawnpoint != null) {
spawnpoint = teamMeta.spawnpoint!!.toString()
}
var lobby = "none"
if(teamMeta.lobbySpawnpoint != null){
lobby = teamMeta.lobbySpawnpoint!!.toString()
}

return ChatBuilderEntity()
.component("- Name: " + teamMeta.displayName).builder()
.component(MenuClickableItem.EDIT.text).setColor(MenuClickableItem.EDIT.color)
Expand Down Expand Up @@ -184,6 +171,11 @@ class TeamSettingsPage @Inject constructor(private val proxyService: ProxyServic
.setClickAction(ChatClickAction.RUN_COMMAND, MenuCommand.TEAM_SPAWNPOINT.command)
.setHoverText("If this spawnpoint is set the team will spawn at this location instead of the spawning location of the ball.")
.builder().nextLine()
.component("- Lobby: $lobby").builder()
.component(" [location..]").setColor(ChatColor.BLUE)
.setClickAction(ChatClickAction.RUN_COMMAND, MenuCommand.TEAM_LOBBY.command)
.setHoverText("If this spawnpoint is set the team will spawn in its own lobby.")
.builder().nextLine()
.component("- Textbook: ").builder()
.component(MenuClickableItem.PAGE.text).setColor(MenuClickableItem.PAGE.color)
.setClickAction(ChatClickAction.RUN_COMMAND, MenuCommand.TEXTBOOK_OPEN.command)
Expand All @@ -201,4 +193,4 @@ class TeamSettingsPage @Inject constructor(private val proxyService: ProxyServic
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,12 @@ class GameMiniGameActionServiceImpl @Inject constructor(
)
}

if (team == Team.RED && game.arena.meta.redTeamMeta.lobbySpawnpoint != null) {
proxyService.teleport(player, game.arena.meta.redTeamMeta.lobbySpawnpoint)
} else if (team == Team.BLUE && game.arena.meta.blueTeamMeta.lobbySpawnpoint != null) {
proxyService.teleport(player, game.arena.meta.blueTeamMeta.lobbySpawnpoint)
}

val players = if (team == Team.RED) {
game.redTeam
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,6 @@ import com.github.shynixn.blockball.api.persistence.entity.Position
import com.github.shynixn.blockball.api.persistence.entity.TeamMeta
import com.github.shynixn.blockball.core.logic.business.serializer.ItemStackSerializer

/**
* Entity to hold information about the team.
* <p>
* Version 1.2
* <p>
* MIT License
* <p>
* Copyright (c) 2018 by Shynixn
* <p>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* <p>
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* <p>
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
class TeamMetaEntity(
/** DisplayName of the team which gets used in the placeholder <red> or <blue>. */
@YamlSerialize(orderNumber = 1, value = "displayname")
Expand Down Expand Up @@ -109,6 +82,11 @@ class TeamMetaEntity(
/** Spawnpoint of the team inside of the arena. */
@YamlSerialize(orderNumber = 6, value = "spawnpoint", implementation = PositionEntity::class)
override var spawnpoint: Position? = null

/** Optional lobby spawnpoint */
@YamlSerialize(orderNumber = 6, value = "lobby-spawnpoint", implementation = PositionEntity::class)
override var lobbySpawnpoint: Position? = null

/** List of signs for this team */
@YamlSerialize(orderNumber = 11, value = "signs")
private var internalSigns: MutableList<PositionEntity> = ArrayList()
Expand Down

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ tasks.register("printVersion") {

subprojects {
group 'com.github.shynixn.blockball'
version '6.35.0'
version '6.36.0'

sourceCompatibility = 1.8

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.35.0'
version = '6.36.0'
# The full version, including alpha/beta/rc tags.
release = '6.35.0'
release = '6.36.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/customizing/teams.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Properties
* Walking Speed: A highly requested option to allow playing on large fields by changing the players default speed value.
* Spawnpoint: Optional spawnpoint for the team if you do not want the players to join at the ball spawnpoint.
* Textbook: All team specific messages which can be found `here <textbook.html>`_ .

* Lobby-Spawnpoint: Optional team lobby spawnpoint when you join this team.



Expand Down

0 comments on commit 9a31c70

Please sign in to comment.