Skip to content

Commit bcfc7aa

Browse files
committed
Patch randar exploit
1 parent 865d1a7 commit bcfc7aa

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: HaHaWTH <id_cn00@outlook.com>
3+
Date: Thu, 18 Apr 2024 18:31:50 +0800
4+
Subject: [PATCH] Fix-randar-exploit
5+
6+
7+
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
8+
index 0d0a57fdd28568d880ad48576571ffe431389849..5466e01c8be056061d1522a39e3495a5ff64b81b 100644
9+
--- a/src/main/java/net/minecraft/server/World.java
10+
+++ b/src/main/java/net/minecraft/server/World.java
11+
@@ -90,6 +90,7 @@ public abstract class World implements IBlockAccess {
12+
protected float q;
13+
private int M;
14+
public final Random random = new Random();
15+
+ private final Random separateRandOnlyForWorldGen = new Random(); // Beast - Fix Randar
16+
public WorldProvider worldProvider;
17+
protected NavigationListener t = new NavigationListener();
18+
protected List<IWorldAccess> u;
19+
@@ -3316,8 +3317,10 @@ public abstract class World implements IBlockAccess {
20+
public Random a(int i, int j, int k) {
21+
long l = (long) i * 341873128712L + (long) j * 132897987541L + this.getWorldData().getSeed() + (long) k;
22+
23+
- this.random.setSeed(l);
24+
- return this.random;
25+
+ // Beast start
26+
+ this.separateRandOnlyForWorldGen.setSeed(l);
27+
+ return this.separateRandOnlyForWorldGen;
28+
+ // Beast end
29+
}
30+
31+
public CrashReportSystemDetails a(CrashReport crashreport) {

0 commit comments

Comments
 (0)