SPIGOT-7617: Add BlockExplodeEvent#getExplodedBlockState()

By: 2008Choco <hawkeboyz2@hotmail.com>
This commit is contained in:
CraftBukkit/Spigot
2024-04-29 20:08:56 +10:00
parent 1390477e34
commit a78a169340
5 changed files with 38 additions and 6 deletions

View File

@@ -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() {