mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Added Event allocation pool, updated SPL with Class::onClassLoaded()
This commit is contained in:
@ -135,7 +135,7 @@ class Explosion{
|
||||
$yield = (1 / $this->size) * 100;
|
||||
|
||||
if($this->what instanceof Entity){
|
||||
$this->level->getServer()->getPluginManager()->callEvent($ev = new EntityExplodeEvent($this->what, $this->source, $this->affectedBlocks, $yield));
|
||||
$this->level->getServer()->getPluginManager()->callEvent($ev = EntityExplodeEvent::createEvent($this->what, $this->source, $this->affectedBlocks, $yield));
|
||||
if($ev->isCancelled()){
|
||||
return false;
|
||||
}else{
|
||||
@ -166,11 +166,11 @@ class Explosion{
|
||||
$damage = (int) ((($impact * $impact + $impact) / 2) * 8 * $explosionSize + 1);
|
||||
|
||||
if($this->what instanceof Entity){
|
||||
$ev = new EntityDamageByEntityEvent($this->what, $entity, EntityDamageEvent::CAUSE_ENTITY_EXPLOSION, $damage);
|
||||
$ev = EntityDamageByEntityEvent::createEvent($this->what, $entity, EntityDamageEvent::CAUSE_ENTITY_EXPLOSION, $damage);
|
||||
}elseif($this->what instanceof Block){
|
||||
$ev = new EntityDamageByBlockEvent($this->what, $entity, EntityDamageEvent::CAUSE_BLOCK_EXPLOSION, $damage);
|
||||
$ev = EntityDamageByBlockEvent::createEvent($this->what, $entity, EntityDamageEvent::CAUSE_BLOCK_EXPLOSION, $damage);
|
||||
}else{
|
||||
$ev = new EntityDamageEvent($entity, EntityDamageEvent::CAUSE_BLOCK_EXPLOSION, $damage);
|
||||
$ev = EntityDamageEvent::createEvent($entity, EntityDamageEvent::CAUSE_BLOCK_EXPLOSION, $damage);
|
||||
}
|
||||
|
||||
$this->level->getServer()->getPluginManager()->callEvent($ev);
|
||||
|
Reference in New Issue
Block a user