SPIGOT-7060: SCULK and SCULK_VEIN BlockSpreadEvents do not reference the correct source
This commit is contained in:
parent
3571ca8d13
commit
8fda4b12fd
@ -7,7 +7,7 @@
|
|||||||
- generatoraccess.setBlock(blockposition2, iblockdata, 3);
|
- generatoraccess.setBlock(blockposition2, iblockdata, 3);
|
||||||
- generatoraccess.playSound((EntityHuman) null, blockposition1, iblockdata.getSoundType().getPlaceSound(), SoundCategory.BLOCKS, 1.0F, 1.0F);
|
- generatoraccess.playSound((EntityHuman) null, blockposition1, iblockdata.getSoundType().getPlaceSound(), SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||||
+ // CraftBukkit start - Call BlockSpreadEvent
|
+ // CraftBukkit start - Call BlockSpreadEvent
|
||||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(generatoraccess, blockposition1, blockposition2, iblockdata, 3)) {
|
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(generatoraccess, blockposition, blockposition2, iblockdata, 3)) {
|
||||||
+ generatoraccess.playSound((EntityHuman) null, blockposition1, iblockdata.getSoundType().getPlaceSound(), SoundCategory.BLOCKS, 1.0F, 1.0F);
|
+ generatoraccess.playSound((EntityHuman) null, blockposition1, iblockdata.getSoundType().getPlaceSound(), SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
@ -1,12 +1,26 @@
|
|||||||
--- a/net/minecraft/world/level/block/SculkVeinBlock.java
|
--- a/net/minecraft/world/level/block/SculkVeinBlock.java
|
||||||
+++ b/net/minecraft/world/level/block/SculkVeinBlock.java
|
+++ b/net/minecraft/world/level/block/SculkVeinBlock.java
|
||||||
@@ -121,7 +121,11 @@
|
@@ -103,10 +103,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();
|
||||||
|
@@ -121,7 +122,11 @@
|
||||||
if (iblockdata1.is(tagkey)) {
|
if (iblockdata1.is(tagkey)) {
|
||||||
IBlockData iblockdata2 = Blocks.SCULK.defaultBlockState();
|
IBlockData iblockdata2 = Blocks.SCULK.defaultBlockState();
|
||||||
|
|
||||||
- generatoraccess.setBlock(blockposition1, iblockdata2, 3);
|
- generatoraccess.setBlock(blockposition1, iblockdata2, 3);
|
||||||
+ // CraftBukkit start - Call BlockSpreadEvent
|
+ // CraftBukkit start - Call BlockSpreadEvent
|
||||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(generatoraccess, blockposition, blockposition1, iblockdata2, 3)) {
|
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(generatoraccess, sourceBlock, blockposition1, iblockdata2, 3)) {
|
||||||
+ return false;
|
+ return false;
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user