mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-29 11:23:52 -07:00
@@ -9,40 +9,28 @@
|
||||
public class EntityFallingBlock extends Entity {
|
||||
|
||||
private IBlockData block;
|
||||
@@ -71,7 +73,7 @@
|
||||
@@ -73,7 +75,7 @@
|
||||
|
||||
if (this.ticksLived++ == 0) {
|
||||
blockposition = new BlockPosition(this);
|
||||
- if (this.world.getType(blockposition).getBlock() == block) {
|
||||
+ if (this.world.getType(blockposition).getBlock() == block && !CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.getBlockData()).isCancelled()) {
|
||||
this.world.setAir(blockposition);
|
||||
this.world.a(blockposition, false);
|
||||
} else if (!this.world.isClientSide) {
|
||||
this.die();
|
||||
@@ -112,7 +114,7 @@
|
||||
@@ -125,6 +127,11 @@
|
||||
this.block = (IBlockData) this.block.set(BlockProperties.C, true);
|
||||
}
|
||||
|
||||
if (!flag1 && BlockFalling.canFallThrough(this.world.getType(new BlockPosition(this.locX, this.locY - 0.009999999776482582D, this.locZ)))) {
|
||||
this.onGround = false;
|
||||
- return;
|
||||
+ // return; // CraftBukkit
|
||||
}
|
||||
|
||||
this.motX *= 0.699999988079071D;
|
||||
@@ -121,7 +123,13 @@
|
||||
if (iblockdata.getBlock() != Blocks.MOVING_PISTON) {
|
||||
this.die();
|
||||
if (!this.f) {
|
||||
- if (iblockdata.getMaterial().isReplaceable() && (flag1 || !BlockFalling.canFallThrough(this.world.getType(blockposition.down()))) && this.world.setTypeAndData(blockposition, this.block, 3)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (iblockdata.getMaterial().isReplaceable() && (flag1 || !BlockFalling.canFallThrough(this.world.getType(blockposition.down())))) {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, this.block).isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ this.world.setTypeAndData(blockposition, this.block, 3);
|
||||
+ // CraftBukkit end
|
||||
if (block instanceof BlockFalling) {
|
||||
((BlockFalling) block).a(this.world, blockposition, this.block, iblockdata);
|
||||
}
|
||||
@@ -175,7 +183,9 @@
|
||||
if (this.world.setTypeAndData(blockposition, this.block, 3)) {
|
||||
if (block instanceof BlockFalling) {
|
||||
((BlockFalling) block).a(this.world, blockposition, this.block, iblockdata);
|
||||
@@ -179,7 +186,9 @@
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
|
||||
|
Reference in New Issue
Block a user