aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SculkVeinBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SculkVeinBlock.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SculkVeinBlock.java.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SculkVeinBlock.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SculkVeinBlock.java.patch
new file mode 100644
index 0000000000..65795265b7
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/level/block/SculkVeinBlock.java.patch
@@ -0,0 +1,46 @@
+--- a/net/minecraft/world/level/block/SculkVeinBlock.java
++++ b/net/minecraft/world/level/block/SculkVeinBlock.java
+@@ -110,13 +107,13 @@
+ }
+
+ @Override
+- @Override
+- public int attemptUseCharge(SculkSpreader.ChargeCursor sculkspreader_chargecursor, LevelAccessor levelaccessor, BlockPos blockpos, RandomSource randomsource, SculkSpreader sculkspreader, boolean flag) {
+- return flag && this.attemptPlaceSculk(sculkspreader, levelaccessor, sculkspreader_chargecursor.getPos(), randomsource) ? sculkspreader_chargecursor.getCharge() - 1 : (randomsource.nextInt(sculkspreader.chargeDecayRate()) == 0 ? Mth.floor((float) sculkspreader_chargecursor.getCharge() * 0.5F) : sculkspreader_chargecursor.getCharge());
++ public int attemptUseCharge(SculkSpreader.ChargeCursor cursor, LevelAccessor level, BlockPos pos, RandomSource random, SculkSpreader spreader, boolean shouldConvertBlocks) {
++ // CraftBukkit - add source block
++ return shouldConvertBlocks && this.attemptPlaceSculk(spreader, level, cursor.getPos(), random, pos) ? cursor.getCharge() - 1 : (random.nextInt(spreader.chargeDecayRate()) == 0 ? Mth.floor((float) cursor.getCharge() * 0.5F) : cursor.getCharge());
+ }
+
+- private boolean attemptPlaceSculk(SculkSpreader sculkspreader, LevelAccessor levelaccessor, BlockPos blockpos, RandomSource randomsource) {
+- BlockState blockstate = levelaccessor.getBlockState(blockpos);
++ private boolean attemptPlaceSculk(SculkSpreader sculkspreader, LevelAccessor generatoraccess, BlockPos blockposition, RandomSource randomsource, BlockPos sourceBlock) { // CraftBukkit
++ IBlockData iblockdata = generatoraccess.getBlockState(blockposition);
+ TagKey<Block> tagkey = sculkspreader.replaceableBlocks();
+ Iterator iterator = Direction.allShuffled(randomsource).iterator();
+
+@@ -130,13 +127,17 @@
+ if (blockstate1.is(tagkey)) {
+ BlockState blockstate2 = Blocks.SCULK.defaultBlockState();
+
+- levelaccessor.setBlock(blockpos1, blockstate2, 3);
+- Block.pushEntitiesUp(blockstate1, blockstate2, levelaccessor, blockpos1);
+- levelaccessor.playSound((Player) null, blockpos1, SoundEvents.SCULK_BLOCK_SPREAD, SoundSource.BLOCKS, 1.0F, 1.0F);
+- this.veinSpreader.spreadAll(blockstate2, levelaccessor, blockpos1, sculkspreader.isWorldGeneration());
+- Direction direction1 = direction.getOpposite();
+- Direction[] adirection = SculkVeinBlock.DIRECTIONS;
+- int i = adirection.length;
++ // 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((Player) null, blockposition1, SoundEvents.SCULK_BLOCK_SPREAD, SoundSource.BLOCKS, 1.0F, 1.0F);
++ this.veinSpreader.spreadAll(iblockdata2, generatoraccess, blockposition1, sculkspreader.isWorldGeneration());
++ Direction enumdirection1 = enumdirection.getOpposite();
++ Direction[] aenumdirection = SculkVeinBlock.DIRECTIONS;
++ int i = aenumdirection.length;
+
+ for (int j = 0; j < i; ++j) {
+ Direction direction2 = adirection[j];