Register damage caused by PrimedTNT entities as BLOCK_EXPLOSION
This fixes BUKKIT-74
Dieser Commit ist enthalten in:
Ursprung
9fe5529791
Commit
8511ef3902
@ -7,6 +7,7 @@ import java.util.Random;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
|
import org.bukkit.entity.TNTPrimed;
|
||||||
import org.bukkit.event.entity.EntityDamageByBlockEvent;
|
import org.bukkit.event.entity.EntityDamageByBlockEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
@ -135,7 +136,14 @@ public class Explosion {
|
|||||||
entity.motZ += d2 * d10;
|
entity.motZ += d2 * d10;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(this.source.getBukkitEntity(), damagee, EntityDamageEvent.DamageCause.ENTITY_EXPLOSION, damageDone);
|
final org.bukkit.entity.Entity damager = this.source.getBukkitEntity();
|
||||||
|
final EntityDamageEvent.DamageCause damageCause;
|
||||||
|
if (damager instanceof TNTPrimed) {
|
||||||
|
damageCause = EntityDamageEvent.DamageCause.BLOCK_EXPLOSION;
|
||||||
|
} else {
|
||||||
|
damageCause = EntityDamageEvent.DamageCause.ENTITY_EXPLOSION;
|
||||||
|
}
|
||||||
|
EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(damager, damagee, damageCause, damageDone);
|
||||||
server.getPluginManager().callEvent(event);
|
server.getPluginManager().callEvent(event);
|
||||||
|
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren