Skip to content

Commit

Permalink
Implement Secure Seed
Browse files Browse the repository at this point in the history
  • Loading branch information
404Setup committed Aug 8, 2024
1 parent 2841004 commit 8e4451c
Show file tree
Hide file tree
Showing 29 changed files with 924 additions and 5 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

<div align=center>
<h2>Todo</h2>
<li>Implement Secure Seed</li>
<li>Implement Linear region format (Dangerous option)</li>
<li>Optional vanilla implementation</li>
<li>More mods implement.....</li>
Expand Down
17 changes: 15 additions & 2 deletions patches/server/0002-Vine-Config.patch
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ index 0000000000000000000000000000000000000000..6feb7269907d2c88a9eb5b52204e55c1
\ No newline at end of file
diff --git a/src/main/kotlin/one/tranic/vine/config/VineConfig.kt b/src/main/kotlin/one/tranic/vine/config/VineConfig.kt
new file mode 100644
index 0000000000000000000000000000000000000000..f0545fc5c5de0c98677d37ad25156986a8864aea
index 0000000000000000000000000000000000000000..92a37da6260e14ea747e0c0851723150108e0a7b
--- /dev/null
+++ b/src/main/kotlin/one/tranic/vine/config/VineConfig.kt
@@ -0,0 +1,271 @@
@@ -0,0 +1,284 @@
+package one.tranic.vine.config
+
+import gg.pufferfish.pufferfish.simd.SIMDDetection
Expand Down Expand Up @@ -286,6 +286,15 @@ index 0000000000000000000000000000000000000000..f0545fc5c5de0c98677d37ad25156986
+ "With that edge cases are more likely to happen"
+ )
+ )
+ addDefault(
+ "feature.secure-seed", false, listOf(
+ "Changes the seed from 64bit to 1024bit, this will strictly secure your seed,",
+ "making it almost impossible to crack.",
+ "Warning: You must delete existing maps to switch the state of the secure seed,",
+ "and do not modify it during hot loading, otherwise the server will crash and",
+ "cannot continue to load maps."
+ )
+ )
+
+ addDefault(
+ "optimize.minecart.enabled", true,
Expand Down Expand Up @@ -329,6 +338,7 @@ index 0000000000000000000000000000000000000000..f0545fc5c5de0c98677d37ad25156986
+ Feature.zeroTickPlants = getBoolean("feature.zero-tick-plants")
+ Feature.disableSpark = getBoolean("feature.disable-spark")
+ Feature.flattenTriangularDistribution = getBoolean("feature.flatten-triangular-distribution")
+ Feature.secureSeed = getBoolean("feature.secure-seed")
+
+ Optimize.Minecart.enabled = getBoolean("optimize.minecart.enabled")
+ Optimize.Minecart.skipTickCount = getInt("optimize.minecart.skipTickCount")
Expand Down Expand Up @@ -402,6 +412,9 @@ index 0000000000000000000000000000000000000000..f0545fc5c5de0c98677d37ad25156986
+ var zeroTickPlants = false
+
+ @JvmField
+ var secureSeed = false
+
+ @JvmField
+ var disableSpark = true
+ }
+
Expand Down
907 changes: 907 additions & 0 deletions patches/server/0018-Divine-Implement-Secure-Seed.patch

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,10 @@ index 26ec4838c476b8091f80aeac61db8041d5c89e88..b74042399b0c9d150f9e5d6178a2a850

i = Mth.clamp(i, 0, 15);
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
index a6b6e5ea191c0e2cd7a2e4f01b89d8af40a83c1b..149a73a5b7383ad3ec91c73f76f7913100202e8d 100644
index 86568d60cdc274ac7fe8d24f3518c8df24b9b409..4f3fd69c99c14cfa4b59caba37aa368fb4a20837 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
@@ -239,8 +239,8 @@ public class ChunkGeneratorStructureState {
@@ -248,8 +248,8 @@ public class ChunkGeneratorStructureState {

for (int j1 = 0; j1 < j; ++j1) {
double d1 = (double) (4 * i + i * i1 * 6) + (randomsource.nextDouble() - 0.5D) * (double) i * 2.5D;
Expand Down
File renamed without changes.

0 comments on commit 8e4451c

Please sign in to comment.