Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minecraft 1.20.6, Kotlin 2.0.0, dependency updates, small QOL additions #70

Merged
merged 20 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
fff0578
refactor(logger): deprecate iSuccess/iFail in favor of s/f with a sev…
0ffz Mar 18, 2024
21a9e2c
refactor(1.20.5): Begin 1.20.5 update
0ffz May 2, 2024
1b0aaa7
refactor(1.20.5): Bump libs
0ffz May 2, 2024
d1336a1
chore(1.20.5): Bump github workflow to jvm 21
0ffz May 2, 2024
9c0445c
fix(1.20.5): Use jvm 21 on multiplatform too
0ffz May 2, 2024
9d00e2f
chore(1.20.5): Don't reobfuscate jars for paper plugins
0ffz May 2, 2024
fff4f47
feat: add all new 1.20.6 item-properties
Boy0000 May 11, 2024
c883fe7
fix: applyTo never being changed because of ItemStack#withType making…
Boy0000 May 11, 2024
ae07077
fix: minor nullpointer logic in SerializableItemStack
Boy0000 May 11, 2024
2908f8d
fix: ensure that attribtue-tooltips are hidden when itemflag is set
Boy0000 May 11, 2024
b2f2557
fix: wrong shadowjar depÃ
Boy0000 May 12, 2024
6142a26
chore: bump userdev
Boy0000 May 12, 2024
43d1af1
fix: switch AttributeModifierSerializer to use EquipmentSlotGroup
Boy0000 May 12, 2024
1bc5354
refactor: make serializer-package depend on nms and move hideTooltip …
Boy0000 May 12, 2024
375b46f
refactor: make IdofrontPlugin a kotlin-file
Boy0000 May 12, 2024
cfdcde1
fix: FoodComponentSerializer missing default values
Boy0000 May 12, 2024
115b79a
fix: SerializablePrefabItemService not returning itemstacks
Boy0000 May 13, 2024
da1921d
feat: add RecipeBookCategory to SerializableRecipe
Boy0000 May 13, 2024
98dcd09
refactor: serializer default values
Boy0000 May 13, 2024
f52b1e1
chore: Kotlin 2.0.0, new compose compiler, bump other deps
0ffz May 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
java-version: 21
cache: gradle

