mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-30 20:03:51 -07:00
#1390: Improve internal handling of damage sources
By: Doc <nachito94@msn.com>
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
|
||||
public static DamageSource getDefaultDamageSource(World world, @Nullable Entity entity) {
|
||||
return world.damageSources().explosion(entity, getIndirectSourceEntityInternal(entity));
|
||||
@@ -86,17 +100,18 @@
|
||||
@@ -86,7 +100,7 @@
|
||||
this.hitPlayers = Maps.newHashMap();
|
||||
this.level = world;
|
||||
this.source = entity;
|
||||
@@ -37,11 +37,7 @@
|
||||
this.x = d0;
|
||||
this.y = d1;
|
||||
this.z = d2;
|
||||
this.fire = flag;
|
||||
this.blockInteraction = explosion_effect;
|
||||
- this.damageSource = damagesource == null ? world.damageSources().explosion(this) : damagesource;
|
||||
+ this.damageSource = damagesource == null ? world.damageSources().explosion(this).customCausingEntity(entity) : damagesource.customCausingEntity(entity); // CraftBukkit - handle source entity
|
||||
this.damageCalculator = explosiondamagecalculator == null ? this.makeDamageCalculator(entity) : explosiondamagecalculator;
|
||||
@@ -97,6 +111,7 @@
|
||||
this.smallExplosionParticles = particleparam;
|
||||
this.largeExplosionParticles = particleparam1;
|
||||
this.explosionSound = holder;
|
||||
@@ -144,7 +140,7 @@
|
||||
+ this.yield = event.getYield();
|
||||
+ } else {
|
||||
+ org.bukkit.block.Block block = location.getBlock();
|
||||
+ org.bukkit.block.BlockState blockState = (damageSource.blockState != null) ? damageSource.blockState : block.getState();
|
||||
+ org.bukkit.block.BlockState blockState = (damageSource.getDirectBlockState() != null) ? damageSource.getDirectBlockState() : block.getState();
|
||||
+ BlockExplodeEvent event = new BlockExplodeEvent(block, blockState, blockList, this.yield);
|
||||
+ this.level.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ this.wasCanceled = event.isCancelled();
|
||||
|
Reference in New Issue
Block a user