Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
404Setup committed Aug 18, 2024
1 parent 3ac32b2 commit 720a338
Showing 1 changed file with 63 additions and 45 deletions.
108 changes: 63 additions & 45 deletions patches/server/0002-Vine-Config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ index 0000000000000000000000000000000000000000..df01651da27e611d5764618827192d31
\ 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
new file mode 100644
index 0000000000000000000000000000000000000000..037769958e0a5c0e782abe6d276ee99b60c52a35
index 0000000000000000000000000000000000000000..40cbe8f2395ab999a943edd622c396f737b856f7
--- /dev/null
+++ b/src/main/kotlin/one/tranic/vine/config/ConfigUtil.kt
@@ -0,0 +1,324 @@
@@ -0,0 +1,329 @@
+package one.tranic.vine.config
+
+import net.minecraft.server.MinecraftServer
Expand Down Expand Up @@ -216,22 +216,10 @@ index 0000000000000000000000000000000000000000..037769958e0a5c0e782abe6d276ee99b
+ )
+
+ addDefault(
+ "fix.incorrect-bounce-logic",
+ false,
+ listOf(
+ "Fixes some entities not bouncing on slime blocks and getting stuck",
+ "Fixes: https://bugs.mojang.com/browse/MC-216985"
+ )
+ )
+ addDefault(
+ "fix.explosion-breaks-item-frame-in-water",
+ "fix.nether-portal",
+ false,
+ listOf(
+ "Fixes Explosions being able to destroy item frames in water",
+ "Fixes: https://bugs.mojang.com/browse/MC-3697"
+ )
+ "Ensures correct destinations when travelling back and forth through Nether Portals in Multiplayer."
+ )
+
+ addDefault(
+ "fix.anvil-drop.enabled",
+ true,
Expand All @@ -245,22 +233,32 @@ index 0000000000000000000000000000000000000000..037769958e0a5c0e782abe6d276ee99b
+ "Whether to print detailed information to the console when this issue is triggered"
+ )
+ addDefault(
+ "fix.nether-portal",
+ "fix.explosion-breaks-item-frame-in-water",
+ false,
+ "Ensures correct destinations when travelling back and forth through Nether Portals in Multiplayer."
+ listOf(
+ "Fixes Explosions being able to destroy item frames in water",
+ "Fixes: https://bugs.mojang.com/browse/MC-3697"
+ )
+ )
+ addDefault(
+ "fix.incorrect-bounce-logic",
+ false,
+ listOf(
+ "Fixes some entities not bouncing on slime blocks and getting stuck",
+ "Fixes: https://bugs.mojang.com/browse/MC-216985"
+ )
+ )
+
+ addDefault(
+ "feature.dont-save-entity.primed-tnt", false, listOf(
+ "Disable save primed tnt on chunk unloads.",
+ "Useful for redstone server, can prevent machine be exploded by TNT,",
+ "when player disconnected caused by Internet issue."
+ "feature.try-virtual-threads",
+ false,
+ listOf(
+ "Try virtual threads. Once enabled, all explicit platform threads will ",
+ "be replaced with virtual threads as much as possible, which may have ",
+ "some adverse consequences. Please enable it with caution."
+ )
+ )
+ addDefault("feature.dont-save-entity.falling-block", false)
+ addDefault("feature.zero-tick-plants", false)
+ addDefault("feature.vanilla-hopper", false)
+ addDefault("feature.disable-spark", true)
+ addDefault(
+ "feature.flatten-triangular-distribution",
+ false,
Expand All @@ -269,6 +267,15 @@ index 0000000000000000000000000000000000000000..037769958e0a5c0e782abe6d276ee99b
+ "With that edge cases are more likely to happen"
+ )
+ )
+ addDefault("feature.zero-tick-plants", false)
+ addDefault(
+ "feature.disable-respawn-ceiling",
+ false,
+ listOf(
+ "If the player is blocked on the top of the player's head, he will not try to rebirth the player on the ceiling.",
+ "This is suitable for those servers with ceilings."
+ )
+ )
+ addDefault(
+ "feature.secure-seed", false, listOf(
+ "Changes the seed from 64bit to 1024bit, this will strictly secure your seed,",
Expand All @@ -278,17 +285,25 @@ index 0000000000000000000000000000000000000000..037769958e0a5c0e782abe6d276ee99b
+ "cannot continue to load maps."
+ )
+ )
+ addDefault("feature.disable-spark", true)
+ addDefault(
+ "feature.try-virtual-threads",
+ "feature.dont-save-entity.primed-tnt", false, listOf(
+ "Disable save primed tnt on chunk unloads.",
+ "Useful for redstone server, can prevent machine be exploded by TNT,",
+ "when player disconnected caused by Internet issue."
+ )
+ )
+ addDefault("feature.dont-save-entity.falling-block", false)
+
+ addDefault("optimize.floating-point-positive", false)
+ addDefault(
+ "optimize.skip-self-raid-check",
+ false,
+ listOf(
+ "Try virtual threads. Once enabled, all explicit platform threads will ",
+ "be replaced with virtual threads as much as possible, which may have ",
+ "some adverse consequences. Please enable it with caution."
+ "Whether to skip some raid checks.",
+ "Enabling this will significantly reduce the server's performance."
+ )
+ )
+ addDefault("feature.disable-respawn-ceiling", false)
+
+ addDefault(
+ "optimize.minecart.enabled", true,
+ listOf(
Expand All @@ -300,14 +315,6 @@ index 0000000000000000000000000000000000000000..037769958e0a5c0e782abe6d276ee99b
+ addDefault("optimize.minecart.skipTickCount", 30)
+
+ addDefault(
+ "optimize.raider-die-skip-self-raid-check",
+ false,
+ listOf(
+ "Whether to skip some raid checks.",
+ "Enabling this will significantly reduce the server's performance."
+ )
+ )
+ addDefault(
+ "optimize.mob-re-pathfinding",
+ true,
+ "If true, disables the frequent pathfinds done while already following a path"
Expand All @@ -324,19 +331,17 @@ index 0000000000000000000000000000000000000000..037769958e0a5c0e782abe6d276ee99b
+ )
+
+ addDefault("optimize.noise-generation", true)
+ addDefault("optimize.floating-point-positive", false)
+
+ configuration.options().copyDefaults(true)
+ configuration.save(configFile)
+ }
+
+ private fun loadConfigValue() {
+ Fix.incorrectBounceLogic = getBoolean("fix.incorrect-bounce-logic")
+ Fix.explosionBreaksItemFrameInWater = getBoolean("fix.explosion-breaks-item-frame-in-water")
+
+ Fix.netherPortal = getBoolean("fix.nether-portal")
+ Fix.anvilDrop = getBoolean("fix.anvil-drop.enabled")
+ Fix.anvilDropLogger = getBoolean("fix.anvil-drop.debug")
+ Fix.netherPortal = getBoolean("fix.nether-portal")
+ Fix.explosionBreaksItemFrameInWater = getBoolean("fix.explosion-breaks-item-frame-in-water")
+ Fix.incorrectBounceLogic = getBoolean("fix.incorrect-bounce-logic")
+
+ getBoolean("feature.try-virtual-threads") {
+ if (isPlatform == null) {
Expand Down Expand Up @@ -372,7 +377,7 @@ index 0000000000000000000000000000000000000000..037769958e0a5c0e782abe6d276ee99b
+ Optimize.Minecart.enabled = getBoolean("optimize.minecart.enabled")
+ Optimize.Minecart.skipTickCount = getInt("optimize.minecart.skipTickCount")
+
+ Optimize.skipSelfRaidCheck = getBoolean("optimize.raider-die-skip-self-raid-check")
+ Optimize.skipSelfRaidCheck = getBoolean("optimize.skip-self-raid-check")
+ Optimize.mobRePathfinding = getBoolean("optimize.mob-re-pathfinding")
+ Optimize.TurtleEggSearch.enabled =
+ getBoolean("optimize.zombie-search-and-destroy-turtle-egg.enabled")
Expand Down Expand Up @@ -456,3 +461,16 @@ index 0000000000000000000000000000000000000000..037769958e0a5c0e782abe6d276ee99b
+ // Vine end - Configuration file tools
+}
\ No newline at end of file
diff --git a/src/main/kotlin/one/tranic/vine/config/LongConfig.kt b/src/main/kotlin/one/tranic/vine/config/LongConfig.kt
new file mode 100644
index 0000000000000000000000000000000000000000..7085c33ee308b2841306c8c028f0c337ba167bef
--- /dev/null
+++ b/src/main/kotlin/one/tranic/vine/config/LongConfig.kt
@@ -0,0 +1,6 @@
+package one.tranic.vine.config
+
+interface LongConfig {
+ fun default()
+ fun load()
+}
\ No newline at end of file

0 comments on commit 720a338

Please sign in to comment.