From 7380cef545e98480484b0abecfa0a51c02fb07ea Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot 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 By: DerFrZocker --- .../world/entity/animal/EntityBee.patch | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/paper-server/nms-patches/net/minecraft/world/entity/animal/EntityBee.patch b/paper-server/nms-patches/net/minecraft/world/entity/animal/EntityBee.patch index a5d577c7ac..a474e004e5 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/animal/EntityBee.patch +++ b/paper-server/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 @@ } }