Skip to content

Commit 4c019c8

Browse files
committed
chore: downgrade configurate
1 parent 7db8cf9 commit 4c019c8

4 files changed

Lines changed: 15 additions & 6 deletions

File tree

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66

77
allprojects {
88
group = "org.sayandev"
9-
version = "1.8.9.16"
9+
version = "1.8.9.22"
1010
description = "A modular Kotlin framework for Minecraft: JE"
1111

1212
plugins.apply("maven-publish")

gradle/libs.versions.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
kotlin = "2.1.0"
66
kotlin-poet = "1.17.0"
77
snakeyaml = "2.2"
8-
configurate = "4.3.0"
8+
#configurate = "4.3.0"
9+
configurate = "4.1.2"
910
cloud = "2.0.0"
1011
cloud-platform = "2.0.0-beta.10"
1112
#cloud-minecraft = "2.0.2-SNAPSHOT"

stickynote-bukkit/src/main/kotlin/org/sayandev/stickynote/bukkit/hook/PlaceholderAPIHook.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,31 @@ object PlaceholderAPIHook {
1010
var injectComponent: Boolean = false
1111
var sendWarningIfNotInstalled: Boolean = false
1212

13+
@JvmStatic
1314
fun injectComponent(): PlaceholderAPIHook {
1415
this.injectComponent = true
1516
return this
1617
}
1718

19+
@JvmStatic
1820
fun injectComponent(injectComponent: Boolean): PlaceholderAPIHook {
1921
this.injectComponent = injectComponent
2022
return this
2123
}
2224

25+
@JvmStatic
2326
fun sendWarningIfNotInstalled(): PlaceholderAPIHook {
2427
this.sendWarningIfNotInstalled = true
2528
return this
2629
}
2730

31+
@JvmStatic
2832
fun sendWarningIfNotInstalled(sendWarningIfNotInstalled: Boolean): PlaceholderAPIHook {
2933
this.sendWarningIfNotInstalled = sendWarningIfNotInstalled
3034
return this
3135
}
3236

37+
@JvmStatic
3338
fun injectPlaceholders(player: OfflinePlayer?, content: String): String {
3439
var finalContent = content
3540
if (injectComponent) {

stickynote-core/src/main/kotlin/org/sayandev/stickynote/core/configuration/Config.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ abstract class Config(
3232
constructor(directory: File, name: String) : this(directory, name, null)
3333
constructor(directoryPath: Path, name: String) : this(directoryPath.toFile(), name, null)
3434

35-
@Transient var yaml = builder.nodeStyle(NodeStyle.BLOCK).defaultOptions(generateOptions(serializers)).build()
35+
@Transient var yaml = builder.defaultOptions(generateOptions(serializers)).build()
3636
@Transient var config = yaml.load(generateOptions(serializers))
3737

3838
open fun save() {
@@ -73,20 +73,23 @@ abstract class Config(
7373
return ConfigurationOptions.defaults()
7474
.shouldCopyDefaults(true)
7575
.serializers { builder ->
76-
builder.registerAnnotatedObjects(objectMapperFactory())
77-
// builder.registerAll(TypeSerializerCollection.defaults())
7876
builder.register(Enum::class.java, EnumSerializer())
7977
if (serializers != null) {
8078
builder.registerAll(serializers)
8179
}
80+
81+
// Make sure to register defaults after custom serializers
82+
builder.registerAll(TypeSerializerCollection.defaults())
83+
builder.registerAnnotatedObjects(objectMapperFactory())
8284
}
8385
}
8486

8587
@JvmStatic
8688
fun getConfigBuilder(file: File, serializers: TypeSerializerCollection?): YamlConfigurationLoader.Builder {
8789
val yaml = YamlConfigurationLoader.builder()
88-
.commentsEnabled(true)
90+
// .commentsEnabled(true)
8991
.nodeStyle(NodeStyle.BLOCK)
92+
.indent(2)
9093
.defaultOptions(generateOptions(serializers))
9194
.file(file)
9295
return yaml

0 commit comments

Comments
 (0)