- name: Build
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ subprojects {

tasks {
withType<KotlinCompile> {
kotlinOptions {
compilerOptions {
freeCompilerArgs = listOf(
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group=com.mineinabyss
version=0.23
version=0.24
48 changes: 25 additions & 23 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
[versions]
anvilgui = "1.9.2-SNAPSHOT"
compose = "1.6.1"
coroutines = "1.8.0"
creative = "1.7.0"
compose = "1.6.10"
coroutines = "1.8.1"
creative = "1.7.2"
dependencyversions = "0.51.0"
dokka = "1.9.0"
exposed = "0.48.0"
exposed = "0.50.1"
fastutil = "8.2.2"
fawe = "2.8.4"
itemsadder = "3.6.1"
junit = "5.10.2"
jvm = "17"
kaml = "0.57.0"
kmongo = "4.11.0"
kotest = "5.8.1"
junit = "5.11.0-M2"
jvm = "21"
jvm-for-kotlin-multiplatform = "21"
kaml = "0.59.0"
kmongo = "5.1.0"
kotest = "5.9.0"
# @pin
kotlin = "1.9.23"
kotlin = "2.0.0"
kt-statistics = "1.2.1"
ktor = "2.3.9"
logback = "1.5.3"
mccoroutine = "2.15.0"
ktor = "2.3.11"
logback = "1.5.6"
mccoroutine = "2.16.0"
# @pin
minecraft = "1.20.4-R0.1-SNAPSHOT"
mockbukkit = "3.78.0"
mockk = "1.13.10"
minecraft = "1.20.6-R0.1-SNAPSHOT"
mockbukkit = "3.87.0"
mockk = "1.13.11"
modelengine = "R4.0.4"
mythic-dist = "5.6.0"
mythiccrucible = "2.0.0-SNAPSHOT"
oraxen = "1.170.0"
oraxen = "1.175.0"
protocollib = "5.1.0"
reflections = "0.10.2"
serialization = "1.6.3"
shadowjar = "8.1.1"
sqlite-jdbc = "3.45.2.0"
userdev = "1.5.11"
shadowjar = "8.1.7"
sqlite-jdbc = "3.46.0.0"
userdev = "1.7.1"
vault = "1.7"
version-catalog-update = "0.8.4"
worldguard = "7.1.0-SNAPSHOT"
Expand All @@ -50,7 +51,7 @@ fastutil = { module = "it.unimi.dsi:fastutil", version.ref = "fastutil" }
gradle-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
gradle-paperweight-userdev = { module = "io.papermc.paperweight:paperweight-userdev", version.ref = "userdev" }
gradle-shadowjar = { module = "com.github.johnrengelman:shadow", version.ref = "shadowjar" }
gradle-shadowjar = { module = "io.github.goooler.shadow:shadow-gradle-plugin", version.ref = "shadowjar" }
junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
kermit = "co.touchlab:kermit:2.0.3"
Expand Down Expand Up @@ -150,11 +151,12 @@ platform = [
]

[plugins]
compose = { id = "org.jetbrains.compose", version.ref = "compose" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
dependencyversions = { id = "com.github.ben-manes.versions", version.ref = "dependencyversions" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
shadowjar = { id = "com.github.johnrengelman.shadow", version.ref = "shadowjar" }
shadowjar = { id = "io.github.goooler.shadow:shadow-gradle-plugin", version.ref = "shadowjar" }
version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "version-catalog-update" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.mineinabyss.idofront

import org.bukkit.plugin.java.JavaPlugin

class IdofrontPlugin : JavaPlugin() {
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Command(
if (sender is ConsoleCommandSender && subcommands.size > 1) topCommandInfo = "\n" + topCommandInfo

subCommandsInfo = subcommands.filter { permissionsMetFor(it, false) }.mapIndexed { i, it ->
var line = " <gold> ${if (i == subcommands.size - 1) "┗" else "┣"} <i>${it.names.first()}</i><gray> "
var line = " <gold> ${if (i == subcommands.size - 1) "┗" else "┣"} <i>${it.names.firstOrNull()}</i><gray> "
if (it.description.isNotEmpty()) line += "- ${it.description}"
line
}.joinToString(separator = "\n")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.mineinabyss.idofront.config

import com.charleskorn.kaml.SingleLineStringStyle
import com.charleskorn.kaml.Yaml
import com.charleskorn.kaml.YamlConfiguration
import com.charleskorn.kaml.*
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.SerializationStrategy
import kotlinx.serialization.StringFormat
Expand Down
23 changes: 3 additions & 20 deletions idofront-di/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,10 @@ plugins {

kotlin {
jvm()
js(IR) {
js {
browser()
nodejs()
}
val hostOs = System.getProperty("os.name")
val isMingwX64 = hostOs.startsWith("Windows")
val nativeTarget = when {
hostOs == "Mac OS X" -> macosX64("native")
hostOs == "Linux" -> linuxX64("native")
isMingwX64 -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}

sourceSets {
val commonMain by getting
val commonTest by getting
val jvmMain by getting
val jvmTest by getting
val jsMain by getting
val jsTest by getting
val nativeMain by getting
val nativeTest by getting
}
mingwX64()
linuxX64()
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ abstract class FeatureManager<T : FeatureDSL>(
val featuresWithMetDeps = context.features.filter { feature -> feature.dependsOn.all { Plugins.isEnabled(it) } }
(context.features - featuresWithMetDeps.toSet()).forEach { feature ->
val featureName = feature::class.simpleName
logger.iFail("Could not enable $featureName, missing dependencies: ${feature.dependsOn.filterNot(Plugins::isEnabled)}")
logger.f("Could not enable $featureName, missing dependencies: ${feature.dependsOn.filterNot(Plugins::isEnabled)}")
}
"Registering feature contexts" {
featuresWithMetDeps
.filterIsInstance<FeatureWithContext<*>>()
.forEach {
runCatching {
it.createAndInjectContext()
}.onFailure { error -> logger.iFail("Failed to create context for ${it::class.simpleName}: $error") }
}.onFailure { error -> logger.f("Failed to create context for ${it::class.simpleName}: $error") }
}
}

Expand Down Expand Up @@ -114,8 +114,8 @@ abstract class FeatureManager<T : FeatureDSL>(
"Disabling features" {
context.features.forEach { feature ->
runCatching { feature.disable(context) }
.onSuccess { logger.iSuccess("Disabled ${feature::class.simpleName}") }
.onFailure { e -> logger.iFail("Failed to disable ${feature::class.simpleName}: $e") }
.onSuccess { logger.s("Disabled ${feature::class.simpleName}") }
.onFailure { e -> logger.f("Failed to disable ${feature::class.simpleName}: $e") }
}
}
removeContext()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import kotlin.jvm.optionals.getOrNull

plugins {
java
com.github.johnrengelman.shadow
io.github.goooler.shadow
}

val pluginPath = project.findProperty("plugin_path") as? String
Expand All @@ -25,7 +25,7 @@ if (pluginPath != null) {
val dest = copyJar.destPath.orNull ?: pluginPath
val jarName = copyJar.jarName.orNull ?: "${project.name}-${project.version}.jar"

from(findByName("reobfJar") ?: findByName("shadowJar") ?: findByName("jar"))
from(findByName("shadowJar") ?: findByName("jar"))
into(dest)
doLast {
println("Copied to plugin directory $dest")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand Down Expand Up @@ -35,6 +36,8 @@ kotlin {

tasks {
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "$jvmVersion"
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repositories {

val libs = idofrontLibsRef

val jvmVersion: Int = libs.findVersion("jvm").get().toString().toInt()
val jvmVersion: Int = libs.findVersion("jvm-for-kotlin-multiplatform").get().toString().toInt()

kotlin {
jvmToolchain(jvmVersion)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("multiplatform")
}
Expand All @@ -21,3 +24,11 @@ kotlin {
}
}
}

tasks {
withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ val libs = idofrontLibsRef

dependencies {
paperweight.paperDevBundle(libs.findVersion("minecraft").get().toString())
}

tasks {
assemble {
dependsOn(reobfJar)
}
}

paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
val libs = idofrontLibsRef

repositories {
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven("https://repo.papermc.io/repository/maven-public/")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,51 @@ open class ComponentLogger(
i(message.miniMsg())
}

fun iSuccess(message: String) {
iSuccess(message.miniMsg())
@Deprecated("Replaced with s", ReplaceWith("s(message)"))
fun iSuccess(message: String) = s(message)

@Deprecated("Replaced with s", ReplaceWith("s(message)"))
fun iSuccess(message: ComponentLike) = s(message)

@Deprecated("Replaced with f", ReplaceWith("f(message)"))
fun iFail(message: String) = f(message)

@Deprecated("Replaced with f", ReplaceWith("f(message)"))
fun iFail(message: ComponentLike) = f(message)

/**
* Sends a green success message with an emote prefixed.
* Uses default console colors when [severity] is above [Severity.Warn]
*/
fun s(message: String, severity: Severity = Severity.Info) {
s(message.miniMsg(), severity)
}

fun iSuccess(message: ComponentLike) {
if (config.minSeverity <= Severity.Info)
/**
* Sends a green success message with an emote prefixed.
* Uses default console colors when [severity] is above [Severity.Warn]
*/
fun s(message: ComponentLike, severity: Severity = Severity.Info) {
if (config.minSeverity <= severity)
logComponent(Severity.Info, successComp.append(message), TextColor.color(0x008000))
}

fun iFail(message: String) {
iFail(message.miniMsg())
/**
* Sends a red failure message with an emote prefixed.
* Should only be used to notify users of a handled error, ex. config failing to load and thus being skipped.
* Uses default console colors when [severity] is above [Severity.Warn]
*/
fun f(message: String, severity: Severity = Severity.Info) {
f(message.miniMsg(), severity)
}

fun iFail(message: ComponentLike) {
if (config.minSeverity <= Severity.Info)
/**
* Sends a red failure message with an emote prefixed.
* Should only be used to notify users of a handled error, ex. config failing to load and thus being skipped.
* Uses default console colors when [severity] is above [Severity.Warn]
*/
fun f(message: ComponentLike, severity: Severity = Severity.Info) {
if (config.minSeverity <= severity)
logComponent(Severity.Info, errorComp.append(message), TextColor.color(0xFF0000))
}

Expand Down
Loading
Loading