SPIGOT-7617: Add BlockExplodeEvent#getExplodedBlockState()
By: 2008Choco <hawkeboyz2@hotmail.com>
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
--- a/net/minecraft/world/damagesource/DamageSource.java
|
||||
+++ b/net/minecraft/world/damagesource/DamageSource.java
|
||||
@@ -21,6 +21,86 @@
|
||||
@@ -21,6 +21,88 @@
|
||||
private final Entity directEntity;
|
||||
@Nullable
|
||||
private final Vec3D damageSourcePosition;
|
||||
+ // CraftBukkit start
|
||||
+ @Nullable
|
||||
+ private org.bukkit.block.Block directBlock; // The block that caused the damage. damageSourcePosition is not used for all block damages
|
||||
+ @Nullable
|
||||
+ public org.bukkit.block.BlockState blockState; // The block state of the block relevant to this damage source
|
||||
+ private boolean withSweep = false;
|
||||
+ private boolean melting = false;
|
||||
+ private boolean poison = false;
|
||||
|
||||
@@ -33,3 +33,22 @@
|
||||
public DamageSource inFire() {
|
||||
return this.inFire;
|
||||
}
|
||||
@@ -250,7 +266,17 @@
|
||||
}
|
||||
|
||||
public DamageSource badRespawnPointExplosion(Vec3D vec3d) {
|
||||
- return new DamageSource(this.damageTypes.getHolderOrThrow(DamageTypes.BAD_RESPAWN_POINT), vec3d);
|
||||
+ // CraftBukkit start
|
||||
+ return badRespawnPointExplosion(vec3d, null, null, null);
|
||||
+ }
|
||||
+
|
||||
+ public DamageSource badRespawnPointExplosion(Vec3D vec3d, net.minecraft.world.level.World world, net.minecraft.world.level.block.state.IBlockData blockData, net.minecraft.core.BlockPosition position) {
|
||||
+ DamageSource damageSource = new DamageSource(this.damageTypes.getHolderOrThrow(DamageTypes.BAD_RESPAWN_POINT), vec3d);
|
||||
+ if (world != null && blockData != null && position != null) {
|
||||
+ damageSource.blockState = org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(world, position, blockData, null);
|
||||
+ }
|
||||
+ return damageSource;
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
public DamageSource outOfBorder() {
|
||||
|
||||
Reference in New Issue
Block a user