aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkBlock.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkBlock.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkBlock.java.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkBlock.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkBlock.java.patch
new file mode 100644
index 0000000000..630c4ffcd1
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/block/SculkBlock.java.patch
@@ -0,0 +1,42 @@
+--- a/net/minecraft/world/level/block/SculkBlock.java
++++ b/net/minecraft/world/level/block/SculkBlock.java
+@@ -25,20 +29,25 @@
+ }
+
+ @Override
+- public int attemptUseCharge(
+- SculkSpreader.ChargeCursor cursor, LevelAccessor level, BlockPos pos, RandomSource random, SculkSpreader spreader, boolean shouldConvertBlocks
+- ) {
+- int charge = cursor.getCharge();
+- if (charge != 0 && random.nextInt(spreader.chargeDecayRate()) == 0) {
+- BlockPos pos1 = cursor.getPos();
+- boolean flag = pos1.closerThan(pos, (double)spreader.noGrowthRadius());
+- if (!flag && canPlaceGrowth(level, pos1)) {
+- int i = spreader.growthSpawnCost();
+- if (random.nextInt(i) < charge) {
+- BlockPos blockPos = pos1.above();
+- BlockState randomGrowthState = this.getRandomGrowthState(level, blockPos, random, spreader.isWorldGeneration());
+- level.setBlock(blockPos, randomGrowthState, 3);
+- level.playSound(null, pos1, randomGrowthState.getSoundType().getPlaceSound(), SoundSource.BLOCKS, 1.0F, 1.0F);
++ public int attemptUseCharge(SculkSpreader.ChargeCursor cursor, LevelAccessor level, BlockPos pos, RandomSource random, SculkSpreader spreader, boolean shouldConvertBlocks) {
++ int i = cursor.getCharge();
++
++ if (i != 0 && random.nextInt(spreader.chargeDecayRate()) == 0) {
++ BlockPos blockposition1 = cursor.getPos();
++ boolean flag1 = blockposition1.closerThan(pos, (double) spreader.noGrowthRadius());
++
++ if (!flag1 && canPlaceGrowth(level, blockposition1)) {
++ int j = spreader.growthSpawnCost();
++
++ if (random.nextInt(j) < i) {
++ BlockPos blockposition2 = blockposition1.above();
++ IBlockData iblockdata = this.getRandomGrowthState(level, blockposition2, random, spreader.isWorldGeneration());
++
++ // CraftBukkit start - Call BlockSpreadEvent
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(level, pos, blockposition2, iblockdata, 3)) {
++ level.playSound((Player) null, blockposition1, iblockdata.getSoundType().getPlaceSound(), SoundSource.BLOCKS, 1.0F, 1.0F);
++ }
++ // CraftBukkit end
+ }
+
+ return Math.max(0, charge - i);