From 1bf30a4e9019c8a6444e1460135c6c33d72f45a2 Mon Sep 17 00:00:00 2001 From: DerFrZocker Date: Tue, 3 Oct 2023 11:56:23 +0200 Subject: [PATCH] SPIGOT-7495: Spawning bee entity in asynchronous BlockPopulator causes IllegalStateException - Accessing LegacyRandomSource from multiple threads --- .../world/entity/animal/EntityBee.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/nms-patches/net/minecraft/world/entity/animal/EntityBee.patch b/nms-patches/net/minecraft/world/entity/animal/EntityBee.patch index a5d577c7a..a474e004e 100644 --- a/nms-patches/net/minecraft/world/entity/animal/EntityBee.patch +++ b/nms-patches/net/minecraft/world/entity/animal/EntityBee.patch @@ -39,6 +39,24 @@ } } +@@ -999,7 +1008,7 @@ + + e() { + super(); +- this.travellingTicks = EntityBee.this.level().random.nextInt(10); ++ this.travellingTicks = EntityBee.this.random.nextInt(10); // CraftBukkit - SPIGOT-7495: Give Bees another chance and let them use their own random, avoid concurrency issues + this.blacklistedTargets = Lists.newArrayList(); + this.setFlags(EnumSet.of(PathfinderGoal.Type.MOVE)); + } +@@ -1116,7 +1125,7 @@ + + f() { + super(); +- this.travellingTicks = EntityBee.this.level().random.nextInt(10); ++ this.travellingTicks = EntityBee.this.random.nextInt(10); // CraftBukkit - SPIGOT-7495: Give Bees another chance and let them use their own random, avoid concurrency issues + this.setFlags(EnumSet.of(PathfinderGoal.Type.MOVE)); + } + @@ -1216,7 +1225,7 @@ } }