Skip to content

Commit

Permalink
Merge pull request #403 from Shynixn/development
Browse files Browse the repository at this point in the history
Merge changes to master. --release
  • Loading branch information
Shynixn committed Jul 1, 2021
2 parents 35845d8 + 8de99ef commit bb601e0
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 53 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 jdk16 and plugin
FROM adoptopenjdk/openjdk16
# Change to the current plugin version present in build.gradle
ENV PLUGIN_VERSION=6.25.1
ENV PLUGIN_VERSION=6.25.2
# Change to the server version you want to test.
ENV SERVER_VERSION=1.17-R0.1-SNAPSHOT/spigot-1.17-R0.1-SNAPSHOT.jar
# Port of the Minecraft Server.
Expand Down
3 changes: 0 additions & 3 deletions blockball-bukkit-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ tasks.withType<ShadowJar> {
dependsOn("jar")
archiveName = "${baseName}-${version}-mojangmapping.${extension}"

// Change the output folder of the plugin.
// destinationDir = File("C:\\temp\\plugins")

relocate("kotlin", "com.github.shynixn.blockball.lib.kotlin")

relocate("org.intellij", "com.github.shynixn.blockball.lib.org.intelli")
Expand Down
2 changes: 1 addition & 1 deletion blockball-bukkit-plugin/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: BlockBall
version: 6.25.1
version: 6.25.2
author: Shynixn
website: https://www.spigotmc.org/members/shynixn.63455/
main: com.github.shynixn.blockball.bukkit.BlockBallPlugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,9 @@ import com.github.shynixn.blockball.core.logic.persistence.entity.ArenaEntity
import com.github.shynixn.blockball.core.logic.persistence.entity.PositionEntity
import com.github.shynixn.blockball.core.logic.persistence.entity.TemplateEntity
import com.google.inject.Inject
import java.io.File
import java.nio.file.Files
import kotlin.streams.toList

/**
* 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 TemplateServiceImpl @Inject constructor(
private val configurationService: ConfigurationService,
private val yamlService: YamlService,
Expand All @@ -57,23 +30,27 @@ class TemplateServiceImpl @Inject constructor(
* Returns a [List] of available
*/
override fun getAvailableTemplates(): List<Template> {
val templateFolders = listOf(
"arena" to true,
"template" to false
)

return templateFolders.flatMap { (folderName, existingArena) ->
Files.walk(configurationService.applicationDir.resolve(folderName), 1)
.filter { p -> p.toFile().absolutePath.endsWith(".yml") }
.map { path ->
val configuration = yamlService.read(path)
val templateName = path.fileName.toString().replace(".yml", "")
val translator = configuration.getOrDefault("arena.translator", "unknown") as String

TemplateEntity(templateName, translator, existingArena)
}
.toList()
val templates = ArrayList<Template>()

for (file in File(configurationService.applicationDir.toFile(), "template").listFiles()!!) {
if (file.absolutePath.endsWith(".yml")) {
val configuration = yamlService.read(file.toPath())
val templateName = file.toPath().fileName.toString().replace(".yml", "")
val translator = configuration.getOrDefault("arena.translator", "unknown") as String
templates.add(TemplateEntity(templateName, translator, false))
}
}

for (file in File(configurationService.applicationDir.toFile(), "arena").listFiles()!!) {
if (file.absolutePath.endsWith(".yml")) {
val configuration = yamlService.read(file.toPath())
val templateName = file.toPath().fileName.toString().replace(".yml", "")
val translator = configuration.getOrDefault("arena.translator", "unknown") as String
templates.add(TemplateEntity(templateName, translator, true))
}
}

return templates
}

/**
Expand Down
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.25.1'
version '6.25.2'

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.25.1'
version = '6.25.2'
# The full version, including alpha/beta/rc tags.
release = '6.25.1'
release = '6.25.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down

0 comments on commit bb601e0

Please sign in to comment.