33 lines
2.1 KiB
Diff
33 lines
2.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: MrHua269 <mrhua269@gmail.com>
|
|
Date: Wed, 8 Jul 2026 20:59:01 +0800
|
|
Subject: [PATCH] Correct thread unsafe random sources
|
|
|
|
|
|
diff --git a/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java b/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java
|
|
index 01b3cda3da79abd30860eb33491ac00f9e958767..445858e4d39bd417e1e85bcb9bc7c1a4bc9d5fb0 100644
|
|
--- a/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java
|
|
+++ b/net/minecraft/world/entity/npc/wanderingtrader/WanderingTraderSpawner.java
|
|
@@ -30,7 +30,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
|
|
private static final int SPAWN_CHANCE_INCREASE = 25;
|
|
private static final int SPAWN_ONE_IN_X_CHANCE = 10;
|
|
private static final int NUMBER_OF_SPAWN_ATTEMPTS = 10;
|
|
- private final RandomSource random = RandomSource.create();
|
|
+ private final RandomSource random = io.papermc.paper.threadedregions.util.ThreadLocalRandomSource.INSTANCE; // Camellia - Correct thread unsafe random sources
|
|
private final SavedDataStorage savedDataStorage;
|
|
// Folia - moved to global data
|
|
|
|
diff --git a/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java b/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
|
|
index 22b9f70f76ff8f592359e958fa439e9806a29fcc..45fcc35a3e8c4b80b53c96dc810bd51fb07e3dee 100644
|
|
--- a/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
|
|
+++ b/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
|
|
@@ -28,7 +28,7 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable
|
|
public float rot;
|
|
public float oRot;
|
|
public float tRot;
|
|
- private static final RandomSource RANDOM = RandomSource.create();
|
|
+ private static final RandomSource RANDOM = io.papermc.paper.threadedregions.util.ThreadLocalRandomSource.INSTANCE; // Camellia - Correct thread unsafe random sources
|
|
private @Nullable Component name;
|
|
|
|
public EnchantingTableBlockEntity(final BlockPos worldPosition, final BlockState blockState) {
|