diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/SculkSpreader.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/SculkSpreader.java.patch index ac78e04b92..a334f182c5 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/SculkSpreader.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/SculkSpreader.java.patch @@ -40,7 +40,15 @@ Logger logger = SculkSpreader.LOGGER; Objects.requireNonNull(logger); -@@ -126,7 +133,7 @@ +@@ -119,14 +126,14 @@ + int i = Math.min(list.size(), 32); + + for (int j = 0; j < i; ++j) { +- this.addCursor((SculkSpreader.ChargeCursor) list.get(j)); ++ this.addCursor((SculkSpreader.ChargeCursor) list.get(j), false); // Paper - don't fire event for block entity loading + } + } + } public void save(CompoundTag nbt) { @@ -49,12 +57,22 @@ Logger logger = SculkSpreader.LOGGER; Objects.requireNonNull(logger); -@@ -147,6 +154,19 @@ +@@ -139,14 +146,27 @@ + while (charge > 0) { + int j = Math.min(charge, 1000); - private void addCursor(SculkSpreader.ChargeCursor cursor) { +- this.addCursor(new SculkSpreader.ChargeCursor(pos, j)); ++ this.addCursor(new SculkSpreader.ChargeCursor(pos, j), true); // Paper - allow firing event for other causes + charge -= j; + } + + } + +- private void addCursor(SculkSpreader.ChargeCursor cursor) { ++ private void addCursor(SculkSpreader.ChargeCursor cursor, boolean fireEvent) { // Paper - add boolean to conditionally fire SculkBloomEvent if (this.cursors.size() < 32) { + // CraftBukkit start -+ if (!this.isWorldGeneration()) { // CraftBukkit - SPIGOT-7475: Don't call event during world generation ++ if (!this.isWorldGeneration() && fireEvent) { // CraftBukkit - SPIGOT-7475: Don't call event during world generation // Paper - add boolean to conditionally fire SculkBloomEvent + CraftBlock bukkitBlock = CraftBlock.at(this.level, cursor.pos); + SculkBloomEvent event = new SculkBloomEvent(bukkitBlock, cursor.getCharge()); + Bukkit.getPluginManager().callEvent(event);