diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SculkSpreader.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SculkSpreader.java.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SculkSpreader.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SculkSpreader.java.patch new file mode 100644 index 0000000000..422c2e4ea0 --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SculkSpreader.java.patch @@ -0,0 +1,43 @@ +--- a/net/minecraft/world/level/block/SculkSpreader.java ++++ b/net/minecraft/world/level/block/SculkSpreader.java +@@ -40,6 +42,10 @@ + import net.minecraft.world.level.LevelAccessor; + import net.minecraft.world.level.block.state.BlockState; + import org.slf4j.Logger; ++import org.bukkit.Bukkit; ++import org.bukkit.craftbukkit.block.CraftBlock; ++import org.bukkit.event.block.SculkBloomEvent; ++// CraftBukkit end + + public class SculkSpreader { + +@@ -56,6 +62,7 @@ + private final int additionalDecayRate; + private List<SculkSpreader.ChargeCursor> cursors = new ArrayList(); + private static final Logger LOGGER = LogUtils.getLogger(); ++ public Level level; // CraftBukkit + + public SculkSpreader(boolean flag, TagKey<Block> tagkey, int i, int j, int k, int l) { + this.isWorldGeneration = flag; +@@ -146,7 +153,20 @@ + + private void addCursor(SculkSpreader.ChargeCursor sculkspreader_chargecursor) { + if (this.cursors.size() < 32) { +- this.cursors.add(sculkspreader_chargecursor); ++ // CraftBukkit start ++ if (!isWorldGeneration()) { // CraftBukkit - SPIGOT-7475: Don't call event during world generation ++ CraftBlock bukkitBlock = CraftBlock.at(level, cursor.pos); ++ SculkBloomEvent event = new SculkBloomEvent(bukkitBlock, cursor.getCharge()); ++ Bukkit.getPluginManager().callEvent(event); ++ if (event.isCancelled()) { ++ return; ++ } ++ ++ cursor.charge = event.getCharge(); ++ } ++ // CraftBukkit end ++ ++ this.cursors.add(cursor); + } + } + |