@@ -24,14 +24,14 @@ index efed51a692d94acd9126f6eb2866755567c2e636..fd308bb5dc3f90d7b76240dd0d5026b7
24
24
25
25
}
26
26
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
27
- index a7ffbbfd2a9fdeae0953ec8753ce48e93ccce086..d7891588cd7dbc9e5f9921cc2f5bf5145678f27e 100644
27
+ index a7ffbbfd2a9fdeae0953ec8753ce48e93ccce086..32d9eba81500be7ab64bd027499c96f6804a68cd 100644
28
28
--- a/src/main/java/net/minecraft/server/Main.java
29
29
+++ b/src/main/java/net/minecraft/server/Main.java
30
30
@@ -58,6 +58,7 @@ import net.minecraft.world.level.storage.LevelResource;
31
31
import net.minecraft.world.level.storage.LevelStorageSource;
32
32
import net.minecraft.world.level.storage.LevelSummary;
33
33
import net.minecraft.world.level.storage.PrimaryLevelData;
34
- + import one.tranic.levelpowered. vine.config.VineConfig;
34
+ + import one.tranic.vine.config.VineConfig;
35
35
import org.slf4j.Logger;
36
36
37
37
// CraftBukkit start
@@ -45,7 +45,7 @@ index a7ffbbfd2a9fdeae0953ec8753ce48e93ccce086..d7891588cd7dbc9e5f9921cc2f5bf514
45
45
46
46
// Purpur start - load config files early
47
47
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
48
- index d281fe5f75f6f99f869fa3cc8da4f1ff9f96a7bf..a7c3e628762a93803418f462ef57741183345ebc 100644
48
+ index d281fe5f75f6f99f869fa3cc8da4f1ff9f96a7bf..09c17974579797588d5fbd290bc2ce9b3ebab89b 100644
49
49
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
50
50
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
51
51
@@ -1,20 +1,14 @@
@@ -73,7 +73,7 @@ index d281fe5f75f6f99f869fa3cc8da4f1ff9f96a7bf..a7c3e628762a93803418f462ef577411
73
73
import net.minecraft.world.level.GameType;
74
74
import net.minecraft.world.level.block.entity.SkullBlockEntity;
75
75
import net.minecraft.world.level.storage.LevelStorageSource;
76
- + import one.tranic.levelpowered. vine.config.VineConfig;
76
+ + import one.tranic.vine.config.VineConfig;
77
77
import org.slf4j.Logger;
78
78
79
79
// CraftBukkit start
@@ -97,15 +97,15 @@ index d281fe5f75f6f99f869fa3cc8da4f1ff9f96a7bf..a7c3e628762a93803418f462ef577411
97
97
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
98
98
if (this.convertOldUsers()) {
99
99
this.getProfileCache().save(false); // Paper
100
- diff --git a/src/main/kotlin/one/tranic/levelpowered/ vine/commands/VineCfgCommand.kt b/src/main/kotlin/one/tranic/levelpowered /vine/commands/VineCfgCommand.kt
100
+ diff --git a/src/main/kotlin/one/tranic/vine/commands/VineCfgCommand.kt b/src/main/kotlin/one/tranic/vine/commands/VineCfgCommand.kt
101
101
new file mode 100644
102
- index 0000000000000000000000000000000000000000..dd96b107b3208707958735ef059c6b20115cdcad
102
+ index 0000000000000000000000000000000000000000..6feb7269907d2c88a9eb5b52204e55c10a8b7262
103
103
--- /dev/null
104
- +++ b/src/main/kotlin/one/tranic/levelpowered/ vine/commands/VineCfgCommand.kt
104
+ +++ b/src/main/kotlin/one/tranic/vine/commands/VineCfgCommand.kt
105
105
@@ -0,0 +1,34 @@
106
- + package one.tranic.levelpowered. vine.commands
106
+ + package one.tranic.vine.commands
107
107
+
108
- + import one.tranic.levelpowered. vine.config.VineConfig
108
+ + import one.tranic.vine.config.VineConfig
109
109
+ import org.bukkit.command.Command
110
110
+ import org.bukkit.command.CommandSender
111
111
+ import net.kyori.adventure.text.Component
@@ -138,23 +138,24 @@ index 0000000000000000000000000000000000000000..dd96b107b3208707958735ef059c6b20
138
138
+ }
139
139
+ }
140
140
\ No newline at end of file
141
- diff --git a/src/main/kotlin/one/tranic/levelpowered/ vine/config/VineConfig.kt b/src/main/kotlin/one/tranic/levelpowered /vine/config/VineConfig.kt
141
+ diff --git a/src/main/kotlin/one/tranic/vine/config/VineConfig.kt b/src/main/kotlin/one/tranic/vine/config/VineConfig.kt
142
142
new file mode 100644
143
- index 0000000000000000000000000000000000000000..960b0d79a27c111d2d9750c05e04f8a0f216b7b0
143
+ index 0000000000000000000000000000000000000000..c0f0466810dc9764b69dda0aeae3fae53054dcd8
144
144
--- /dev/null
145
- +++ b/src/main/kotlin/one/tranic/levelpowered/ vine/config/VineConfig.kt
146
- @@ -0,0 +1,225 @@
147
- + package one.tranic.levelpowered. vine.config
145
+ +++ b/src/main/kotlin/one/tranic/vine/config/VineConfig.kt
146
+ @@ -0,0 +1,223 @@
147
+ + package one.tranic.vine.config
148
148
+
149
149
+ import gg.pufferfish.pufferfish.simd.SIMDDetection
150
150
+ import net.minecraft.server.MinecraftServer
151
- + import one.tranic.levelpowered. vine.commands.VineCfgCommand
151
+ + import one.tranic.vine.commands.VineCfgCommand
152
152
+ import org.bukkit.Bukkit
153
153
+ import org.bukkit.configuration.file.YamlConfiguration
154
154
+ import java.io.File
155
155
+
156
156
+ object VineConfig {
157
- + var logger: org.slf4j.Logger = MinecraftServer.LOGGER
157
+ + val logger: org.slf4j.Logger = MinecraftServer.LOGGER
158
+ + private const val CONFIG_VERSION = "2.0"
158
159
+ private lateinit var configuration: YamlConfiguration
159
160
+
160
161
+ @JvmStatic
@@ -180,6 +181,7 @@ index 0000000000000000000000000000000000000000..960b0d79a27c111d2d9750c05e04f8a0
180
181
+ @JvmStatic
181
182
+ fun load() {
182
183
+ reload()
184
+ + reload()
183
185
+ // Pufferfish start
184
186
+ // Attempt to detect vectorization
185
187
+ runCatching {
@@ -205,20 +207,20 @@ index 0000000000000000000000000000000000000000..960b0d79a27c111d2d9750c05e04f8a0
205
207
+ private fun addDefault(configFile: File) {
206
208
+ addDefault(
207
209
+ "info",
208
- + "1.0" ,
210
+ + CONFIG_VERSION ,
209
211
+ listOf("Vine Abstract Configuration", "Vine Github: https://github.com/LevelTranic/Vine")
210
212
+ )
211
213
+
212
214
+ addDefault(
213
- + "vine. fix.incorrect-bounce-logic",
215
+ + "fix.incorrect-bounce-logic",
214
216
+ false,
215
217
+ listOf(
216
218
+ "Fixes some entities not bouncing on slime blocks and getting stuck",
217
219
+ "Fixes: https://bugs.mojang.com/browse/MC-216985"
218
220
+ )
219
221
+ )
220
222
+ addDefault(
221
- + "vine. fix.explosion-breaks-item-frame-in-water",
223
+ + "fix.explosion-breaks-item-frame-in-water",
222
224
+ false,
223
225
+ listOf(
224
226
+ "Fixes Explosions being able to destroy item frames in water",
@@ -227,66 +229,66 @@ index 0000000000000000000000000000000000000000..960b0d79a27c111d2d9750c05e04f8a0
227
229
+ )
228
230
+
229
231
+ addDefault(
230
- + "levelbukkit.try- fix- anvil-drop.enabled",
232
+ + "fix. anvil-drop.enabled",
231
233
+ true,
232
234
+ listOf(
233
235
+ "This fix will attempt to prevent the bug in https://github.com/PaperMC/Folia/issues/217, ",
234
236
+ "it may cause some unexpected effects but should be harmless."
235
237
+ )
236
238
+ )
237
239
+ addDefault(
238
- + "levelbukkit.try- fix- anvil-drop.debug", false,
240
+ + "fix. anvil-drop.debug", false,
239
241
+ "Whether to print detailed information to the console when this issue is triggered"
240
242
+ )
241
243
+
242
244
+ addDefault(
243
- + "leaf. optimize- minecart.enabled", true,
245
+ + "optimize. minecart.enabled", true,
244
246
+ listOf(
245
247
+ "Enable this feature to handle large amount of stacked Minecart better.",
246
248
+ "By skipping tick collisions to reduce expense getting entities list",
247
249
+ "and bukkit event calls, useful for the anarchy server."
248
250
+ )
249
251
+ )
250
- + addDefault("leaf .optimize-minecart.skipTickCount", 30)
252
+ + addDefault("optimize .optimize-minecart.skipTickCount", 30)
251
253
+
252
254
+ addDefault(
253
- + "mobtimizations.optimizationMobRePathfinding ",
255
+ + "optimize.mob-re-pathfinding ",
254
256
+ true,
255
257
+ "If true, disables the frequent pathfinds done while already following a path"
256
258
+ )
257
259
+ addDefault(
258
- + "mobtimizations.optimizationZombieSearchAndDestroyTurtleEgg ",
260
+ + "optimize.zombie-search-and-destroy-turtle-egg.enabled ",
259
261
+ false,
260
262
+ "If true, optimizes the expensive searching done to find a turtle egg to crush, for zombies/husks, by default fully disabling it"
261
263
+ )
262
264
+ addDefault(
263
- + "mobtimizations.zombieSearchAndDestroyTurtleEggPercentChance ",
265
+ + "optimize.zombie-search-and-destroy-turtle-egg.percent-chance ",
264
266
+ 40,
265
267
+ "Percent chance to run for task: zombie seeking turtle eggs to destroy"
266
268
+ )
267
269
+
268
- + addDefault("divine. optimize- noise-generation", true)
270
+ + addDefault("optimize. noise-generation", true)
269
271
+
270
272
+ configuration.options().copyDefaults(true)
271
273
+ configuration.save(configFile)
272
274
+ }
273
275
+
274
276
+ private fun loadConfigValue() {
275
- + Fix.incorrectBounceLogic = getBoolean("vine. fix.incorrect-bounce-logic")
276
- + Fix.explosionBreaksItemFrameInWater = getBoolean("vine. fix.explosion-breaks-item-frame-in-water")
277
+ + Fix.incorrectBounceLogic = getBoolean("fix.incorrect-bounce-logic")
278
+ + Fix.explosionBreaksItemFrameInWater = getBoolean("fix.explosion-breaks-item-frame-in-water")
277
279
+
278
- + LevelBukkit.tryFixAnvilDrop = getBoolean("levelbukkit.try- fix- anvil-drop.enabled")
279
- + LevelBukkit.tryFixAnvilDropLogger = getBoolean("levelbukkit.try- fix- anvil-drop.debug")
280
- + Leaf.OptimizeMinecart .enabled = getBoolean("leaf. optimize- minecart.enabled")
281
- + Leaf.OptimizeMinecart .skipTickCount = getInt("leaf. optimize- minecart.skipTickCount")
280
+ + Fix.anvilDrop = getBoolean("fix. anvil-drop.enabled")
281
+ + Fix.anvilDropLogger = getBoolean("fix. anvil-drop.debug")
282
+ + Optimize.Minecart .enabled = getBoolean("optimize. minecart.enabled")
283
+ + Optimize.Minecart .skipTickCount = getInt("optimize. minecart.skipTickCount")
282
284
+
283
- + Mobtimizations.optimizationMobRePathfinding = getBoolean("mobtimizations.optimizationMobRePathfinding ")
284
- + Mobtimizations.optimizationZombieSearchAndDestroyTurtleEgg =
285
- + getBoolean("mobtimizations.optimizationZombieSearchAndDestroyTurtleEgg ")
286
- + Mobtimizations.zombieSearchAndDestroyTurtleEggPercentChance =
287
- + getInt("mobtimizations.zombieSearchAndDestroyTurtleEggPercentChance ")
285
+ + Optimize.mobRePathfinding = getBoolean("optimize.mob-re-pathfinding ")
286
+ + Optimize.TurtleEggSearch.enabled =
287
+ + getBoolean("optimize.zombie-search-and-destroy-turtle-egg.enabled ")
288
+ + Optimize.TurtleEggSearch.percentChance =
289
+ + getInt("optimize.zombie-search-and-destroy-turtle-egg.percent-chance ")
288
290
+
289
- + Divine.optimizeNoiseGeneration = getBoolean("divine. optimize- noise-generation")
291
+ + Optimize.noiseGeneration = getBoolean("optimize. noise-generation")
290
292
+ }
291
293
+
292
294
+ private fun addDefault(path: String, value: Any) {
@@ -329,44 +331,40 @@ index 0000000000000000000000000000000000000000..960b0d79a27c111d2d9750c05e04f8a0
329
331
+
330
332
+ object Fix {
331
333
+ @JvmField
332
- + var incorrectBounceLogic = false
334
+ + var anvilDrop = true
333
335
+
334
336
+ @JvmField
335
- + var explosionBreaksItemFrameInWater = false
336
- + }
337
+ + var anvilDropLogger = false
337
338
+
338
- + object LevelBukkit {
339
339
+ @JvmField
340
- + var tryFixAnvilDrop = true
340
+ + var explosionBreaksItemFrameInWater = false
341
341
+
342
342
+ @JvmField
343
- + var tryFixAnvilDropLogger = false
343
+ + var incorrectBounceLogic = false
344
344
+ }
345
345
+
346
- + object Leaf {
347
- + object OptimizeMinecart {
346
+ + object Optimize {
347
+ + @JvmField
348
+ + var noiseGeneration = true
349
+ +
350
+ + object Minecart {
348
351
+ @JvmField
349
352
+ var enabled = true
350
353
+
351
354
+ @JvmField
352
355
+ var skipTickCount = 30
353
356
+ }
354
- + }
355
357
+
356
- + object Mobtimizations {
357
358
+ @JvmField
358
- + var optimizationMobRePathfinding = true
359
+ + var mobRePathfinding = true
359
360
+
360
- + @JvmField
361
- + var optimizationZombieSearchAndDestroyTurtleEgg = false
362
- +
363
- + @JvmField
364
- + var zombieSearchAndDestroyTurtleEggPercentChance = 40
365
- + }
361
+ + object TurtleEggSearch {
362
+ + @JvmField
363
+ + var enabled = false
366
364
+
367
- + object Divine {
368
- + @JvmField
369
- + var optimizeNoiseGeneration = true
365
+ + @JvmField
366
+ + var percentChance = 40
367
+ + }
370
368
+ }
371
369
+ }
372
370
\ No newline at end of file
0 commit comments