aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/level/block/SculkVeinBlock.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/SculkVeinBlock.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/level/block/SculkVeinBlock.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/SculkVeinBlock.patch b/patch-remap/og/net/minecraft/world/level/block/SculkVeinBlock.patch
new file mode 100644
index 0000000000..73b7016900
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/level/block/SculkVeinBlock.patch
@@ -0,0 +1,29 @@
+--- a/net/minecraft/world/level/block/SculkVeinBlock.java
++++ b/net/minecraft/world/level/block/SculkVeinBlock.java
+@@ -108,10 +108,11 @@
+
+ @Override
+ public int attemptUseCharge(SculkSpreader.a sculkspreader_a, GeneratorAccess generatoraccess, BlockPosition blockposition, RandomSource randomsource, SculkSpreader sculkspreader, boolean flag) {
+- return flag && this.attemptPlaceSculk(sculkspreader, generatoraccess, sculkspreader_a.getPos(), randomsource) ? sculkspreader_a.getCharge() - 1 : (randomsource.nextInt(sculkspreader.chargeDecayRate()) == 0 ? MathHelper.floor((float) sculkspreader_a.getCharge() * 0.5F) : sculkspreader_a.getCharge());
++ // CraftBukkit - add source block
++ return flag && this.attemptPlaceSculk(sculkspreader, generatoraccess, sculkspreader_a.getPos(), randomsource, blockposition) ? sculkspreader_a.getCharge() - 1 : (randomsource.nextInt(sculkspreader.chargeDecayRate()) == 0 ? MathHelper.floor((float) sculkspreader_a.getCharge() * 0.5F) : sculkspreader_a.getCharge());
+ }
+
+- private boolean attemptPlaceSculk(SculkSpreader sculkspreader, GeneratorAccess generatoraccess, BlockPosition blockposition, RandomSource randomsource) {
++ private boolean attemptPlaceSculk(SculkSpreader sculkspreader, GeneratorAccess generatoraccess, BlockPosition blockposition, RandomSource randomsource, BlockPosition sourceBlock) { // CraftBukkit
+ IBlockData iblockdata = generatoraccess.getBlockState(blockposition);
+ TagKey<Block> tagkey = sculkspreader.replaceableBlocks();
+ Iterator iterator = EnumDirection.allShuffled(randomsource).iterator();
+@@ -126,7 +127,11 @@
+ if (iblockdata1.is(tagkey)) {
+ IBlockData iblockdata2 = Blocks.SCULK.defaultBlockState();
+
+- generatoraccess.setBlock(blockposition1, iblockdata2, 3);
++ // CraftBukkit start - Call BlockSpreadEvent
++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(generatoraccess, sourceBlock, blockposition1, iblockdata2, 3)) {
++ return false;
++ }
++ // CraftBukkit end
+ Block.pushEntitiesUp(iblockdata1, iblockdata2, generatoraccess, blockposition1);
+ generatoraccess.playSound((EntityHuman) null, blockposition1, SoundEffects.SCULK_BLOCK_SPREAD, SoundCategory.BLOCKS, 1.0F, 1.0F);
+ this.veinSpreader.spreadAll(iblockdata2, generatoraccess, blockposition1, sculkspreader.isWorldGeneration());