diff --git a/Spigot-Server-Patches/0386-Patch-RNG-reuse-that-could-lead-to-coord-exploit-Ran.patch b/Spigot-Server-Patches/0386-Patch-RNG-reuse-that-could-lead-to-coord-exploit-Ran.patch new file mode 100644 index 00000000..cbccacc4 --- /dev/null +++ b/Spigot-Server-Patches/0386-Patch-RNG-reuse-that-could-lead-to-coord-exploit-Ran.patch @@ -0,0 +1,37 @@ +From eb0276ce90794a32825d71108f69f412268c6263 Mon Sep 17 00:00:00 2001 +From: Leijurv +Date: Tue, 16 Apr 2024 19:43:08 -0700 +Subject: [PATCH] Patch RNG reuse that could lead to coord exploit (Randar) + + +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index bc231c7f2..92c3e25f0 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -89,6 +89,9 @@ public abstract class World implements IBlockAccess { + protected float q; + private int M; + public final Random random = new Random(); ++ // Paper start ++ private final Random separateRandOnlyForWorldGen = new Random(); ++ // Paper end + public WorldProvider worldProvider; + protected NavigationListener t = new NavigationListener(); + protected List u; +@@ -3167,9 +3170,10 @@ public abstract class World implements IBlockAccess { + + public Random a(int i, int j, int k) { + long l = (long) i * 341873128712L + (long) j * 132897987541L + this.getWorldData().getSeed() + (long) k; +- +- this.random.setSeed(l); +- return this.random; ++ // Paper start ++ this.separateRandOnlyForWorldGen.setSeed(l); ++ return this.separateRandOnlyForWorldGen; ++ // Paper end + } + + public CrashReportSystemDetails a(CrashReport crashreport) { +-- +2.37.0 (Apple Git-136) +