mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 06:24:06 +01:00
SPIGOT-3735: Missing call to BlockFadeEvent
This commit is contained in:
parent
e40c9ef4b9
commit
dc7d31b00d
@ -12,20 +12,7 @@
|
|||||||
public class BlockSoil extends Block {
|
public class BlockSoil extends Block {
|
||||||
|
|
||||||
public static final BlockStateInteger MOISTURE = BlockStateInteger.of("moisture", 0, 7);
|
public static final BlockStateInteger MOISTURE = BlockStateInteger.of("moisture", 0, 7);
|
||||||
@@ -36,6 +41,12 @@
|
@@ -45,14 +50,38 @@
|
||||||
if (i > 0) {
|
|
||||||
world.setTypeAndData(blockposition, iblockdata.set(BlockSoil.MOISTURE, Integer.valueOf(i - 1)), 2);
|
|
||||||
} else if (!this.c(world, blockposition)) {
|
|
||||||
+ // CraftBukkit start
|
|
||||||
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
|
||||||
+ if (CraftEventFactory.callBlockFadeEvent(block, Blocks.DIRT).isCancelled()) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ // CraftBukkit end
|
|
||||||
b(world, blockposition);
|
|
||||||
}
|
|
||||||
} else if (i < 7) {
|
|
||||||
@@ -45,11 +56,29 @@
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fallOn(World world, BlockPosition blockposition, Entity entity, float f) {
|
public void fallOn(World world, BlockPosition blockposition, Entity entity, float f) {
|
||||||
@ -56,3 +43,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected static void b(World world, BlockPosition blockposition) {
|
protected static void b(World world, BlockPosition blockposition) {
|
||||||
|
+ // CraftBukkit start
|
||||||
|
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||||
|
+ if (CraftEventFactory.callBlockFadeEvent(block, Blocks.DIRT).isCancelled()) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
|
world.setTypeUpdate(blockposition, Blocks.DIRT.getBlockData());
|
||||||
|
AxisAlignedBB axisalignedbb = BlockSoil.c.a(blockposition);
|
||||||
|
List list = world.getEntities((Entity) null, axisalignedbb);
|
||||||
|
Loading…
Reference in New Issue
Block a user