Skip to content

Commit

Permalink
Merge branch 'refs/heads/20'
Browse files Browse the repository at this point in the history
# Conflicts:
#	Essential/src/test/kotlin/PluginTest.kt
#	src/main/kotlin/essentials/Commands.kt
#	src/main/kotlin/essentials/Event.kt
#	src/main/kotlin/essentials/Main.kt
#	src/main/kotlin/essentials/Permission.kt
  • Loading branch information
Kieaer committed Dec 2, 2024
2 parents 7afd33a + 803a980 commit 54d3283
Show file tree
Hide file tree
Showing 208 changed files with 94,704 additions and 8,507 deletions.
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,9 @@ src/main/resources/www

node_modules
package-lock.json
package.json
/maps/
/maps/
/scripts/
/.kotlin/
/*/build
/Essential/maps
/EssentialWeb/src/main/resources/www
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

103 changes: 103 additions & 0 deletions Essential/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
plugins {
kotlin("jvm") version "1.9.22"
id("org.jetbrains.kotlin.plugin.serialization") version "2.0.0"
id("com.github.johnrengelman.shadow") version "8.1.1"
}

repositories {
mavenLocal()
mavenCentral()
maven(url = "https://raw.githubusercontent.com/Zelaux/MindustryRepo/master/repository")
maven(url = "https://www.jitpack.io")
}

val mindustryVersion = "v146"

dependencies {
compileOnly("com.github.Anuken.Arc:arc-core:$mindustryVersion")
compileOnly("com.github.Anuken.mindustryjitpack:core:$mindustryVersion")
compileOnly("com.github.Anuken.mindustryjitpack:server:$mindustryVersion")

implementation("com.charleskorn.kaml:kaml-jvm:0.59.0")
implementation("org.jetbrains.exposed:exposed-core:0.51.0")
implementation("org.jetbrains.exposed:exposed-jdbc:0.51.0")
implementation("org.jetbrains.exposed:exposed-java-time:0.51.1")

runtimeOnly("org.slf4j:slf4j-nop:2.0.13")

implementation("com.github.PersonTheCat:hjson-java:3.0.0-C11")
implementation("de.svenkubiak:jBCrypt:0.4.3")
implementation("org.apache.maven:maven-artifact:4.0.0-alpha-3")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.17.2")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.17.2")
implementation("io.github.classgraph:classgraph:4.8.173")
implementation("com.github.lalyos:jfiglet:0.0.9")

val rulesVersion = "1.19.0"
val dataFakerVersion = "1.8.1"
val mockitoVersion = "5.4.0"
val jtsVersion = "1.19.0"

testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("com.github.Anuken.Arc:arc-core:$mindustryVersion")
testImplementation("com.github.Anuken.mindustryjitpack:server:$mindustryVersion")
testImplementation("com.github.Anuken.mindustryjitpack:core:$mindustryVersion")
testImplementation("com.github.Anuken.Arc:backend-headless:$mindustryVersion")
testImplementation("com.github.stefanbirkner:system-rules:$rulesVersion")
testImplementation("net.datafaker:datafaker:$dataFakerVersion")
testImplementation("org.mockito:mockito-core:$mockitoVersion")
testImplementation("org.locationtech.jts:jts-core:$jtsVersion")
testImplementation("com.h2database:h2:1.4.200")

implementation("ch.qos.logback:logback-classic:1.2.3")
}

tasks.test {
useJUnitPlatform()
}

configurations.all {
resolutionStrategy.eachDependency {
if (this.requested.group == "com.github.Anuken.Arc") {
this.useVersion(mindustryVersion)
}
}
}

sourceSets{
test{
resources{
srcDir("src/main/resources")
}
}
}

tasks.jar {
from(sourceSets.main.get().output) {
exclude("**/mindustry/**")
}

from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }) {
exclude("META-INF/*.SF")
exclude("META-INF/*.DSA")
exclude("META-INF/*.RSA")
}

duplicatesStrategy = DuplicatesStrategy.INCLUDE

manifest {
attributes["Main-Class"] = "essentials.core.Main"
}


}

tasks.shadowJar {
dependsOn("jar")

minimize {
exclude(dependency("org.jetbrains.exposed:.*:.*"))
exclude(dependency("org.slf4j:slf4j-api:.*"))
exclude(dependency("org.slf4j:slf4j-nop:.*"))
}
}
46 changes: 46 additions & 0 deletions Essential/src/main/kotlin/essential/core/Bundle.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package essential.core

import java.text.MessageFormat
import java.util.*

class Bundle {
val resource: ResourceBundle
var prefix: String = ""
var locale: Locale = Locale.ENGLISH

constructor() {
resource = ResourceBundle.getBundle("bundle", locale)
}

constructor(source: ResourceBundle) {
resource = source
}

constructor(languageTag: String) {
locale = try {
when (languageTag.substring(0, 2)) {
"ko" -> Locale.KOREA
else -> Locale.ENGLISH
}
} catch (e: Exception) {
Locale.ENGLISH
}
resource = ResourceBundle.getBundle("bundle", locale)
}

operator fun get(key: String): String {
return if (prefix.isEmpty()) {
MessageFormat.format(resource.getString(key))
} else {
"$prefix " + MessageFormat.format(resource.getString(key))
}
}

operator fun get(key: String, vararg parameter: Any): String {
return if (prefix.isEmpty()) {
MessageFormat.format(resource.getString(key), *parameter)
} else {
"$prefix " + MessageFormat.format(resource.getString(key), *parameter)
}
}
}
Loading

0 comments on commit 54d3283

Please sign in to comment.