From dc3bd245f7e6f3e673aebb4da09ba6ffaa8e6a5c Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 6 Sep 2023 19:09:38 +0200 Subject: [PATCH] SPIGOT-7475: Don't fire SculkBloomEvent during world generation By: DerFrZocker --- .../world/level/block/SculkSpreader.patch | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/paper-server/nms-patches/net/minecraft/world/level/block/SculkSpreader.patch b/paper-server/nms-patches/net/minecraft/world/level/block/SculkSpreader.patch index 80c47c7971..5bf2ebb7f4 100644 --- a/paper-server/nms-patches/net/minecraft/world/level/block/SculkSpreader.patch +++ b/paper-server/nms-patches/net/minecraft/world/level/block/SculkSpreader.patch @@ -41,24 +41,27 @@ Logger logger = SculkSpreader.LOGGER; Objects.requireNonNull(logger); -@@ -146,6 +155,16 @@ +@@ -146,6 +155,19 @@ private void addCursor(SculkSpreader.a sculkspreader_a) { if (this.cursors.size() < 32) { + // CraftBukkit start -+ CraftBlock bukkitBlock = CraftBlock.at(level, sculkspreader_a.pos); -+ SculkBloomEvent event = new SculkBloomEvent(bukkitBlock, sculkspreader_a.getCharge()); -+ Bukkit.getPluginManager().callEvent(event); -+ if (event.isCancelled()) -+ return; ++ if (!isWorldGeneration()) { // CraftBukkit - SPIGOT-7475: Don't call event during world generation ++ CraftBlock bukkitBlock = CraftBlock.at(level, sculkspreader_a.pos); ++ SculkBloomEvent event = new SculkBloomEvent(bukkitBlock, sculkspreader_a.getCharge()); ++ Bukkit.getPluginManager().callEvent(event); ++ if (event.isCancelled()) { ++ return; ++ } + -+ sculkspreader_a.charge = event.getCharge(); ++ sculkspreader_a.charge = event.getCharge(); ++ } + // CraftBukkit end + this.cursors.add(sculkspreader_a); } } -@@ -241,7 +260,7 @@ +@@ -241,7 +263,7 @@ this.charge = i; this.decayDelay = j; this.updateDelay = k;