Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Move the preload function from configureil out
Browse files Browse the repository at this point in the history
  • Loading branch information
404Setup committed Sep 3, 2024
1 parent 5306072 commit 03e9e25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 deletions.
28 changes: 2 additions & 26 deletions patches/server/0005-Preload-Utils.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,17 @@ Subject: [PATCH] Preload Utils


diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ccd25a26cfd3b4075279bb89657563fb7f2fbd21..532cd7902711391048a9f7898b94e163da4f87fa 100644
index ccd25a26cfd3b4075279bb89657563fb7f2fbd21..56a2cee4faca2f0ba33ebe0b57b8b206ccd370a2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1175,6 +1175,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

org.spigotmc.WatchdogThread.tick(); // Paper
org.spigotmc.WatchdogThread.hasStarted = true; // Paper
+ one.tranic.vine.config.ConfigUtil.preload(); // Vine
+ one.tranic.vine.util.preload.Preload.INSTANCE.preload(); // Vine
Arrays.fill( this.recentTps, 20 );
// Paper start - further improve server tick loop
long tickSection = Util.getNanos();
diff --git a/src/main/kotlin/one/tranic/vine/config/ConfigUtil.kt b/src/main/kotlin/one/tranic/vine/config/ConfigUtil.kt
index 655dcd125a58aec84ee93a90cf087b0b10052830..9d7008fac113de175d3680f17ac8e60f177352d2 100644
--- a/src/main/kotlin/one/tranic/vine/config/ConfigUtil.kt
+++ b/src/main/kotlin/one/tranic/vine/config/ConfigUtil.kt
@@ -8,6 +8,7 @@ import java.io.File
import one.tranic.vine.commands.*
import one.tranic.vine.region.Compression
import one.tranic.vine.region.Format
+import one.tranic.vine.util.preload.Preload

object ConfigUtil {
private lateinit var configuration: YamlConfiguration
@@ -55,6 +56,11 @@ object ConfigUtil {
}
}

+ @JvmStatic
+ fun preload() {
+ Preload.preload()
+ }
+
private fun addDefault(configFile: File) {
configuration.options().setHeader(
listOf(
diff --git a/src/main/kotlin/one/tranic/vine/util/preload/Preload.kt b/src/main/kotlin/one/tranic/vine/util/preload/Preload.kt
new file mode 100644
index 0000000000000000000000000000000000000000..d549f1ae7ac6585d69b26fa1aeef9d8acbd527a5
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0010-ThreadInfoCommand.patch
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ index 0000000000000000000000000000000000000000..ecc2ed943f88454406bca71780678e41
+}
\ No newline at end of file
diff --git a/src/main/kotlin/one/tranic/vine/config/ConfigUtil.kt b/src/main/kotlin/one/tranic/vine/config/ConfigUtil.kt
index 9d7008fac113de175d3680f17ac8e60f177352d2..c4caef8ed642e20895e9fc9727858694633d31cc 100644
index 655dcd125a58aec84ee93a90cf087b0b10052830..f2acb72254cf89ae62e87556430d456349e87310 100644
--- a/src/main/kotlin/one/tranic/vine/config/ConfigUtil.kt
+++ b/src/main/kotlin/one/tranic/vine/config/ConfigUtil.kt
@@ -16,6 +16,7 @@ object ConfigUtil {
@@ -15,6 +15,7 @@ object ConfigUtil {
@JvmStatic
fun setCommand() {
Bukkit.getCommandMap().register("vinecfg", "vine", VineCfgCommand())
Expand Down

0 comments on commit 03e9e25

Please sign in to comment.