From 2d4643a416e344a619e39d283fe36fac5bdcaf1d Mon Sep 17 00:00:00 2001 From: hub <> Date: Thu, 18 Apr 2024 23:48:20 +0200 Subject: [PATCH] Leijurvs Randar patch --- ...that-could-lead-to-coord-exploit-Ran.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 patches/server/0166-Patch-RNG-reuse-that-could-lead-to-coord-exploit-Ran.patch diff --git a/patches/server/0166-Patch-RNG-reuse-that-could-lead-to-coord-exploit-Ran.patch b/patches/server/0166-Patch-RNG-reuse-that-could-lead-to-coord-exploit-Ran.patch new file mode 100644 index 0000000..f48d95a --- /dev/null +++ b/patches/server/0166-Patch-RNG-reuse-that-could-lead-to-coord-exploit-Ran.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 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 src/main/java/net/minecraft/server/World.java src/main/java/net/minecraft/server/World.java +index cc9f467cc85704d536545aa63985340013e63703..a6e97eb3b57e65abf4399acbec9393bcab1ee2b9 100644 +--- src/main/java/net/minecraft/server/World.java ++++ 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(); ++ // Dionysus start ++ private final Random separateRandOnlyForWorldGen = new Random(); ++ // Dionysus end + public WorldProvider worldProvider; + protected NavigationListener t = new NavigationListener(); + protected List u; +@@ -3224,9 +3227,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; ++ // Dionysus start ++ this.separateRandOnlyForWorldGen.setSeed(l); ++ return this.separateRandOnlyForWorldGen; ++ // Dionysus end + } + + public CrashReportSystemDetails a(CrashReport crashreport) {