diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkSpreader.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkSpreader.java.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkSpreader.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkSpreader.java.patch new file mode 100644 index 0000000000..3db9c3c729 --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkSpreader.java.patch @@ -0,0 +1,41 @@ +--- a/net/minecraft/world/level/block/SculkSpreader.java ++++ b/net/minecraft/world/level/block/SculkSpreader.java +@@ -36,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 { + public static final int MAX_GROWTH_RATE_RADIUS = 24; +@@ -51,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 isWorldGeneration, TagKey<Block> replaceableBlocks, int growthSpawnCoat, int noGrowthRadius, int chargeDecayRate, int additionalDecayRate +@@ -138,6 +153,19 @@ + + private void addCursor(SculkSpreader.ChargeCursor cursor) { + if (this.cursors.size() < 32) { ++ // 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); + } + } |