SPIGOT-7617: Add BlockExplodeEvent#getExplodedBlockState()
By: 2008Choco <hawkeboyz2@hotmail.com>
This commit is contained in:
@@ -116,7 +116,7 @@
|
||||
entity.setDeltaMovement(entity.getDeltaMovement().add(vec3d1));
|
||||
if (entity instanceof EntityHuman) {
|
||||
EntityHuman entityhuman = (EntityHuman) entity;
|
||||
@@ -290,9 +349,63 @@
|
||||
@@ -290,9 +349,65 @@
|
||||
|
||||
SystemUtils.shuffle(this.toBlow, this.level.random);
|
||||
ObjectListIterator objectlistiterator = this.toBlow.iterator();
|
||||
@@ -143,7 +143,9 @@
|
||||
+ bukkitBlocks = event.blockList();
|
||||
+ this.yield = event.getYield();
|
||||
+ } else {
|
||||
+ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.yield);
|
||||
+ org.bukkit.block.Block block = location.getBlock();
|
||||
+ org.bukkit.block.BlockState blockState = (damageSource.blockState != null) ? damageSource.blockState : block.getState();
|
||||
+ BlockExplodeEvent event = new BlockExplodeEvent(block, blockState, blockList, this.yield);
|
||||
+ this.level.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ this.wasCanceled = event.isCancelled();
|
||||
+ bukkitBlocks = event.blockList();
|
||||
@@ -180,7 +182,7 @@
|
||||
|
||||
this.level.getBlockState(blockposition).onExplosionHit(this.level, blockposition, this, (itemstack, blockposition1) -> {
|
||||
addOrAppendStack(list, itemstack, blockposition1);
|
||||
@@ -317,7 +430,11 @@
|
||||
@@ -317,7 +432,11 @@
|
||||
BlockPosition blockposition1 = (BlockPosition) objectlistiterator1.next();
|
||||
|
||||
if (this.random.nextInt(3) == 0 && this.level.getBlockState(blockposition1).isAir() && this.level.getBlockState(blockposition1.below()).isSolidRender(this.level, blockposition1.below())) {
|
||||
@@ -193,7 +195,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -325,6 +442,7 @@
|
||||
@@ -325,6 +444,7 @@
|
||||
}
|
||||
|
||||
private static void addOrAppendStack(List<Pair<ItemStack, BlockPosition>> list, ItemStack itemstack, BlockPosition blockposition) {
|
||||
|
||||
Reference in New Issue
Block a user