mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-29 06:39:51 +00:00
Fixed SoulFire damage (#5138)
This commit is contained in:
parent
a8728a02f6
commit
a377795db9
@ -41,7 +41,7 @@ abstract class BaseFire extends Flowable{
|
||||
}
|
||||
|
||||
public function onEntityInside(Entity $entity) : bool{
|
||||
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_FIRE, 1);
|
||||
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_FIRE, $this->getFireDamage());
|
||||
$entity->attack($ev);
|
||||
|
||||
$ev = new EntityCombustByBlockEvent($this, $entity, 8);
|
||||
@ -55,6 +55,8 @@ abstract class BaseFire extends Flowable{
|
||||
return true;
|
||||
}
|
||||
|
||||
abstract protected function getFireDamage() : int;
|
||||
|
||||
public function getDropsForCompatibleTool(Item $item) : array{
|
||||
return [];
|
||||
}
|
||||
|
@ -61,6 +61,10 @@ class Fire extends BaseFire{
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function getFireDamage() : int{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function onNearbyBlockChange() : void{
|
||||
$down = $this->getSide(Facing::DOWN);
|
||||
if(SoulFire::canBeSupportedBy($down)){
|
||||
|
@ -31,6 +31,10 @@ final class SoulFire extends BaseFire{
|
||||
return 10;
|
||||
}
|
||||
|
||||
protected function getFireDamage() : int{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public static function canBeSupportedBy(Block $block) : bool{
|
||||
//TODO: this really ought to use some kind of tag system
|
||||
$id = $block->getTypeId();
|
||||
|
Loading…
x
Reference in New Issue
Block a user