From bee74680e607c2e29b038329f62181238911cd83 Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Sun, 14 Jan 2024 11:04:49 +0100 Subject: add remapped patches as a test --- .../world/level/block/SculkSpreader.java.patch | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkSpreader.java.patch (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkSpreader.java.patch') 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 cursors = new ArrayList<>(); + private static final Logger LOGGER = LogUtils.getLogger(); ++ public Level level; // CraftBukkit + + public SculkSpreader( + boolean isWorldGeneration, TagKey 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); + } + } -- cgit v1.2.3