|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: ruViolence <78062896+ruViolence@users.noreply.github.com> |
| 3 | +Date: Sat, 20 Apr 2024 19:46:52 +0800 |
| 4 | +Subject: [PATCH] fix: randar exploit |
| 5 | + |
| 6 | +https://github.com/spawnmason/randar-explanation |
| 7 | + |
| 8 | +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java |
| 9 | +index 37381407f8b3c76aa72eb8e29bf4adc45dc97734..99774b0a68932e09e31974448979125e00bc7862 100644 |
| 10 | +--- a/src/main/java/net/minecraft/server/World.java |
| 11 | ++++ b/src/main/java/net/minecraft/server/World.java |
| 12 | +@@ -88,6 +88,7 @@ public abstract class World implements IBlockAccess { |
| 13 | + protected float q; |
| 14 | + private int M; |
| 15 | + public final Random random = new Random(); |
| 16 | ++ private final Random worldGenRandom = new Random(); // Reaper - Fix Randar |
| 17 | + public WorldProvider worldProvider; |
| 18 | + protected NavigationListener t = new NavigationListener(); |
| 19 | + protected List<IWorldAccess> u; |
| 20 | +@@ -3334,8 +3335,14 @@ public abstract class World implements IBlockAccess { |
| 21 | + public Random a(int i, int j, int k) { |
| 22 | + long l = (long) i * 341873128712L + (long) j * 132897987541L + this.getWorldData().getSeed() + (long) k; |
| 23 | + |
| 24 | ++ // Reaper start - Fix Randar |
| 25 | ++ if (false) { |
| 26 | + this.random.setSeed(l); |
| 27 | + return this.random; |
| 28 | ++ } |
| 29 | ++ this.worldGenRandom.setSeed(l); |
| 30 | ++ return this.worldGenRandom; |
| 31 | ++ // Reaper end - Fix Randar |
| 32 | + } |
| 33 | + |
| 34 | + public CrashReportSystemDetails a(CrashReport crashreport) { |
0 commit comments