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{
|
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);
|
$entity->attack($ev);
|
||||||
|
|
||||||
$ev = new EntityCombustByBlockEvent($this, $entity, 8);
|
$ev = new EntityCombustByBlockEvent($this, $entity, 8);
|
||||||
@ -55,6 +55,8 @@ abstract class BaseFire extends Flowable{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract protected function getFireDamage() : int;
|
||||||
|
|
||||||
public function getDropsForCompatibleTool(Item $item) : array{
|
public function getDropsForCompatibleTool(Item $item) : array{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,10 @@ class Fire extends BaseFire{
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getFireDamage() : int{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
public function onNearbyBlockChange() : void{
|
public function onNearbyBlockChange() : void{
|
||||||
$down = $this->getSide(Facing::DOWN);
|
$down = $this->getSide(Facing::DOWN);
|
||||||
if(SoulFire::canBeSupportedBy($down)){
|
if(SoulFire::canBeSupportedBy($down)){
|
||||||
|
@ -31,6 +31,10 @@ final class SoulFire extends BaseFire{
|
|||||||
return 10;
|
return 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getFireDamage() : int{
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
public static function canBeSupportedBy(Block $block) : bool{
|
public static function canBeSupportedBy(Block $block) : bool{
|
||||||
//TODO: this really ought to use some kind of tag system
|
//TODO: this really ought to use some kind of tag system
|
||||||
$id = $block->getTypeId();
|
$id = $block->getTypeId();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user